pgdesigner [command] [flags] <file> Input files: .pgd, .pdd, .dbs, .dm2, .sql, or a PostgreSQL connection string. Flags may go before or after file names.
Starts a local server on 127.0.0.1 and opens the visual editor in your default browser. Without a file it shows the Welcome Screen with sample schemas, recent files and import. The server stops when the browser tab closes.
pgdesigner
pgdesigner schema.pgd
pgdesigner "postgres://localhost/mydb" -schema public -full
pgdesigner -read-only -port 8080 schema.pgd | Flag | Default | Description |
|---|---|---|
-port | random | Fixed port for the local server |
-read-only | false | Disable all write operations (the public demo runs in this mode) |
-app | false | Open in Chrome/Chromium app mode, without the address bar |
-schema | all | Schemas to read when opening a database (comma-separated) |
-full | false | Also read views, functions, triggers and types when opening a database |
Generate production-ready DDL from a schema file.
pgdesigner generate schema.pgd
pgdesigner generate -o schema.sql schema.pgd | Flag | Default | Description |
|---|---|---|
-o | stdout | Output .sql file |
Compare two schemas and generate ALTER SQL.
pgdesigner diff old.pgd new.pgd
pgdesigner diff -f json old.pgd new.pgd
pgdesigner diff "postgres://localhost/mydb" schema.pgd -o migration.sql Either side can be a database: diff <dsn> schema.pgd gives the migration from the live database to the model.
| Flag | Default | Description |
|---|---|---|
-f | sql | Output format: sql or json |
-o | stdout | Output file; not written when there are no changes |
Validate schema against 69 rules.
pgdesigner lint schema.pgd
pgdesigner lint -f json schema.pgd
pgdesigner lint -s error schema.pgd
pgdesigner lint -fix schema.pgd | Flag | Default | Description |
|---|---|---|
-f | text | Output format: text or json |
-s | info | Minimum severity: error, warning, info |
-fix | false | Auto-fix fixable issues and save |
Generate realistic INSERT statements.
pgdesigner testdata schema.pgd
pgdesigner testdata -seed 42 -rows 100 schema.pgd
pgdesigner testdata -tables users,orders -o seed.sql schema.pgd | Flag | Default | Description |
|---|---|---|
-o | stdout | Output .sql file |
-seed | 0 (random) | Random seed for reproducibility |
-rows | 50 | Rows per table |
-tables | all | Comma-separated table names |
Import from other formats or live database.
pgdesigner convert schema.pdd -o project.pgd
pgdesigner convert schema.sql -o project.pgd
pgdesigner convert "postgres://localhost/mydb" -o project.pgd
pgdesigner convert "postgres://localhost/mydb" -schema public,billing -full | Flag | Default | Description |
|---|---|---|
-o | input name + .pgd | Output .pgd file; for a database, <dbname>.pgd in the current directory, which must not exist yet |
-schema | all | Schemas to read from a database (comma-separated) |
-full | false | Also read views, functions, triggers, extensions and types from a database |
Supported inputs: .pdd (MicroOLAP), .dbs (DbSchema), .dm2 (Toad), .sql (pg_dump), PostgreSQL connection string.
Merge two or more schemas into one .pgd — for example, combine models of separate services, or a model with a fresh import from the database. Inputs can be any supported format; files are merged left to right, and the later file wins on conflicts.
pgdesigner merge -o merged.pgd base.pgd overlay.pgd
pgdesigner merge -o all.pgd -layout base users.pgd billing.sql orders.pdd | Flag | Default | Description |
|---|---|---|
-o | merged.pgd | Output .pgd file |
-layout | both | Where diagram positions come from: both, base or overlay |
-name | last file's name | Project name of the result |
pgdesigner version | Code | Meaning |
|---|---|
0 | Success, including a diff with changes and lint with only warnings or info |
1 | Lint errors found, missing arguments, file not found or parse error |
2 | Unknown flag |
Single statically-linked binary. No runtime dependencies.