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 DB and Tables via REST and CLI #25687

Merged
merged 2 commits into from
Dec 19, 2024

Conversation

mgattozzi
Copy link
Contributor

This commit does a few things:

  1. It brings the database command naming scheme for types inline with the rest of the CLI types
  2. It brings the table command naming scheme for types inline with the rest of the CLI types
  3. Adds tests to check that the num of dbs is not exceeded and that you cannot create more than one database with a given name.
  4. Adds tests to check that you can create a table and put data into it and querying it
  5. Adds tests for the CLI for both the database and table commands
  6. It creates an endpoint to create databases given a JSON blob
  7. It creates an endpoint to create tables given a JSON blob

With this users can now create a database or table without first needing to write to the database via the line protocol!

Closes #25640
Closes #25641

This commit does a few things:

1. It brings the database command naming scheme for types inline with
   the rest of the CLI types
2. It brings the table command naming scheme for types inline with
   the rest of the CLI types
3. Adds tests to check that the num of dbs is not exceeded and that you
   cannot create more than one database with a given name.
4. Adds tests to check that you can create a table and put data into it
   and querying it
5. Adds tests for the CLI for both the database and table commands
6. It creates an endpoint to create databases given a JSON blob
7. It creates an endpoint to create tables given a JSON blob

With this users can now create a database or table without first needing
to write to the database via the line protocol!

Closes #25640
Closes #25641
Copy link
Member

@pauldix pauldix left a comment

Choose a reason for hiding this comment

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

Looks good except that tables without tags are valid.

.send()
.await
.expect("create table call failed");
assert_eq!(StatusCode::UNPROCESSABLE_ENTITY, resp.status());
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be an OK? Tables without tags are valid.

fields: Vec<(String, String)>,
) -> Result<(), self::Error> {
if tags.is_empty() {
return Err(self::Error::EmptyTagSet);
Copy link
Member

Choose a reason for hiding this comment

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

No tags should be valid.

@mgattozzi mgattozzi requested a review from pauldix December 19, 2024 20:34
@mgattozzi
Copy link
Contributor Author

@pauldix removed the tag restriction for new tables c2b86a1

@mgattozzi mgattozzi force-pushed the mgattozzi/create-db-and-table branch from c2b86a1 to 4ae4bc4 Compare December 19, 2024 20:36
@mgattozzi mgattozzi merged commit e51bea6 into main Dec 19, 2024
13 checks passed
@mgattozzi mgattozzi deleted the mgattozzi/create-db-and-table branch December 19, 2024 21:01
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.

Support table creation via REST API and CLI Support database creation via REST API and CLI
2 participants