Always send the full schema. MoonDB diffs it against the current version and generates migrations automatically.
Applied immediately, no confirmation needed:
Returns a preview first. Add "confirm_destructive": true to apply:
PUT /p/{id}/v1/schema
{
"tables": { ... },
"confirm_destructive": true
}
GET /p/{id}/v1/schema # current schema + version POST /p/{id}/v1/schema/validate # dry-run without applying GET /p/{id}/v1/schema/history # version history (admin key) POST /p/{id}/v1/schema/seed # bulk-load rows with @table.index cross-refs GET /p/{id}/v1/openapi.json # OpenAPI 3.0.3 spec, auto-generated GET /p/{id}/v1/llm-context # agent prompt — re-fetch after every schema change
Use @<table>.<index> to reference rows inserted earlier in the same request:
POST /p/{id}/v1/schema/seed { "users": [{ "email": "a@x.io", "password": "secret" }], "habits": [{ "user_id": "@users.0", "name": "Run" }] }