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

Support database creation via REST API and CLI #25640

Closed
hiltontj opened this issue Dec 10, 2024 · 0 comments · Fixed by #25687
Closed

Support database creation via REST API and CLI #25640

hiltontj opened this issue Dec 10, 2024 · 0 comments · Fixed by #25687
Labels

Comments

@hiltontj
Copy link
Contributor

hiltontj commented Dec 10, 2024

Problem statement

Currently, influxdb3 only supports database creation by performing a write via one of the write APIs.

This is useful and allows quick time-to-awesome; however, there may be users that would like to create their databases explicitly via a REST API or CLI command.

Proposed solution

Add the following REST API:

POST /api/v3/configure/database

{"name": <database name>}

As well as a CLI command:

influxdb3 database create --name <database name>

Additional requirements

  • Utilize the WAL to ensure the catalog operation for creating the database is durable
  • Abide by the limitations on the number of databases that are allowed

Alternatives considered

N/A

Additional context

Recently, we added support to delete databases in #25523. The changes needed here will be very similar to those made for that issue (#25549).

@hiltontj hiltontj added the v3 label Dec 10, 2024
mgattozzi added a commit that referenced this issue Dec 19, 2024
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
mgattozzi added a commit that referenced this issue Dec 19, 2024
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
mgattozzi added a commit that referenced this issue Dec 19, 2024
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
mgattozzi added a commit that referenced this issue Dec 19, 2024
* feat: create DB and Tables via REST and CLI

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant