> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zeplo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Database

> Manage database schemas, migrations, and seeding with the Zeplo CLI

These commands help you manage your Zeplo database layer. Push schema changes, generate migration files, seed data, and open a visual database explorer directly from the terminal.

## zeplo db push

Push your local schema changes directly to the database. This command compares your current schema definitions against the live database and applies the necessary changes. It skips generating migration files, making it ideal for rapid prototyping.

```bash theme={null}
zeplo db push
```

### Options

| Flag | Description |
| - | - |
| `--force` | Skip the confirmation prompt and apply changes immediately. |
| `--dry-run` | Show the SQL that would be executed without actually running it. |

### Examples

```bash theme={null}
# Push schema changes with a confirmation prompt
zeplo db push

# Push and skip the confirmation prompt
zeplo db push --force

# Preview the SQL that would run
zeplo db push --dry-run
```

## zeplo db generate

Generate migration files from your current schema definitions. This command inspects your schema, computes the diff against the last generated migration, and writes new SQL migration files to your migrations directory.

```bash theme={null}
zeplo db generate
```

### Options

| Flag | Description |
| - | - |
| `--name <name>` | Set a custom name for the migration file. Defaults to an auto-generated descriptive name. |
| `--empty` | Generate an empty migration file. Useful for writing custom SQL migrations by hand. |

### Examples

```bash theme={null}
# Generate a migration from schema changes
zeplo db generate

# Generate with a custom name
zeplo db generate --name add-user-avatar-column

# Generate an empty migration for custom SQL
zeplo db generate --empty
```

## zeplo db seed

Run your seed scripts to populate the database with initial or sample data. This command executes the seed file defined in your project configuration.

```bash theme={null}
zeplo db seed
```

### Options

| Flag | Description |
| - | - |
| `--file <path>` | Specify a custom seed file instead of the default configured in your project. |
| `--env <environment>` | Run the seed script against a specific environment (e.g., `development`, `staging`, `production`). |

### Examples

```bash theme={null}
# Run the default seed script
zeplo db seed

# Run a specific seed file
zeplo db seed --file ./seeds/demo-data.sql

# Seed a staging environment
zeplo db seed --env staging
```

## zeplo db studio

Open Drizzle Studio, a browser-based GUI for exploring and editing your database. This launches a local development server and opens your default browser to the Studio interface.

```bash theme={null}
zeplo db studio
```

### Options

| Flag | Description |
| - | - |
| `--port <port>` | Specify the port for the local Studio server. Defaults to `4983`. |
| `--no-open` | Start Studio without automatically opening the browser. |

### Examples

```bash theme={null}
# Open Drizzle Studio with default settings
zeplo db studio

# Start Studio on a custom port
zeplo db studio --port 8080

# Start Studio without opening the browser
zeplo db studio --no-open
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.