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: show database options #4174

Merged
merged 7 commits into from
Jun 20, 2024

Conversation

killme2008
Copy link
Contributor

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

#3708

What's changed and what's your intention?

Main changes:

  • Test creating tables with database TTL.
  • Adds options column to information_schema.schemata table:
mysql> select * from information_schema.schemata;
+--------------+--------------------+----------------------------+------------------------+----------+--------------+
| catalog_name | schema_name        | default_character_set_name | default_collation_name | sql_path | options      |
+--------------+--------------------+----------------------------+------------------------+----------+--------------+
| greptime     | greptime_private   | utf8                       | utf8_bin               | NULL     |              |
| greptime     | hertzbeat          | utf8                       | utf8_bin               | NULL     | ttl='30days' |
| greptime     | information_schema | utf8                       | utf8_bin               | NULL     |              |
| greptime     | public             | utf8                       | utf8_bin               | NULL     |              |
+--------------+--------------------+----------------------------+------------------------+----------+--------------+
  • Adds SHOW FULL DATABASES extension to show the database options:
 show full databases;
+--------------------+--------------+
| Database           | Options      |
+--------------------+--------------+
| greptime_private   |              |
| hertzbeat          | ttl='30days' |
| information_schema |              |
| public             |              |
+--------------------+--------------+

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR requires documentation updates.

@killme2008 killme2008 marked this pull request as ready for review June 19, 2024 22:50
@killme2008 killme2008 requested review from WenyXu, evenyag and fengjiachun and removed request for a team, MichaelScofield and evenyag June 19, 2024 22:50
@github-actions github-actions bot added the docs-required This change requires docs update. label Jun 19, 2024
@killme2008 killme2008 added the C-feature Category Features label Jun 19, 2024
Copy link

codecov bot commented Jun 19, 2024

Codecov Report

Attention: Patch coverage is 93.68421% with 6 lines in your changes missing coverage. Please review.

Project coverage is 84.83%. Comparing base (48a0f39) to head (9b1f345).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4174      +/-   ##
==========================================
- Coverage   85.15%   84.83%   -0.32%     
==========================================
  Files        1020     1020              
  Lines      179654   179738      +84     
==========================================
- Hits       152976   152476     -500     
- Misses      26678    27262     +584     

src/common/meta/src/key/schema_name.rs Outdated Show resolved Hide resolved
Co-authored-by: Weny Xu <[email protected]>
@killme2008 killme2008 added this pull request to the merge queue Jun 20, 2024
Merged via the queue into GreptimeTeam:main with commit 4306cba Jun 20, 2024
49 checks passed
@killme2008 killme2008 deleted the feature/test-database-ttl branch June 20, 2024 04:37
zyy17 pushed a commit to zyy17/greptimedb that referenced this pull request Jun 22, 2024
* test: test create table with database ttl

* feat: show database options

* fix: comment

* chore: apply suggestion

Co-authored-by: Jeremyhi <[email protected]>

* chore: fix CR comments and refactor

* chore: style

Co-authored-by: Weny Xu <[email protected]>

---------

Co-authored-by: Jeremyhi <[email protected]>
Co-authored-by: Weny Xu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category Features docs-required This change requires docs update.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants