Electron100 / butane

An ORM for Rust with a focus on simplicity and on writing Rust, not SQL
Apache License 2.0
83 stars 11 forks source link

Ambiguous `find!` macro replaced with more explicit macros #125

Open joaommartins opened 1 year ago

joaommartins commented 1 year ago

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-style[^2] 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:

[^1]: SQLAlchemy legacy Query API. [^2]: SQLAlchemy 2.0-style Query API

Electron100 commented 1 year ago

Fair feedback. I agree that would be an improvement.