Skip to content
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

feat: support config sql metastore using username and password by env #17530

Merged
merged 4 commits into from
Jul 3, 2024

Conversation

yezizp2012
Copy link
Member

@yezizp2012 yezizp2012 commented Jul 2, 2024

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

Resolve #16998 .

  1. support config sqlite, postgres and mysql in --backend.
  2. add new configs correspondingly: --sql-username, --sql-password and --sql-database, which only required for postgres and mysql.
  3. --sql-endpoint should be configured in format {host}:{port} if the backend is set to postgres and mysql. For sqlite it should be the file path.

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added test labels as necessary. See details.
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

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.

Support configure sql metastore using username, password and database separately. The corresponding envs are also supported.

  1. support config sqlite, postgres and mysql in --backend.
  2. add new configs correspondingly: --sql-username, --sql-password and --sql-database, which only required for postgres and mysql.
  3. --sql-endpoint should be configured in format {host}:{port} if the backend is set to postgres and mysql. For sqlite it should be the file path.

@yezizp2012 yezizp2012 added the user-facing-changes Contains changes that are visible to users label Jul 2, 2024
pub sql_username: String,
/// Password of sql backend, required when meta backend set to MySQL or PostgreSQL.
#[clap(long, default_value = "")]
pub sql_password: String,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub sql_password: String,
pub sql_password: Secret<String>,

Does this need to be secret as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. Do we need it? @zwang28

Copy link
Contributor

@kwannoel kwannoel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM

@yezizp2012 yezizp2012 requested a review from zwang28 July 3, 2024 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/run-e2e-single-node-tests need-cherry-pick-release-1.10 Open a cherry-pick PR to branch release-1.10 after the current PR is merged type/feature user-facing-changes Contains changes that are visible to users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: allow passing meta store SQL URL username and password by env
3 participants