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

Ambiguous find! macro replaced with more explicit macros #125

Open
joaommartins opened this issue Jul 7, 2023 · 1 comment
Open

Ambiguous find! macro replaced with more explicit macros #125

joaommartins opened this issue Jul 7, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@joaommartins
Copy link
Contributor

The result of using the find! macro is ambiguous, not indicating under which conditions it will return an Error and silently discarding values

My proposal is to follow a combination of SQLAlchemy 1.4-1 and 2.0-style2 Query API, renaming find! with find_first!, keeping the prefix but appending the explicit method name that implies the return expectation and creating a few new macros for common operations:

  • find_first!
  • find_one!
  • find_all!
  • find_one_or_none!

Footnotes

  1. SQLAlchemy legacy Query API.

  2. SQLAlchemy 2.0-style Query API

@Electron100 Electron100 added the enhancement New feature or request label Jul 8, 2023
@Electron100
Copy link
Owner

Fair feedback. I agree that would be an improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants