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: create database with options #3751

Merged
merged 11 commits into from
May 13, 2024
Merged

feat: create database with options #3751

merged 11 commits into from
May 13, 2024

Conversation

tizee
Copy link
Contributor

@tizee tizee commented Apr 19, 2024

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

What's changed and what's your intention?

  • extends create database with options support
CREATE DATABASE demo with(ttl='2days')

!!! DO NOT LEAVE THIS BLOCK EMPTY !!!

Please explain IN DETAIL what the changes are in this PR and why they are needed:

  • Summarize your change (mandatory)
  • How does this PR work? Need a brief introduction for the changed logic (optional)
  • Describe clearly one logical change and avoid lazy messages (optional)
  • Describe any limitations of the current code (optional)

Checklist

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

@WenyXu
Copy link
Member

WenyXu commented Apr 20, 2024

please run make clippy

Copy link
Collaborator

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

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

Now we implement Display for all the statements and will use it on logging statement. Thus I suppose you merge/rebase the main branch and keep the new added options displayed also.

@tisonkun
Copy link
Collaborator

@tizee I'm glad to review this patch. Would you have time to rebase and add some sqlness tests?

@tizee tizee marked this pull request as ready for review May 3, 2024 07:27
@tizee tizee requested a review from a team as a code owner May 3, 2024 07:27
@tizee
Copy link
Contributor Author

tizee commented May 3, 2024

e time to rebase and add some sqlness tests?

Sorry for not replying in time. @tisonkun Would you please review this PR?

Copy link

codecov bot commented May 3, 2024

Codecov Report

Attention: Patch coverage is 86.76471% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 85.66%. Comparing base (115c747) to head (d1aa805).
Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3751      +/-   ##
==========================================
- Coverage   85.99%   85.66%   -0.33%     
==========================================
  Files         961      963       +2     
  Lines      164580   164579       -1     
==========================================
- Hits       141525   140983     -542     
- Misses      23055    23596     +541     

Copy link
Collaborator

@tisonkun tisonkun 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 for the parsing part.

But I don't find code related to the retrieving and applying ttl part. Will we implement it later? cc @tizee @v0y4g3r

Copy link
Contributor

@evenyag evenyag left a comment

Choose a reason for hiding this comment

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

Do we have a way to pass database options to tables in the database?

src/sql/src/parsers/create_parser.rs Outdated Show resolved Hide resolved
src/sql/src/parsers/create_parser.rs Outdated Show resolved Hide resolved
@tisonkun
Copy link
Collaborator

I can see that the passing options part is tracked at #3708.

Then I think it's OK to only handle the parsing and passing part in this patch, as long as @v0y4g3r track the overall progress.

I'm rebasing this PR and resolve comments.

Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
@killme2008
Copy link
Contributor

@MichaelScofield @evenyag please take a look.

Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
@tisonkun tisonkun requested review from evenyag and WenyXu May 13, 2024 08:18
Copy link
Contributor

@evenyag evenyag left a comment

Choose a reason for hiding this comment

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

LGTM

@evenyag evenyag enabled auto-merge May 13, 2024 08:43
@evenyag evenyag added this pull request to the merge queue May 13, 2024
Merged via the queue into GreptimeTeam:main with commit 9d12496 May 13, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-required This change requires docs update.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support creating databases with options
6 participants