Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: rename Read trait functions for alignment #27

Merged
merged 1 commit into from
Jun 29, 2024

Conversation

cdbrkfxrpt
Copy link
Contributor

The CUD subset of the CRUD traits have function names corresponding to their trait names:

  • Create has create
  • Update has update
  • Delete has delete (and delete_by)

This PR aligns the function names of the Read trait:

  • Read::find --> Read::read
  • Read::find_optional --> Read::find (because it returns an Option<T>, it actually does have "search"/"find" semantics

It also renames Update::save to Update::upsert, since the docs for Update::save literally said that this function has "upsert semantics".

Happy to discuss all of the above! I'd also be happy with get terminology, but in that case it would be cool if we could also rename the trait so there is always an "expectable" relationship between trait name and function names.

(There is also some further cleanup here.)

@cdbrkfxrpt cdbrkfxrpt self-assigned this Jun 29, 2024
@cdbrkfxrpt cdbrkfxrpt force-pushed the flrn/rename-read-functions branch 3 times, most recently from 602e44e to 9b2ca37 Compare June 29, 2024 12:41
@cdbrkfxrpt cdbrkfxrpt merged commit 03e2a0e into main Jun 29, 2024
4 checks passed
@cdbrkfxrpt cdbrkfxrpt deleted the flrn/rename-read-functions branch June 29, 2024 15:11
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