export_ddl
Generates the SQL DDL (CREATE TABLE + CHECK constraints + foreign keys with their ON DELETE/ON UPDATE actions) from the ERD, for postgres (default), mysql or sqlite. Exporting an inconsistent ERD produces broken SQL: analyze_data_model checks it upstream. ⚠️ warnings lists what the target dialect CANNOT express (each entry carries a code and names the table.column concerned). These losses are meant for the user, in plain words: a script exported without mentioning its losses suggests a faithful conversion. An empty list really means "nothing lost".
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "export_ddl"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dialect | No | Target SQL dialect (default 'postgres') | |
| ifNotExists | No | Add IF NOT EXISTS to the CREATE TABLEs (default true) | |
| expectedProjectId | No | UUID of the project THIS call targets (overrides the session project). | |
| inlineForeignKeys | No | Inline the FK constraints in the CREATE TABLE rather than in separate ALTER TABLEs (default false). IGNORED for sqlite, which does not know ALTER TABLE ADD FOREIGN KEY: keys are inlined there in every case, and the script emits `PRAGMA foreign_keys = ON`, without which sqlite does not enforce them. |