[Feature]: Replace cedardb commandline arguments with sub commands #41
Replies: 4 comments
-
|
Hi Zafar, For us, there is a "physical database", which is the directory where we store
and which you can create via the We furthermore support "CREATE DATABASE" which then creates a new (logical) database. An arbitrary amount of such logical databases can be stored within that directory. Regarding your suggestion: Could you let us know in what way the current command line interface is wrong/too cumbersome? |
Beta Was this translation helpful? Give feedback.
-
|
I would still argue that --createdb mydb is not creating a database with the name mydb. In reality, this command is creating a folder (mydb), initializing a Cedarsb instance in it and creating a default database (postgres). CLI tools mostly use sub commands for different features/actions and sub command can have arguments. Sub commands also clearly show the intent. Without reading the documentation, it is not clear what ./cederdb mydb command will do whereas ./cedardb start mydb clearly shows the intent. Cedardb is at an early stage and not yet production ready so I think, the project can afford few breaking changes. |
Beta Was this translation helpful? Give feedback.
-
|
Another advantage of using sub commands is that we can group command arguments by functionality. For example, if we want to allow users to set a port then we can add another argument --port Please check surrealdb cli and flutter cli for an effective use of sub commands. |
Beta Was this translation helpful? Give feedback.
-
|
Sub command will also allow to add more functionality to CLI in an organized way. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
--createdb argument is confusing and does not make sense as this argument is not creating a database with the provided name but initializing a Cedardb instance/data folder (with a default database name: postgres)
Cedardb is a Postgres compatible database and in Postgres there is no concept of a logical database. In Postgres, we must create a cluster first. Creating a new PostgreSQL cluster involves initializing a new database instance and its associated data directory with initdb command and in a cluster/instance a new physical database can be created with CREATE DATABASE statement.
I had previously suggested to replace --createdb with an init sub command to initialize a Cedardb instance at the provided folder.
Use Case
Improve cedardb command line tool.
Beta Was this translation helpful? Give feedback.
All reactions