-
Notifications
You must be signed in to change notification settings - Fork 598
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ec5bfb2
refactor, move value into const
yufansong 2dffb9b
fix typo
yufansong 8a0b21d
change client_encoding into server_encoding
yufansong 4df0305
format
yufansong 003a21a
Merge branch 'main' into yufan/set-const-version
yufansong 8b46c26
format crate
yufansong 7daac99
format
yufansong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,6 +91,16 @@ pub const RW_VERSION: &str = env!("CARGO_PKG_VERSION"); | |
/// Placeholder for unknown git sha. | ||
pub const UNKNOWN_GIT_SHA: &str = "unknown"; | ||
|
||
// The single source of truth of the pg parameters, Used in ConfigMap and current_cluster_version. | ||
// The version of PostgreSQL that Risingwave claims to be. | ||
pub const PG_VERSION: &str = "9.5.0"; | ||
/// The version of PostgreSQL that Risingwave claims to be. | ||
pub const SERVER_VERSION_NUM: i32 = 90500; | ||
/// 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"; | ||
/// see <https://www.postgresql.org/docs/current/runtime-config-client.html#GUC-STANDARD-CONFORMING-STRINGS> | ||
pub const STANDARD_CONFORMING_STRINGS: &str = "on"; | ||
|
||
#[macro_export] | ||
macro_rules! git_sha { | ||
($env:literal) => { | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. @hzxa21 FYI there would be an extra - PostgreSQL 9.5-RisingWave-1.6.0 (abc)
+ PostgreSQL 9.5.0-RisingWave-1.7.0 (def) |
||
PG_VERSION, RW_VERSION, GIT_SHA | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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