-
Notifications
You must be signed in to change notification settings - Fork 144
feat(query): added Query::readonly method
#361
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
base: main
Are you sure you want to change the base?
feat(query): added Query::readonly method
#361
Conversation
Query::readonly method
| } | ||
|
|
||
| /// Set read-only option for this query. | ||
| pub fn readonly(mut self, enabled: bool) -> Self { |
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.
Strictly speaking, readonly is not a binary setting: https://clickhouse.com/docs/operations/settings/permissions-for-queries#readonly
This would be best represented by an enum like this:
pub enum ReadOnly {
Disabled,
Enabled,
WithChangeSettings, // bikeshedding
}You could make it possible to still pass a bool if you did something like this:
impl Query {
pub fn readonly(mut self, readonly: impl Into<ReadOnly>) -> Self { ... }
}
impl From<bool> for ReadOnly {
fn from(readonly: bool) -> Self {
if readonly {
Self::Enabled
} else {
Self::Disabled
}
}
}|
|
||
| * Optimize `RowCursor` by reusing buffer capacity where possible. ([#340]) | ||
| * All `Query::fetch*` methods will always use POST instead of GET. It is now allowed to change `readonly` value via | ||
| `Query::with_option`. ([#342]) |
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.
Please do not modify existing CHANGELOG entries; this will just confuse people trying to understand older releases because this does not exist in 0.14.1. You can either add a new entry under ## Unreleased or we will write one when cutting the release.
Summary
Closes #343