-
Notifications
You must be signed in to change notification settings - Fork 110
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
Replace Query
with a more fitting name
#713
Comments
By the way, the same logic also applies to the names of the Sadly, Rust doesn't seem to have function overloading, so it's not possible to allow the same name |
Function overloading can be simulated to some extent via traits. For example, pub async fn execute(&self, stmt: &impl Executable) {
// ...
} Maybe this could be extended to batches as well. |
There is also potential use case of Batch interface is also a bit weird. Even right now it requires empty elements in values iterator on the positions corresponding to I see 2 main paths forward., correct me if I missed any. KISS, @cvybhu's approachIf we decide to do so, remove Advantages:
Disadvantages:
Executable traitCreate some trait, let's call it Advantages:
Disadvantages:
I like WDYT @piodul ? |
I like the idea of |
Confusingly, the driver calls unprepared statement a
Query
(contrary toPreparedStatement
). It's not a correct term and can lead to confusion. "Queries" are statements that ask for data and receive some data in return. "Statement" is a broader term and encompasses items that don't return data but rather modify data or schema, e.g.INSERT
orCREATE
. TheQuery
object has no problems with statements that are not queries.I suggest to rename
Query
to something that fits its purpose better, e.g.UnpreparedStatement
orSimpleStatement
- need to decide upon something, it's probably the best to look at the naming in other drivers. To ease transition to the new name, we will re-introduceQuery
as a type alias, then deprecate and eventually remove at some point.The documentation will have to be adjusted as well as it seems to use "query" and "statement" interchangeably, which is wrong due to the reasons described above but was probably caused by confusion resulting from the existing
Query
name.The text was updated successfully, but these errors were encountered: