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).

MethodPathWhat it does
GET/api/db-devops/schema/enginesList the engines schema tools support
POST/api/db-devops/schema/snapshotCapture a schema snapshot
POST/api/db-devops/schema/liveRead the live schema of a connection
POST/api/db-devops/schema/snapshots/:id/baselineMake a snapshot the baseline
GET/api/db-devops/schema/snapshotsList the schema snapshots of a connection
GET/api/db-devops/schema/snapshots/:idGet a schema snapshot
DELETE/api/db-devops/schema/snapshots/:idDelete a schema snapshot
POST/api/db-devops/schema/exportExport a schema as DDL
POST/api/db-devops/schema/diffCompare two schemas
POST/api/db-devops/schema/planPlan a migration to a desired schema
POST/api/db-devops/schema/driftScan a connection for schema drift
GET/api/db-devops/schema/drift/:connectionIdList the drift alerts of a connection
POST/api/db-devops/schema/drift/:alertId/ackAcknowledge a drift alert
POST/api/db-devops/lintLint a script
GET/api/db-devops/lint/rulesList the lint rules
POST/api/db-devops/preflightRun the pre-run checks of a script
GET/api/db-devops/seedList seed definitions
POST/api/db-devops/seedCreate a seed definition
PUT/api/db-devops/seed/:idReplace a seed definition
DELETE/api/db-devops/seed/:idDelete a seed definition
POST/api/db-devops/seed/planPlan a seed on a connection
POST/api/db-devops/seed/:id/scriptMake 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

InputTypeDescription
connectionId (body)string (uuid), requiredThe connection to read
dialect (body)string, optionalThe 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, optionalThe database to read. Defaults to the connection's database
schema (body)string, optionalThe one schema to read, up to 255 characters. Leave it out for every schema
label (body)string, optionalA label for the snapshot, up to 255 characters
baseline (body)boolean, optionalMake 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

InputTypeDescription
connectionId (body)string (uuid), requiredThe connection to read
dialect (body)string, optionalThe 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, optionalThe database to read. Defaults to the connection's database
schema (body)string, optionalThe 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

InputTypeDescription
id (path)string (uuid), requiredThe 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

InputTypeDescription
connectionId (query)string (uuid), requiredThe 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

InputTypeDescription
id (path)string (uuid), requiredThe 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

InputTypeDescription
id (path)string (uuid), requiredThe 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

InputTypeDescription
snapshotId (body)string (uuid), optionalThe snapshot to export. Takes precedence over connectionId
connectionId (body)string (uuid), optionalThe connection whose live schema to export
dialect (body)string, optionalThe 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, optionalThe database to read. Defaults to the connection's database
schema (body)string, optionalThe 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

InputTypeDescription
fromSnapshotId (body)string (uuid), requiredThe snapshot to compare from
toSnapshotId (body)string (uuid), optionalThe snapshot to compare to. Send this or toConnectionId
toConnectionId (body)string (uuid), optionalThe connection whose live schema to compare to
toDialect (body)string, optionalThe engine expected for toConnectionId. Refused when it is not that connection's engine
toDatabase (body)string, optionalThe 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

InputTypeDescription
fromConnectionId (body)string (uuid), requiredThe connection to migrate
desiredSnapshotId (body)string (uuid), requiredThe snapshot of the desired schema
fromDialect (body)string, optionalThe engine expected for fromConnectionId. Refused when it is not that connection's engine
fromDatabase (body)string, optionalThe 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

InputTypeDescription
connectionId (body)string (uuid), requiredThe connection to scan
dialect (body)string, optionalThe 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, optionalThe database to read. Defaults to the connection's database
baselineId (body)string (uuid), optionalThe 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

InputTypeDescription
connectionId (path)string (uuid), requiredThe connection ID
status (query)one of open, acknowledged, resolved, optionalOnly alerts in this state
acknowledged (query)one of true, false, optionalOnly 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

InputTypeDescription
alertId (path)string (uuid), requiredThe 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

InputTypeDescription
sql (body)string, requiredThe script to check
dialect (body)string, requiredThe 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

InputTypeDescription
sql (body)string, requiredThe 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), requiredThe connection to check against
database (body)string, optionalThe 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

InputTypeDescription
name (body)string, requiredThe seed name, up to 255 characters, unique among seeds
description (body)string, optionalWhat the seed is for
schemaName (body)string, optionalThe schema of the table
tableName (body)string, requiredThe table the rows belong in, up to 255 characters
mode (body)one of insert, upsert, sync, requiredinsert adds missing rows, upsert also updates changed rows, sync also deletes rows that are not in the seed
keyColumns (body)list of string, requiredThe columns that identify a row, at least one, without repeats
rows (body)list of object, requiredThe rows, each with a key no other row has. A sync seed needs at least one row
appliesToDialects (body)list of string, optionalThe 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, optionalWhether 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

InputTypeDescription
id (path)string (uuid), requiredThe seed ID
name (body)string, requiredThe seed name, up to 255 characters, unique among seeds
description (body)string, optionalWhat the seed is for
schemaName (body)string, optionalThe schema of the table
tableName (body)string, requiredThe table the rows belong in, up to 255 characters
mode (body)one of insert, upsert, sync, requiredinsert adds missing rows, upsert also updates changed rows, sync also deletes rows that are not in the seed
keyColumns (body)list of string, requiredThe columns that identify a row, at least one, without repeats
rows (body)list of object, requiredThe rows, each with a key no other row has. A sync seed needs at least one row
appliesToDialects (body)list of string, optionalThe 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, optionalWhether 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

InputTypeDescription
id (path)string (uuid), requiredThe 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

InputTypeDescription
seedId (body)string (uuid), requiredThe seed to plan
connectionId (body)string (uuid), requiredThe connection to plan against
dialect (body)string, optionalThe 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

InputTypeDescription
id (path)string (uuid), requiredThe seed ID
connectionId (body)string (uuid), requiredThe connection the script is for