Skip to main content

create

create a SphereDB database

Create a SphereDB PostgreSQL database in an environment.

Pick an instance type by name or id (see csph db instance-types): Free, Flex 256 MB / 512 MB / 1 GB (shared CPU), Standard N or Plus N (N vCPU; Plus has twice the memory). Add high availability from 1 vCPU: a standby in another zone. The default is Standard 1. Services in the environment get DATABASE_URL injected; --no-inject turns that off.

--engine and --version pick the engine and its version; without --version the engine's default version is used.

Usage​

csph db create <name> [flags]

Options​

Command Specific​

--engine <string> (default "postgresql")

database engine
--environment <string>
environment ID
--high-availability <string>
none or standby (from 1 vCPU)
--instance-type <string>
instance type by name or id, e.g. "Standard 2" or pg-2c-4g (default: Standard 1)
--no-inject
don't inject DATABASE_URL into the environment's services
--project <string>
project ID

--storage <int> (default 0)

storage in GB (default: the instance type's included storage)
--version <string>
engine version, e.g. 17 (default: the engine's default version)

Formatting​

For more information about formatting options, see Formatting.

-o, --output <string>

output format: [table|plain|csv|json|yaml]

Inherited​

--config <string>
config file (default is $HOME/.config/computesphere/configuration.yaml)
--debug
enable debug logging

-h, --help

show this help message

-i, --interactive

run interactively (prompts, pickers, table browser)
--log-level <string>
log level: [trace|debug|info|warn|error|fatal|panic|disabled||api]
--no-color
disable color output
--no-input
disable interactive mode

Examples​

  csph db create orders --instance-type "Standard 2" --storage 20
csph db create orders --engine postgresql --version 17
csph db create orders --instance-type pg-2c-8g --high-availability standby
csph db create scratch --instance-type free --environment <id> --no-inject

See also​