SchemaSketch
v1.3.1Design database diagrams in DBML: create, edit, validate, export SQL, Laravel, Mermaid.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_dbml_syntax_guide
Read this before writing or editing any DBML — the exact syntax SchemaSketch accepts, with a full example.
list_diagrams
List the signed-in user's saved diagrams (id, name, last updated).
get_diagram
Fetch one diagram by id, including its full DBML source and table positions.
| Parameter | Type | Description |
|---|---|---|
diagram_id * | string | The diagram id (a UUID), from list_diagrams. |
validate_dbml
Parse DBML and report syntax errors plus semantic warnings (duplicate names, dangling refs, unrecognized/mismatched types) before saving it. Read-only — never touches the server.
| Parameter | Type | Description |
|---|---|---|
dbml_source * | string | The DBML text to check. |
create_diagram
Create a new diagram. The DBML is validated first: syntax errors or relationships to missing tables/columns mean nothing is saved; warnings are returned with the result.
| Parameter | Type | Description |
|---|---|---|
name * | string | Diagram title, shown on the dashboard. |
dbml_source | string | Initial DBML text. Empty diagram if omitted. |
update_diagram
Replace a diagram's DBML source (and/or rename it). This overwrites the whole source — fetch it with get_diagram first if you need to edit rather than replace it outright, and pass its version as base_version so you never overwrite someone else's newer change. New DBML is validated first: errors mean nothing is saved; warnings are returned with the result.
| Parameter | Type | Description |
|---|---|---|
diagram_id * | string | The diagram id (a UUID), from list_diagrams. |
base_version | integer | The diagram's `version` from get_diagram. When given, the update is refused if someone else saved since, instead of overwriting their change. Recommended whenever you edit. |
dbml_source | string | New full DBML text. Omit to leave unchanged. |
name | string | New title. Omit to leave unchanged. |
renames | array | Tables, columns, enums and table groups this edit renames. Always list them: without it a rename can look like a removed column plus a new one, and a migration generated from the diagram would drop th… |
delete_diagram
Permanently delete a diagram. This cannot be undone — confirm with the user before calling it.
| Parameter | Type | Description |
|---|---|---|
diagram_id * | string | The diagram id (a UUID), from list_diagrams. |
export_sql
Generate CREATE TABLE / ALTER TABLE SQL DDL for a diagram, in a given dialect.
| Parameter | Type | Description |
|---|---|---|
dbml_source | string | Or export unsaved DBML text directly instead of a saved diagram. |
diagram_id | string | A saved diagram to export (its UUID). |
dialect | string |
export_laravel_migrations
Generate Laravel migration files (one per table, plus a foreign-keys migration) for a diagram.
| Parameter | Type | Description |
|---|---|---|
dbml_source | string | Or export unsaved DBML text directly instead of a saved diagram. |
diagram_id | string | A saved diagram to export (its UUID). |
export_laravel_models
Generate Laravel Eloquent model files (fillable, casts, and inferred relationships including belongsToMany through plain pivot tables) for a diagram.
| Parameter | Type | Description |
|---|---|---|
dbml_source | string | Or export unsaved DBML text directly instead of a saved diagram. |
diagram_id | string | A saved diagram to export (its UUID). |
laravel_version | integer | Target Laravel major version. 10 emits the legacy `protected $casts` property; 11+ emits the newer `casts(): array` method (not recognized by Eloquent 10). |
export_mermaid
Generate Mermaid erDiagram syntax for a diagram.
| Parameter | Type | Description |
|---|---|---|
dbml_source | string | Or export unsaved DBML text directly instead of a saved diagram. |
diagram_id | string | A saved diagram to export (its UUID). |
export_plantuml
Generate PlantUML entity syntax for a diagram.
| Parameter | Type | Description |
|---|---|---|
dbml_source | string | Or export unsaved DBML text directly instead of a saved diagram. |
diagram_id | string | A saved diagram to export (its UUID). |
import_sql
Convert CREATE TABLE / ALTER TABLE SQL DDL into DBML text. Read-only — never touches the server; pass the result to create_diagram or update_diagram to actually save it.
| Parameter | Type | Description |
|---|---|---|
sql * | string | The SQL text to convert (CREATE TABLE / ALTER TABLE ... FOREIGN KEY statements). |
import_mermaid
Convert Mermaid erDiagram syntax into DBML text. Read-only — never touches the server; pass the result to create_diagram or update_diagram to actually save it.
| Parameter | Type | Description |
|---|---|---|
mermaid * | string | The Mermaid erDiagram source to convert. |
import_plantuml
Convert PlantUML entity syntax into DBML text. Read-only — never touches the server; pass the result to create_diagram or update_diagram to actually save it.
| Parameter | Type | Description |
|---|---|---|
plantuml * | string | The PlantUML entity source to convert. |