PgDesigner

PgDesigner CLI for CI/CD

Single binary, zero dependencies. Lint, diff, generate, and seed — all from your terminal or CI pipeline.

Seven commands, one binary

pgdesigner schema.pgd                           # open in browser UI
pgdesigner generate -o schema.sql schema.pgd    # DDL to file
pgdesigner diff old.pgd new.pgd                 # ALTER SQL to stdout
pgdesigner lint -f json schema.pgd              # lint with JSON output
pgdesigner testdata -seed 42 schema.pgd         # reproducible test data
pgdesigner convert -o project.pgd schema.pdd    # import from other formats
pgdesigner merge -o all.pgd core.pgd billing.pgd  # merge schemas into one
pgdesigner version                              # print version

Every command accepts .pgd, .pdd, .dbs, .dm2, .sql, or a PostgreSQL connection string as input.

Plug into your CI pipeline

Lint on every PR

- name: Validate schema
  run: pgdesigner lint -s error schema.pgd

Exit code 1 if errors found → blocks the merge.

Generate migration on schema change

- name: Generate migration
  run: |
    git show origin/main:schema.pgd > /tmp/old.pgd
    pgdesigner diff /tmp/old.pgd schema.pgd | tee migration.sql

Exit code is 0 with or without changes. With -o, the file is not written when there are no changes.

Seed test database

- name: Seed test data
  run: |
    pgdesigner generate schema.pgd | psql $DATABASE_URL
    pgdesigner testdata -seed 42 -rows 100 schema.pgd | psql $DATABASE_URL

Command reference

CommandFlagsDescription
generate-oFull DDL to stdout or file
diff-f sql|json, -oCompare two schemas → ALTER SQL or JSON
lint-f text|json, -s, -fixValidate schema, auto-fix issues
testdata-seed, -rows, -tables, -oGenerate realistic INSERT statements
convert-o, -schema, -fullImport from .pdd/.dbs/.dm2/.sql/DSN
merge-o, -layout both|base|overlay, -nameMerge several schemas into one .pgd; later files win on conflicts

Exit codes

CodeMeaning
0Success, including a diff with changes
1Lint errors found, missing arguments, file not found or parse error
2Unknown flag

Visual editor flags

Without a command, pgdesigner starts a local server and opens the editor in your browser:

pgdesigner schema.pgd              # open a model
pgdesigner postgres://localhost/app # reverse-engineer a live database
pgdesigner -app schema.pgd         # Chrome/Chromium app window, no address bar
pgdesigner -port 8080 schema.pgd   # fixed port instead of a random one
pgdesigner -read-only schema.pgd   # disable every write operation

-read-only is how the public demo runs. For a live database, -schema and -full work the same as in convert.

Cross-platform, zero dependencies

Single statically-linked binary. No runtime dependencies — no Go, no Node, no Python. Works on:

  • macOS — amd64 + arm64, signed and notarized
  • Linux — amd64 + arm64
  • Windows — amd64 + arm64
curl -L https://github.com/vmkteam/pgdesigner/releases/latest/download/pgdesigner-linux-amd64.tar.gz | tar xz
./pgdesigner lint schema.pgd