PgDesigner

CLI Reference — PgDesigner PostgreSQL Tools

Usage

pgdesigner [command] [flags] <file>

Input files: .pgd, .pdd, .dbs, .dm2, .sql, or a PostgreSQL connection string.

Commands

pgdesigner (no command)

Opens the visual editor in your default browser.

pgdesigner schema.pgd

generate

Generate production-ready DDL from a schema file.

pgdesigner generate schema.pgd
pgdesigner generate -o schema.sql schema.pgd
FlagDefaultDescription
-ostdoutOutput .sql file

diff

Compare two schemas and generate ALTER SQL.

pgdesigner diff old.pgd new.pgd
pgdesigner diff -f json old.pgd new.pgd
FlagDefaultDescription
-fsqlOutput format: sql or json

lint

Validate schema against 75 rules.

pgdesigner lint schema.pgd
pgdesigner lint -f json schema.pgd
pgdesigner lint -s error schema.pgd
pgdesigner lint -fix schema.pgd
FlagDefaultDescription
-ftextOutput format: text or json
-sinfoMinimum severity: error, warning, info
-fixfalseAuto-fix fixable issues and save

testdata

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
FlagDefaultDescription
-ostdoutOutput .sql file
-seed0 (random)Random seed for reproducibility
-rows50Rows per table
-tablesallComma-separated table names

convert

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
FlagDefaultDescription
-oinput name + .pgdOutput .pgd file

Supported inputs: .pdd (MicroOLAP), .dbs (DbSchema), .dm2 (Toad), .sql (pg_dump), PostgreSQL connection string.

Exit codes

CodeMeaning
0Success (no lint errors, no diff changes)
1Lint errors found or diff has changes
2File not found or parse error

Platforms

Single statically-linked binary. No runtime dependencies.

  • macOS amd64 + arm64 (signed, notarized)
  • Linux amd64 + arm64
  • Windows amd64