Schema Ops and Seed Data endpoints
Take schema snapshots, check for drift, run pre-run checks and plan seed data. Paths are relative to the address of your Simcha DB Studio server.
Through the MCP server these endpoints are the Schema Ops and Seed Data tool group, off until an admin turns it on.
While this group is on, the MCP server also offers the lookups its tools need: connections_list (List connections, from Connections).
| Method | Path | What it does |
|---|---|---|
| GET | /api/db-devops/schema/engines | List the engines schema tools support |
| POST | /api/db-devops/schema/snapshot | Capture a schema snapshot |
| POST | /api/db-devops/schema/live | Read the live schema of a connection |
| POST | /api/db-devops/schema/snapshots/:id/baseline | Make a snapshot the baseline |
| GET | /api/db-devops/schema/snapshots | List the schema snapshots of a connection |
| GET | /api/db-devops/schema/snapshots/:id | Get a schema snapshot |
| DELETE | /api/db-devops/schema/snapshots/:id | Delete a schema snapshot |
| POST | /api/db-devops/schema/export | Export a schema as DDL |
| POST | /api/db-devops/schema/diff | Compare two schemas |
| POST | /api/db-devops/schema/plan | Plan a migration to a desired schema |
| POST | /api/db-devops/schema/drift | Scan a connection for schema drift |
| GET | /api/db-devops/schema/drift/:connectionId | List the drift alerts of a connection |
| POST | /api/db-devops/schema/drift/:alertId/ack | Acknowledge a drift alert |
| POST | /api/db-devops/lint | Lint a script |
| GET | /api/db-devops/lint/rules | List the lint rules |
| POST | /api/db-devops/preflight | Run the pre-run checks of a script |
| GET | /api/db-devops/seed | List seed definitions |
| POST | /api/db-devops/seed | Create a seed definition |
| PUT | /api/db-devops/seed/:id | Replace a seed definition |
| DELETE | /api/db-devops/seed/:id | Delete a seed definition |
| POST | /api/db-devops/seed/plan | Plan a seed on a connection |
| POST | /api/db-devops/seed/:id/script | Make a migration script from a seed |
GET /api/db-devops/schema/engines
Returns the engines that support snapshots, DDL export, pre-run checks and seed data.
Reads only · Role: Any signed-in user · MCP tool: schema_engines
No inputs.
POST /api/db-devops/schema/snapshot
Reads the connection's live schema and saves it as a snapshot. It becomes the connection's baseline when baseline is true, or when the connection has no baseline yet; a new baseline resolves the connection's open drift alerts. Returns the snapshot ID, whether it is the baseline, the alerts resolved and the schema read.
Changes data · Role: Release manager or admin · MCP tool: schema_snapshot
| Input | Type | Description |
|---|---|---|
connectionId (body) | string (uuid), required | The connection to read |
dialect (body) | string, optional | The engine expected, for example postgresql. Refused when it is not the connection's engine; leave it out to use the connection's engine |
database (body) | string, optional | The database to read. Defaults to the connection's database |
schema (body) | string, optional | The one schema to read, up to 255 characters. Leave it out for every schema |
label (body) | string, optional | A label for the snapshot, up to 255 characters |
baseline (body) | boolean, optional | Make the snapshot the connection's baseline. Default true only when the connection has no baseline |
POST /api/db-devops/schema/live
Reads the connection's tables, columns, indexes and other objects as they are now and returns them without saving a snapshot.
Reads only · Role: Any signed-in user · MCP tool: schema_live
| Input | Type | Description |
|---|---|---|
connectionId (body) | string (uuid), required | The connection to read |
dialect (body) | string, optional | The engine expected, for example postgresql. Refused when it is not the connection's engine; leave it out to use the connection's engine |
database (body) | string, optional | The database to read. Defaults to the connection's database |
schema (body) | string, optional | The one schema to read, up to 255 characters. Leave it out for every schema |
POST /api/db-devops/schema/snapshots/:id/baseline
Makes the snapshot its connection's baseline for drift checks, in place of the previous one, and resolves the connection's open drift alerts. Returns the number of alerts resolved.
Changes data · Role: Release manager or admin · MCP tool: schema_set_baseline
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The snapshot ID |
GET /api/db-devops/schema/snapshots
Lists the snapshots of one connection, newest first, with label, database, schema, engine, author and whether each is the baseline. The captured schema is not included; read it with schema_get_snapshot.
Reads only · Role: Any signed-in user · MCP tool: schema_snapshots
| Input | Type | Description |
|---|---|---|
connectionId (query) | string (uuid), required | The connection whose snapshots to list |
GET /api/db-devops/schema/snapshots/:id
Returns one snapshot with the schema it captured.
Reads only · Role: Any signed-in user · MCP tool: schema_get_snapshot
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The snapshot ID |
DELETE /api/db-devops/schema/snapshots/:id
Deletes a snapshot. Deleting the baseline leaves the connection without one and resolves its open drift alerts.
Changes data and can remove or overwrite it · Role: Release manager or admin · MCP tool: schema_delete_snapshot
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The snapshot ID |
POST /api/db-devops/schema/export
Returns the DDL that creates a saved snapshot's schema, or the connection's live schema, with its engine and file extension. Send snapshotId or connectionId.
Reads only · Role: Any signed-in user · MCP tool: schema_export
| Input | Type | Description |
|---|---|---|
snapshotId (body) | string (uuid), optional | The snapshot to export. Takes precedence over connectionId |
connectionId (body) | string (uuid), optional | The connection whose live schema to export |
dialect (body) | string, optional | The engine expected, for example postgresql. Refused when it is not the connection's engine; leave it out to use the connection's engine |
database (body) | string, optional | The database to read. Defaults to the connection's database |
schema (body) | string, optional | The one schema to read, up to 255 characters. Leave it out for every schema |
POST /api/db-devops/schema/diff
Compares a saved snapshot with another snapshot or with a connection's live schema and returns the differences and, where the engine has DDL, the SQL that turns the first into the second. Both sides must be the same engine family. A schema missing on the connection counts as empty.
Reads only · Role: Any signed-in user · MCP tool: schema_diff
| Input | Type | Description |
|---|---|---|
fromSnapshotId (body) | string (uuid), required | The snapshot to compare from |
toSnapshotId (body) | string (uuid), optional | The snapshot to compare to. Send this or toConnectionId |
toConnectionId (body) | string (uuid), optional | The connection whose live schema to compare to |
toDialect (body) | string, optional | The engine expected for toConnectionId. Refused when it is not that connection's engine |
toDatabase (body) | string, optional | The database to read on toConnectionId. Defaults to the connection's database |
POST /api/db-devops/schema/plan
Compares a connection's live schema with a saved snapshot of the desired schema and returns the differences and the SQL that would bring the connection to it. Nothing is run.
Reads only · Role: Any signed-in user · MCP tool: schema_plan
| Input | Type | Description |
|---|---|---|
fromConnectionId (body) | string (uuid), required | The connection to migrate |
desiredSnapshotId (body) | string (uuid), required | The snapshot of the desired schema |
fromDialect (body) | string, optional | The engine expected for fromConnectionId. Refused when it is not that connection's engine |
fromDatabase (body) | string, optional | The database to read on fromConnectionId. Defaults to the connection's database |
POST /api/db-devops/schema/drift
Compares the connection's baseline snapshot with its live schema, opens a drift alert for each new difference and resolves open alerts whose difference is gone. Returns the differences and the alerts opened and resolved. A connection without a baseline is refused.
Changes data · Role: Release manager or admin · MCP tool: schema_drift_scan
| Input | Type | Description |
|---|---|---|
connectionId (body) | string (uuid), required | The connection to scan |
dialect (body) | string, optional | The engine expected, for example postgresql. Refused when it is not the connection's engine; leave it out to use the connection's engine |
database (body) | string, optional | The database to read. Defaults to the connection's database |
baselineId (body) | string (uuid), optional | The baseline to compare with. It must be the connection's current baseline |
GET /api/db-devops/schema/drift/:connectionId
Lists the drift alerts of one connection, newest first, with the difference found, its severity and who acknowledged or resolved it.
Reads only · Role: Any signed-in user · MCP tool: schema_drift_alerts
| Input | Type | Description |
|---|---|---|
connectionId (path) | string (uuid), required | The connection ID |
status (query) | one of open, acknowledged, resolved, optional | Only alerts in this state |
acknowledged (query) | one of true, false, optional | Only alerts that are, or are not, acknowledged |
POST /api/db-devops/schema/drift/:alertId/ack
Marks an open drift alert as acknowledged. A resolved alert is refused; an alert already acknowledged is reported as such.
Changes data · Role: Release manager or admin · MCP tool: schema_drift_acknowledge
| Input | Type | Description |
|---|---|---|
alertId (path) | string (uuid), required | The drift alert ID |
POST /api/db-devops/lint
Checks a script against the lint rules for its engine and returns the findings with severity, line and remedy, and the SHA-256 hash of the script. Nothing is run.
Reads only · Role: Any signed-in user · MCP tool: schema_lint
| Input | Type | Description |
|---|---|---|
sql (body) | string, required | The script to check |
dialect (body) | string, required | The engine of the script, for example postgresql, mysql, mssql, oracle, mongodb or redis. Read the list with schema_lint_rules |
GET /api/db-devops/lint/rules
Lists every lint rule with its severity, the engines it applies to and what it checks, and the engines lint supports.
Reads only · Role: Any signed-in user · MCP tool: schema_lint_rules
No inputs.
POST /api/db-devops/preflight
Finds the check lines in the script, written as a comment such as, @check has_users: (SELECT count(*) FROM users) > 0, and evaluates each as a read on the connection, inside a transaction that is rolled back on SQL engines, stopping at the first that fails. Returns how many checks were found, whether all passed and each result. The script itself is not run.
Reads only · Role: Release manager or admin · MCP tool: schema_preflight
| Input | Type | Description |
|---|---|---|
sql (body) | string, required | The script holding the check lines. A check cannot contain a semicolon; on the SQL engines it is one expression whose parentheses pair up, and it may only read: a function that acts on the server, INTO or a row lock is refused |
connectionId (body) | string (uuid), required | The connection to check against |
database (body) | string, optional | The database to read. Defaults to the connection's database |
GET /api/db-devops/seed
Lists the seed definitions by name, each with its table, mode, key columns, rows, engines and whether it is active.
Reads only · Role: Any signed-in user · MCP tool: schema_seeds
No inputs.
POST /api/db-devops/seed
Saves rows that a table should hold, to plan against connections later. A name already in use is refused.
Changes data · Role: Release manager or admin · MCP tool: schema_seed_create
| Input | Type | Description |
|---|---|---|
name (body) | string, required | The seed name, up to 255 characters, unique among seeds |
description (body) | string, optional | What the seed is for |
schemaName (body) | string, optional | The schema of the table |
tableName (body) | string, required | The table the rows belong in, up to 255 characters |
mode (body) | one of insert, upsert, sync, required | insert adds missing rows, upsert also updates changed rows, sync also deletes rows that are not in the seed |
keyColumns (body) | list of string, required | The columns that identify a row, at least one, without repeats |
rows (body) | list of object, required | The rows, each with a key no other row has. A sync seed needs at least one row |
appliesToDialects (body) | list of string, optional | The engines the seed may be planned on: postgresql, cockroachdb, timescaledb, mysql, mariadb, sqlite, mssql, oracle, mongodb, redis, cassandra, neo4j or elasticsearch. Leave it out for every engine |
isActive (body) | boolean, optional | Whether the seed can be planned. Default true |
PUT /api/db-devops/seed/:id
Replaces the whole seed definition with the fields sent, so send every required field. A name used by another seed is refused.
Changes data · Role: Release manager or admin · MCP tool: schema_seed_update
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The seed ID |
name (body) | string, required | The seed name, up to 255 characters, unique among seeds |
description (body) | string, optional | What the seed is for |
schemaName (body) | string, optional | The schema of the table |
tableName (body) | string, required | The table the rows belong in, up to 255 characters |
mode (body) | one of insert, upsert, sync, required | insert adds missing rows, upsert also updates changed rows, sync also deletes rows that are not in the seed |
keyColumns (body) | list of string, required | The columns that identify a row, at least one, without repeats |
rows (body) | list of object, required | The rows, each with a key no other row has. A sync seed needs at least one row |
appliesToDialects (body) | list of string, optional | The engines the seed may be planned on: postgresql, cockroachdb, timescaledb, mysql, mariadb, sqlite, mssql, oracle, mongodb, redis, cassandra, neo4j or elasticsearch. Leave it out for every engine |
isActive (body) | boolean, optional | Whether the seed can be planned. Default true |
DELETE /api/db-devops/seed/:id
Deletes a seed definition. Scripts already made from it are kept.
Changes data and can remove or overwrite it · Role: Release manager or admin · MCP tool: schema_seed_delete
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The seed ID |
POST /api/db-devops/seed/plan
Reads the seed's table on the connection and returns the rows to insert, the column changes to update, the rows to delete in sync mode and the statements that would do it. Nothing is run. An inactive seed, a connection engine the seed does not apply to and a missing table are refused.
Reads only · Role: Any signed-in user · MCP tool: schema_seed_plan
| Input | Type | Description |
|---|---|---|
seedId (body) | string (uuid), required | The seed to plan |
connectionId (body) | string (uuid), required | The connection to plan against |
dialect (body) | string, optional | The engine expected. Refused when it is not the connection's engine |
POST /api/db-devops/seed/:id/script
Plans the seed on the connection and saves the statements as a new migration script for that connection, pending approval and in asap mode, so it can run before approval where the environment does not require approval. Nothing is run here, and a connection that already matches the seed is refused. Returns the script ID, name, approval status and counts; compute its impact analysis with scripts_blast_radius_compute.
Changes data · Role: Any signed-in user · MCP tool: schema_seed_script
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The seed ID |
connectionId (body) | string (uuid), required | The connection the script is for |