list- View all databasesshow- Display database detailscreate- Create a new databasedelete- Remove a databaseregions- List available regionspsql- Connect using PostgreSQL CLIconnectionstring- Get connection details
Setting Workspace
Before using thenile db command, you can set the workspace to operate in.
Example
Workspace Example

The workspace can also be set using the
NILE_WORKSPACE environment variable or by using the flag --workspace in the command.Listing Databases
Thelist command shows all databases in your workspace.
Options
| Flag | Description | Default |
|---|---|---|
--format | Output format (human, json, csv) | human |
--workspace | Specific workspace to list from | Current workspace |
Examples
List Examples

Setting active database in config
You can set the active database in the config file. This simplifies other db commands. Youc an also override the db name using the flag--database in the command.
Example

Showing Database Details
Theshow command provides detailed information about a specific database.
Options
| Flag | Description | Default |
|---|---|---|
--format | Output format (human, json, csv) | human |
--workspace | Workspace containing the database | Current workspace |
Examples
Show Examples

Listing Regions
Theregions command shows available regions for database creation.
Options
| Flag | Description | Default |
|---|---|---|
--format | Output format (human, json, csv) | human |
--workspace | Workspace to list regions for | Current workspace |
Examples
Region Examples

Creating Databases
Thecreate command sets up a new database in your workspace.
Required Options
| Flag | Description |
|---|---|
--name | Name for the new database |
--region | Region to create the database in |
Additional Options
| Flag | Description | Default |
|---|---|---|
--format | Output format (human, json, csv) | human |
--workspace | Workspace to create in | Current workspace |
Examples
Create Examples

Deleting Databases
Thedelete command removes a database permanently.
Options
| Flag | Description | Default |
|---|---|---|
--force | Skip confirmation prompt | false |
--workspace | Workspace containing the database | Current workspace |
Examples
Delete Examples
Using PostgreSQL CLI
Thepsql command opens an interactive PostgreSQL terminal.
Options
| Flag | Description | Default |
|---|---|---|
--workspace | Workspace containing the database | Current workspace |
Examples
PSQL Examples

Getting Connection Strings
Theconnectionstring command provides database connection details. Currently, it only supports the psql format.
Examples
Connection String Examples

Importing Data
Thecopy command allows you to import data from files into database tables. The target table must already exist in the database with the appropriate columns that match your input data.

Required Options
| Flag | Description |
|---|---|
--table-name | Name of the target table (must exist in database) |
--format | File format (csv or text) |
--file-name | Path to the input file |
Additional Options
| Flag | Description | Default |
|---|---|---|
--delimiter | Column delimiter character | comma for CSV |
--column-list | Comma-separated list of column names | All columns from file |
--debug | Show detailed progress information | false |
Examples
Copy Examples
Features
- Shows progress bar with completion status and import speed
- Supports CSV files with headers
- Allows custom column mapping
- Provides detailed progress information in debug mode
- Processes data in batches for optimal performance
Make sure your target table exists and has the correct schema before running the import. The columns in your input file should match the table’s structure.
Common Workflows
Setting Up a New Database
New Database Workflow
Managing Multiple Environments
Environment Management
Database Cleanup
Cleanup Workflow
Getting Help
For detailed help on any command:Related Topics
- Connecting to Nile - Authentication guide
- Working with Tenants - Tenant management
- Configuration - CLI configuration
- Workspaces - Workspace management