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: implement greptime cli export #2535

Merged
merged 5 commits into from
Oct 17, 2023

Conversation

waynexia
Copy link
Member

@waynexia waynexia commented Oct 7, 2023

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

implement greptime cli export command line for exporting all SHOW CREATE TABLE under one catalog。

E.g.:

greptime cli export --addr "127.0.0.1:4001" --catalog greptime --schema public --output-dir /tmp/greptimedb-export --target create-table

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.

Refer to a related PR or issue link (optional)

Signed-off-by: Ruihang Xia <[email protected]>
@codecov
Copy link

codecov bot commented Oct 7, 2023

Codecov Report

Merging #2535 (e310361) into develop (825e4be) will decrease coverage by 0.51%.
The diff coverage is 2.39%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2535      +/-   ##
===========================================
- Coverage    85.34%   84.84%   -0.51%     
===========================================
  Files          737      738       +1     
  Lines       117986   118193     +207     
===========================================
- Hits        100697   100277     -420     
- Misses       17289    17916     +627     

@sunng87
Copy link
Member

sunng87 commented Oct 8, 2023

How about changing --schema and --catalog to --database for consistency with mysql? So we don't need to explain schema/catalog concept in our docs.

@waynexia
Copy link
Member Author

waynexia commented Oct 8, 2023

How about changing --schema and --catalog to --database for consistency with mysql? So we don't need to explain schema/catalog concept in our docs.

--schema and --catalog can be assigned separately, e.g., only export tables under catalog = greptime. Does --database has the same semantic?

@sunng87
Copy link
Member

sunng87 commented Oct 8, 2023

In that case we will need to support wildcard with database, like --database=*, --database=greptime-* or --all. Note that we only have one catalog in self-hosted version so in most case it's like --all.

I think it's OK to have catalog/schema as an internal tool. But if we expose it as a user-facing tool we will need to explain those concepts.

@waynexia
Copy link
Member Author

@sunng87 @shuiyisong PTAL

@sunng87
Copy link
Member

sunng87 commented Oct 13, 2023

LGTM.

But on top of this we may need authentication or tls setup to secure this tool.

@killme2008
Copy link
Contributor

@shuiyisong PTAL

1 similar comment
@killme2008
Copy link
Contributor

@shuiyisong PTAL

Copy link
Contributor

@shuiyisong shuiyisong left a comment

Choose a reason for hiding this comment

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

Export create table SQL works on v0.3 clusters

@shuiyisong shuiyisong added this pull request to the merge queue Oct 17, 2023
@shuiyisong shuiyisong removed this pull request from the merge queue due to a manual request Oct 17, 2023
@shuiyisong shuiyisong added this pull request to the merge queue Oct 17, 2023
Merged via the queue into GreptimeTeam:develop with commit 9056c3a Oct 17, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants