influxdata / influxdata/influxdb
CREATE DATABASE in 2.x OSS
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
__Proposal:__
The InfluxQL `CREATE DATABASE` command should work in InfluxDB 2.x OSS (and eventually in cloud, but this issue is for 2.x.
__Current behavior:__
CREATE DATABASE and other commands that mutate the database are currently forbidden. (https://docs.influxdata.com/influxdb/v2.1/query-data/influxql/?t=InfluxDB+API#influxql-support)
The goal is to improve Time-To-Awesome for people messing with the InfluxQL REPL we plan to add back to 2.x. (https://github.com/influxdata/influx-cli/issues/331)
__Desired behavior:__
`CREATE DATABASE mydb` should create a 2.x bucket named "mydb/autogen" with a dbrp mapping for "mydb.autogen"
We should not accept any of the other `CREATE DATABASE` arguments, they should error saying they are no longer supported in 2.x. We should have an infinite retention policy on buckets created this way (or for cloud, the maximum retention policy) and that can be updated in the API.
We should properly validate permissions when creating the dbrp mapping and the bucket.
The main goal is to support people messing around in the InfluxQL REPL that we plan to bring back for 2.x: https://github.com/influxdata/influx-cli/issues/331
__Alternatives considered:__
Alternatively, people could use several 2.x CLI commands to make this happen:
```
influx bucket create ...
influx v1 dbrp create ...
```
__Use case:__
The goal is to improve Time-To-Awesome for people messing with the InfluxQL REPL we plan to add back to 2.x.
Contributor guide
Research direction
Start by tracing how InfluxQL commands are handled and how bucket creation and DBRP mappings are exposed through the 2.x APIs. Verify the existing permission checks and the documented InfluxQL support before defining the supported CREATE DATABASE form. Done means creating the requested bucket and mapping, rejecting unsupported arguments, and preserving the stated retention behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- database
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100