The databases command lists, creates, and deletes databases in a OptiTech project from the terminal. For information about databases in OptiTech, see Manage databases. If --project-id is omitted, the CLI resolves it from your context file, auto-selects when your account has only one project, and prompts otherwise.
optitech databases list
Lists databases. If you don't specify a branch ID or name with --branch, the command targets the project's default branch. This applies to all databases subcommands.
optitech databases list [options]optitech databases list --branch br-autumn-dust-190886Output
┌────────┬────────────┬──────────────────────┐
│ Name │ Owner Name │ Created At │
├────────┼────────────┼──────────────────────┤
│ optitechdb │ daniel │ 2023-06-19T18:27:19Z │
└────────┴────────────┴──────────────────────┘optitech databases create
Creates a database. If you don't specify --owner-name, the current user becomes the database owner.
optitech databases create [options]optitech databases create --name mynewdb --owner-name johnOutput
┌─────────┬────────────┬──────────────────────┐
│ Name │ Owner Name │ Created At │
├─────────┼────────────┼──────────────────────┤
│ mynewdb │ john │ 2023-06-19T23:45:45Z │
└─────────┴────────────┴──────────────────────┘optitech databases delete
Deletes a database. The <database> is the database name.
optitech databases delete <database> [options]optitech databases delete mydbOutput
┌─────────┬────────────┬──────────────────────┐
│ Name │ Owner Name │ Created At │
├─────────┼────────────┼──────────────────────┤
│ mydb │ daniel │ 2023-06-19T23:45:45Z │
└─────────┴────────────┴──────────────────────┘