@profullstack/dbml 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/dbml.js +8 -0
- package/package.json +1 -1
package/bin/dbml.js
CHANGED
|
@@ -17,6 +17,7 @@ usage:
|
|
|
17
17
|
dbml validate <file|-> syntax + semantic errors with line:column
|
|
18
18
|
dbml parse <file|-> JSON model (tables, columns, refs, enums)
|
|
19
19
|
dbml summary <file|-> counts and a per-table outline
|
|
20
|
+
dbml diagram <file|-> > schema.svg ER diagram as SVG
|
|
20
21
|
dbml review <file|-> [--rules a,b] deterministic schema review, score 0-100
|
|
21
22
|
dbml format <file|-> canonical DBML
|
|
22
23
|
dbml to-sql <file|-> [--dialect postgres|mysql|mssql|oracle]
|
|
@@ -157,6 +158,13 @@ async function main() {
|
|
|
157
158
|
else console.log(JSON.stringify(cmd === 'parse' && !json ? r.model : r, null, 2));
|
|
158
159
|
return 0;
|
|
159
160
|
}
|
|
161
|
+
case 'diagram': {
|
|
162
|
+
const r = await call('POST', '/api/v1/diagram', { dbml: await readSource(file) });
|
|
163
|
+
if (!r.valid) return printErrors(r.errors, file), 1;
|
|
164
|
+
if (json) console.log(JSON.stringify(r, null, 2));
|
|
165
|
+
else process.stdout.write(r.svg + '\n');
|
|
166
|
+
return 0;
|
|
167
|
+
}
|
|
160
168
|
case 'review': {
|
|
161
169
|
const rules = typeof flags.rules === 'string' ? flags.rules.split(',') : undefined;
|
|
162
170
|
const r = await call('POST', '/api/v1/review', { dbml: await readSource(file), rules });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@profullstack/dbml",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "CLI and MCP stdio bridge for dbml.db: validate, review and convert DBML database schemas (DBML to SQL and back) from the terminal or an AI agent.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|