-
Notifications
You must be signed in to change notification settings - Fork 599
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
refactor(frontend): Move some pg wire value into common and make them const #14519
Conversation
src/common/src/lib.rs
Outdated
/// Shows the server-side character set encoding. At present, this parameter can be shown but not set, because the encoding is determined at database creation time. | ||
pub const CLIENT_ENCODING: &str = "UTF8"; |
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.
The doc comment does not match the name. Let's rename it to SERVER_ENCODING
and add "it is also the default for CLIENT_ENCODING"
https://www.postgresql.org/docs/16/runtime-config-preset.html#GUC-SERVER-ENCODING
https://www.postgresql.org/docs/16/runtime-config-client.html#GUC-CLIENT-ENCODING
@@ -107,5 +117,8 @@ macro_rules! git_sha { | |||
pub const GIT_SHA: &str = git_sha!("GIT_SHA"); | |||
|
|||
pub fn current_cluster_version() -> String { | |||
format!("PostgreSQL 9.5-RisingWave-{} ({})", RW_VERSION, GIT_SHA) | |||
format!( | |||
"PostgreSQL {}-RisingWave-{} ({})", |
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.
@hzxa21 FYI there would be an extra .0
starting next release
- PostgreSQL 9.5-RisingWave-1.6.0 (abc)
+ PostgreSQL 9.5.0-RisingWave-1.7.0 (def)
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
In #11265
current_cluster_version
function which used infunction / streaming job / ddl controller
which should get from theConfigMap
.ParameterStatus
, we hard code theserver version / client encoding / StandardConformingString / ApplicationName
.This PR try to refactor the above two parts.
ConfigMap
into common and make they as pub const. Use this const when initialize theConfigMap
.ParameterStatus
from thesession_config
. But we use const value to initsession_config
, so we directly use the const forParameterStatus
. The same logic forcurrent_cluster_version
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.