Netlify Database API
The database API from Netlify — 14 operation(s) for database.
Operations 19
Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay
Ask an LLM
“How do I add a database to my Netlify site?”
“Which region does a new site database use if I don't pick one?”
Tell an agent
Create a database for site {site}.
Provision a new database for site {site} in region {region}.
Ask an LLM
“Where do I find the connection string for my site's database?”
“Can I get the database connection string for a specific role?”
Tell an agent
Get the database connection string for site {site}.
Fetch the connection string for site {site} using the {role} role.
Ask an LLM
“Can I delete my site's database along with all its branches and snapshots?”
“What gets removed when I tear down a site's whole database?”
Tell an agent destructive · confirm first
Delete the entire database for site {site}, including branches and snapshots.
Tear down the database attached to site {site}.
Ask an LLM
“Can I fork a new database branch off an existing parent branch?”
“How do I create a separate database branch for a feature?”
Tell an agent
Create database branch {branch} for site {site}.
Create database branch {branch} on site {site} forked from parent branch {parent}.
GET
/sites/{site_id}/database/branches
List a site's database branches · List site database branches
#
Ask an LLM
“Which database branches exist for my site and are they running?”
“Can I see the compute status of every database branch?”
Tell an agent
List all database branches for site {site}.
Show every database branch on site {site} with its compute status.
GET
/sites/{site_id}/database/branch/{branch_id}
Get a database branch connection string · Get site database branch
#
Ask an LLM
“Where do I get the connection string for one particular database branch?”
“Can I fetch a branch's connection string for a specific role?”
Tell an agent
Get the connection string for database branch {branch} on site {site}.
Fetch the {role} connection string for database branch {branch} of site {site}.
DELETE
/sites/{site_id}/database/branch/{branch_id}
Delete a database branch · Delete site database branch
#
Ask an LLM
“How do I remove a database branch I no longer need?”
“Can I delete a single branch without deleting the whole database?”
Tell an agent destructive · confirm first
Delete database branch {branch} from site {site}.
Remove the {branch} database branch on site {site}.
POST
/sites/{site_id}/database/branch/{branch_id}/reset
Reset a database branch from its source · Reset site database branch
#
Ask an LLM
“Can I re-fork a preview database branch from production to start fresh?”
“Why didn't my branch reset happen when it was already in sync?”
Tell an agent destructive · confirm first
Reset database branch {branch} on site {site} from production.
Reset database branch {branch} on site {site} from source branch {source}, forcing it even if in sync.
PUT
/sites/{site_id}/database/branch/{branch_id}/compute/settings
Set compute settings for one database branch · Set site database branch compute settings
#
Ask an LLM
“Can I give one database branch different compute limits than the rest?”
“How do I change the sleep timeout for a single database branch?”
Tell an agent
Set database branch {branch} on site {site} to scale between {min_cu} and {max_cu} compute units.
Override the sleep timeout for database branch {branch} on site {site} to {seconds} seconds.
PUT
/sites/{site_id}/database/compute/settings
Set project-level database compute settings · Set site database compute settings
#
Ask an LLM
“Can I set default compute limits that apply to all new database branches?”
“Which plan do I need to customize database compute settings?”
Tell an agent
Set the default database compute range for site {site} to {min_cu}–{max_cu} compute units.
Make new database branches on site {site} sleep after {seconds} seconds idle.
GET
/sites/{site_id}/database/compute/settings
Get project-level database compute settings · Get site database compute settings
#
Ask an LLM
“What compute settings does my site's database use by default?”
“Are my database compute settings custom or the plan tier defaults?”
Tell an agent
Show the project-level database compute settings for site {site}.
Check the effective default compute limits for site {site}'s database.
DELETE
/sites/{site_id}/database/compute/settings
Reset database compute settings to defaults · Clear site database compute settings
#
Ask an LLM
“How do I go back to the tier default compute settings for my database?”
“Can I clear my custom project-level database compute limits?”
Tell an agent destructive · confirm first
Clear the custom database compute settings on site {site}.
Revert site {site}'s database compute settings to plan defaults.
GET
/sites/{site_id}/database/migrations
List database migrations and their status · List site database migrations
#
Ask an LLM
“Which database migrations have been applied to my branch?”
“Can I see pending migrations for a specific database branch?”
Tell an agent
List database migrations for site {site}.
Show which migrations are applied on branch {branch} of site {site}.
GET
/sites/{site_id}/database/migrations/{name}
Get the contents of a database migration · Get site database migration
#
Ask an LLM
“Can I read the SQL of a named database migration?”
“What does a specific migration contain on a given branch?”
Tell an agent
Show the contents of migration {name} for site {site}.
Get migration {name} on branch {branch} of site {site}.
POST
/sites/{site_id}/database/migrations/{deploy_id}
Run database migrations for a deploy · Run site database migrations
#
Ask an LLM
“How do I apply database migrations as part of a deploy?”
“Can I do a dry run of migrations before applying them?”
Tell an agent
Run database migrations for deploy {deploy} on site {site}.
Dry-run the migrations for deploy {deploy} of site {site} without applying them.
Ask an LLM
“Can I take a point-in-time backup of my database before a risky change?”
“Which branch gets snapshotted if I don't name one?”
Tell an agent
Take a snapshot of the production database for site {site}.
Snapshot database branch {branch} on site {site} and name it {name}.
Ask an LLM
“What database snapshots do I have for my site?”
“Can I see all point-in-time backups of my site's database?”
Tell an agent
List all database snapshots for site {site}.
Show the saved database snapshots on site {site}.
DELETE
/sites/{site_id}/database/snapshot/{snapshot_id}
Delete a database snapshot · Delete site database snapshot
#
Ask an LLM
“How do I delete an old database snapshot?”
“Can I remove one snapshot without touching the database?”
Tell an agent destructive · confirm first
Delete database snapshot {snapshot} from site {site}.
Remove snapshot {snapshot} on site {site}.
POST
/sites/{site_id}/database/snapshot/{snapshot_id}/restore
Restore a database snapshot to a branch · Restore site database snapshot
#
Ask an LLM
“Can I roll my database back to an earlier snapshot?”
“Is it possible to restore a snapshot into a non-production branch?”
Tell an agent destructive · confirm first
Restore snapshot {snapshot} to the production database of site {site}.
Restore snapshot {snapshot} on site {site} into branch {branch}.