-
Notifications
You must be signed in to change notification settings - Fork 126
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
rename Query
to Statement
#1250
Conversation
See the following report for details: cargo semver-checks output
|
ba7b6cd
to
97ea5bf
Compare
//! `ExecutionProfile` is a grouping of configurable options regarding CQL statement execution. | ||
//! | ||
//! Profiles can be created to represent different workloads, which thanks to them | ||
//! can be run conveniently on a single session. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Terminology: I'm not sure I like the term "statement execution". "request execution" seems better.
The way I understand the terminology we are aiming towards:
- statement: a string with the CQL command or an object representing it and parameters (like consistency)
- prepared statement: object representing the result of statement preparation and parameters
- query: CQL SELECT statement
- request: an abstract meaning some command that we want to execute on the server.
Given that terminlogy, "statement execution" doesn't make much sense because statement represents just a string with CQL (+ parameters).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Terminology: I'm not sure I like the term "statement execution". "request execution" seems better. The way I understand the terminology we are aiming towards:
statement: a string with the CQL command or an object representing it and parameters (like consistency)
prepared statement: object representing the result of statement preparation and parameters
query: CQL SELECT statement
request: an abstract meaning some command that we want to execute on the server.
Given that terminlogy, "statement execution" doesn't make much sense because statement represents just a string with CQL (+ parameters).
"statement execution" makes sense if applied to the very activity of the DB that performs actions described in the statement. OTOH, when referring to the driver's work around statements, it's definitely not executing statements - only executing requests that pass statements for execution on the server side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
request: an abstract meaning some command that we want to execute on the server.
My understanding of request is: a CQL protocol message, as well as the whole process of creating and sending it, possibly containing a CQL statement that is to be executed on server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep in mind, though, that some configuration options are set for the very statement execution on the server side. Examples include consistency, server-side timeouts, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, I believe the distinction between request execution and statement execution is not crucial and can be skipped over in majority of situations.
//! `ExecutionProfile` is a grouping of configurable options regarding CQL statement execution. | ||
//! | ||
//! Profiles can be created to represent different workloads, which thanks to them | ||
//! can be run conveniently on a single session. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep in mind, though, that some configuration options are set for the very statement execution on the server side. Examples include consistency, server-side timeouts, etc.
//! `ExecutionProfile` is a grouping of configurable options regarding CQL statement execution. | ||
//! | ||
//! Profiles can be created to represent different workloads, which thanks to them | ||
//! can be run conveniently on a single session. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, I believe the distinction between request execution and statement execution is not crucial and can be skipped over in majority of situations.
/// Sends a request to the database and receives a response.\ | ||
/// Performs an unpaged query, i.e. all results are received in a single response. | ||
/// Executes an unprepared CQL statement without paging, i.e. all results are received in a single response. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💭 👍 This makes sense to me. We send a CQL (protocol) request and, this way, we execute a CQL (language) statement, or, more precisely, we have the CQL statement executed on the server.
97ea5bf
to
4ed531c
Compare
Rebased on main |
4ed531c
to
3c5c5f6
Compare
So the statement are accessible only via `scylla::statement::` prefix.
53c5a33
to
809a700
Compare
v2:
I did not abandon the "statement execution" terminology yet. I think this is still to be discussed. |
- renamed `queries` directory to `statements`. - renamed `queries.md` -> `statements.md`. - rename `simple.md` -> `unprepared.md` Apart from that, I adjusted the documentation to use the new terminology.
809a700
to
72c5ed4
Compare
Fixes: #713
Changes
Renamed
Query
toStatement
(first commit)New name is definitely better than the old one. However, the question is if it's the best. Other candidates:
SimpleStatement
- used in other drivers, but probably a bit too verbose (justStatement
isSimple
enough).UnpreparedStatement
- verbose, but OTOH immediately gives user all information required about the type - it's literally an unprepared statement. The main downside is that the name is pretty long.Anyway, whatever the choice, the adjustment should be rather trivial (now that I spotted all mentions in the docs and docstrings).
Renamed
query.rs
tounprepared.rs
Adjusted docstrings and variable names to
statement
terminology (third commit)Adjusted docs (book) to
statement
terminologyThe word
query
was abused in the docs. In some cases, we would even call theINSERT ...
CQL statement a query. The last commit hopefully fixes that.Apart from that, regarding the docs structure:
queries
directory tostatements
queries/queries.md
tostatements/statements.md
queries/simple.md
tostatements/unprepared.md
Pre-review checklist
[ ] I added relevant tests for new features and bug fixes../docs/source/
.Fixes:
annotations to PR description.