-
Notifications
You must be signed in to change notification settings - Fork 452
feat!: add support for new Netlify Database primitive #8212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 8 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
fbad04f
tmp: use unreleased @netlify/dev package to validate
pieh 094bee2
feat!: remove db extension commands and unflag database primitive comβ¦
pieh 4d36191
test: adjust spawnAsync mocking
pieh 44c9561
test: update snapshot for --help
pieh 2361208
tmp: update unreleased @netlify/dev
pieh 6f18dd1
fix: preserve honoring --skipGitignore
pieh 0c65e7e
test: allow e2e tests to use local tarball versions of dependencies
pieh 32092b7
docs: update cli command reference
pieh 019d487
fix: don't try to reject already resolved promise in spawnAsync
pieh a2175bc
test: remove debug console.log
pieh 1d2313a
docs: fix generating subcommands docs
pieh d2f3f3f
docs: don't generate top-level status:hooks docs into dabatase status
pieh 3661009
fix: use published @netlify/dev
pieh d8d60f4
Merge remote-tracking branch 'origin/main' into feat/unflag-database
pieh 27240cc
Merge branch 'main' into feat/unflag-database
pieh 692b167
Merge branch 'main' into feat/unflag-database
pieh 0cf185e
Merge branch 'main' into feat/unflag-database
pieh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,163 @@ | ||
| --- | ||
| title: Netlify CLI database command | ||
| description: Provision a production ready Postgres database with a single command | ||
| sidebar: | ||
| label: database | ||
| --- | ||
|
|
||
| # `database` | ||
|
|
||
|
|
||
| <!-- AUTO-GENERATED-CONTENT:START (GENERATE_COMMANDS_DOCS) --> | ||
| Provision a production ready Postgres database with a single command | ||
|
|
||
| **Usage** | ||
|
|
||
| ```bash | ||
| netlify database | ||
| ``` | ||
|
|
||
| **Flags** | ||
|
|
||
| - `filter` (*string*) - For monorepos, specify the name of the application to run the command in | ||
| - `debug` (*boolean*) - Print debugging information | ||
| - `auth` (*string*) - Netlify auth token - can be used to run this command without logging in | ||
|
|
||
| | Subcommand | description | | ||
|
Check warning on line 26 in docs/commands/database.md
|
||
| |:--------------------------- |:-----| | ||
| | [`status`](/commands/database#status) | Check the status of the database, including applied and pending migrations | | ||
| | [`init`](/commands/database#init) | Interactive setup: install the package, scaffold a starter migration, and verify the database | | ||
| | [`connect`](/commands/database#connect) | Connect to the database | | ||
| | [`reset`](/commands/database#reset) | Reset the local development database, removing all data and tables | | ||
| | [`migrations`](/commands/database#migrations) | Manage database migrations | | ||
|
|
||
|
|
||
| **Examples** | ||
|
|
||
| ```bash | ||
| netlify database status | ||
| netlify database migrations apply | ||
| netlify database migrations pull | ||
| netlify database migrations new | ||
| netlify database reset | ||
| ``` | ||
|
|
||
| --- | ||
| ## `status` | ||
|
|
||
| Check the status of the database, including applied and pending migrations | ||
|
|
||
| **Usage** | ||
|
|
||
| ```bash | ||
| netlify status | ||
| ``` | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| **Flags** | ||
|
|
||
| - `branch` (*string*) - Netlify branch name to query; defaults to the local development database | ||
| - `json` (*boolean*) - Output result as JSON | ||
| - `show-credentials` (*boolean*) - Include the full connection string (including username and password) in the output | ||
| - `debug` (*boolean*) - Print debugging information | ||
| - `auth` (*string*) - Netlify auth token - can be used to run this command without logging in | ||
|
|
||
| **Examples** | ||
|
|
||
| ```bash | ||
| netlify database status | ||
| netlify database status --show-credentials | ||
| netlify database status --json | ||
| netlify database status --branch my-feature-branch | ||
| ``` | ||
|
|
||
| --- | ||
| ## `init` | ||
|
|
||
| Interactive setup: install the package, scaffold a starter migration, and verify the database | ||
|
|
||
| **Usage** | ||
|
|
||
| ```bash | ||
| netlify init | ||
| ``` | ||
|
|
||
| **Flags** | ||
|
|
||
| - `filter` (*string*) - For monorepos, specify the name of the application to run the command in | ||
| - `yes` (*boolean*) - Non-interactive mode. Accepts the defaults for every prompt. | ||
| - `debug` (*boolean*) - Print debugging information | ||
| - `auth` (*string*) - Netlify auth token - can be used to run this command without logging in | ||
|
|
||
| **Examples** | ||
|
|
||
| ```bash | ||
| netlify database init | ||
| netlify database init --yes | ||
| ``` | ||
|
|
||
| --- | ||
| ## `connect` | ||
|
|
||
| Connect to the database | ||
|
|
||
| **Usage** | ||
|
|
||
| ```bash | ||
| netlify connect | ||
| ``` | ||
|
|
||
| **Flags** | ||
|
|
||
| - `filter` (*string*) - For monorepos, specify the name of the application to run the command in | ||
| - `json` (*boolean*) - Output query results as JSON. When used without --query, prints the connection details as JSON instead. | ||
| - `query` (*string*) - Execute a single query and exit | ||
| - `debug` (*boolean*) - Print debugging information | ||
| - `auth` (*string*) - Netlify auth token - can be used to run this command without logging in | ||
|
|
||
| **Examples** | ||
|
|
||
| ```bash | ||
| netlify database connect | ||
| netlify database connect --query "SELECT * FROM users" | ||
| netlify database connect --json --query "SELECT * FROM users" | ||
| netlify database connect --json | ||
| ``` | ||
|
|
||
| --- | ||
| ## `reset` | ||
|
|
||
| Reset the local development database, removing all data and tables | ||
|
|
||
| **Usage** | ||
|
|
||
| ```bash | ||
| netlify reset | ||
| ``` | ||
|
|
||
| **Flags** | ||
|
|
||
| - `filter` (*string*) - For monorepos, specify the name of the application to run the command in | ||
| - `json` (*boolean*) - Output result as JSON | ||
| - `debug` (*boolean*) - Print debugging information | ||
| - `auth` (*string*) - Netlify auth token - can be used to run this command without logging in | ||
|
|
||
| --- | ||
| ## `migrations` | ||
|
|
||
| Manage database migrations | ||
|
|
||
| **Usage** | ||
|
|
||
| ```bash | ||
| netlify migrations | ||
| ``` | ||
|
|
||
| **Flags** | ||
|
|
||
| - `filter` (*string*) - For monorepos, specify the name of the application to run the command in | ||
| - `debug` (*boolean*) - Print debugging information | ||
| - `auth` (*string*) - Netlify auth token - can be used to run this command without logging in | ||
|
|
||
| --- | ||
|
|
||
| <!-- AUTO-GENERATED-CONTENT:END --> | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hyphenate βproduction-readyβ in command description text.
Use
production-ready(compound adjective) instead ofproduction readyin both the frontmatter description and generated command description text.βοΈ Proposed wording tweak
Also applies to: 12-12
π€ Prompt for AI Agents