|
| 1 | +--- |
| 2 | +title: Netlify CLI db command |
| 3 | +description: Provision a production ready Postgres database with a single command |
| 4 | +sidebar: |
| 5 | + label: db |
| 6 | +--- |
| 7 | + |
| 8 | +# `db` |
| 9 | + |
| 10 | + |
| 11 | +<!-- AUTO-GENERATED-CONTENT:START (GENERATE_COMMANDS_DOCS) --> |
| 12 | +Provision a production ready Postgres database with a single command |
| 13 | + |
| 14 | +**Usage** |
| 15 | + |
| 16 | +```bash |
| 17 | +netlify db |
| 18 | +``` |
| 19 | + |
| 20 | +**Flags** |
| 21 | + |
| 22 | +- `filter` (*string*) - For monorepos, specify the name of the application to run the command in |
| 23 | +- `debug` (*boolean*) - Print debugging information |
| 24 | +- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in |
| 25 | + |
| 26 | +| Subcommand | description | |
| 27 | +|:--------------------------- |:-----| |
| 28 | +| [`init`](/commands/db#init) | Initialize a new database for the current site | |
| 29 | +| [`status`](/commands/db#status) | Check the status of the database | |
| 30 | + |
| 31 | + |
| 32 | +**Examples** |
| 33 | + |
| 34 | +```bash |
| 35 | +netlify db status |
| 36 | +netlify db init |
| 37 | +netlify db init --help |
| 38 | +``` |
| 39 | + |
| 40 | +--- |
| 41 | +## `init` |
| 42 | + |
| 43 | +Initialize a new database for the current site |
| 44 | + |
| 45 | +**Usage** |
| 46 | + |
| 47 | +```bash |
| 48 | +netlify init |
| 49 | +``` |
| 50 | + |
| 51 | +**Flags** |
| 52 | + |
| 53 | +- `drizzle` (*boolean*) - Initialize basic drizzle config and schema boilerplate |
| 54 | +- `filter` (*string*) - For monorepos, specify the name of the application to run the command in |
| 55 | +- `minimal` (*boolean*) - Minimal non-interactive setup. Does not initialize drizzle or any boilerplate. Ideal for CI or AI tools. |
| 56 | +- `no-drizzle` (*boolean*) - Does not initialize drizzle and skips any related prompts |
| 57 | +- `debug` (*boolean*) - Print debugging information |
| 58 | +- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in |
| 59 | +- `overwrite` (*boolean*) - Overwrites existing files that would be created when setting up drizzle |
| 60 | + |
| 61 | +**Examples** |
| 62 | + |
| 63 | +```bash |
| 64 | +netlify db init --minimal |
| 65 | +netlify db init --drizzle --overwrite |
| 66 | +``` |
| 67 | + |
| 68 | +--- |
| 69 | +## `status` |
| 70 | + |
| 71 | +Check the status of the database |
| 72 | + |
| 73 | +**Usage** |
| 74 | + |
| 75 | +```bash |
| 76 | +netlify status |
| 77 | +``` |
| 78 | + |
| 79 | +**Flags** |
| 80 | + |
| 81 | +- `debug` (*boolean*) - Print debugging information |
| 82 | +- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in |
| 83 | + |
| 84 | +--- |
| 85 | + |
| 86 | +<!-- AUTO-GENERATED-CONTENT:END --> |
0 commit comments