Skip to content

refactor: rename repository/DAO operator get() to fetch()#1447

Merged
Futsch1 merged 1 commit into
mainfrom
refactor/repository-fetch-rename
May 28, 2026
Merged

refactor: rename repository/DAO operator get() to fetch()#1447
Futsch1 merged 1 commit into
mainfrom
refactor/repository-fetch-rename

Conversation

@Futsch1
Copy link
Copy Markdown
Owner

@Futsch1 Futsch1 commented May 27, 2026

Summary

  • Replaces operator fun get(id) with fun fetch(id) on all repository interfaces (MedicineRepository, ReminderRepository, ReminderEventRepository) and DAO interfaces (MedicineDao, ReminderDao, ReminderEventDao)
  • Updates all implementations and call sites (26 files total)
  • Updates test mocks/stubs accordingly

Motivation

The operator fun get() was introduced to satisfy SonarQube's naming rule, but it is not idiomatic Kotlin for this use case. Bracket-index syntax (repo[id]) implies simple in-memory indexing; these methods perform full Room database queries. fetch() communicates the intent clearly without SonarQube raising a naming issue.

🤖 Generated with Claude Code

Replace `operator fun get()` with `fun fetch()` across all repository
interfaces, DAO interfaces, their implementations, and all call sites.

The get() operator was introduced to satisfy SonarQube but is not
idiomatic for complex DB queries — bracket syntax implies simple
indexing, not full query execution.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Futsch1
Copy link
Copy Markdown
Owner Author

Futsch1 commented May 27, 2026

@ThomasKiljanczykDev
Seen your comment in the past PR. I was unsure if the operator was a good idea, your comment convinced me to replace this non-idiomatic solution.

@Futsch1 Futsch1 merged commit 223a2e3 into main May 28, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants