Skip to content

Releases: fmguerreiro/pgmold

v0.9.0

05 Dec 10:12

Choose a tag to compare

  • Add baseline command module for adopting existing databases
  • Includes unsupported object detection (materialized views, domains, partitioned tables, etc.)
  • Round-trip verification and zero-diff guarantees
  • Text and JSON report formats

v0.8.0

05 Dec 09:50

Choose a tag to compare

  • Add REFERENCING transition tables support for triggers (OLD TABLE, NEW TABLE)

v0.7.0

05 Dec 09:24

Choose a tag to compare

  • Add trigger ENABLE/DISABLE state support (Origin, Disabled, Replica, Always)
  • Parser handles ALTER TABLE ... ENABLE/DISABLE/ENABLE REPLICA/ENABLE ALWAYS TRIGGER
  • Introspection reads tgenabled from pg_trigger catalog
  • Diff emits AlterTriggerEnabled when only enabled state differs
  • SQL generation for trigger enable/disable statements

v0.6.0

05 Dec 07:41

Choose a tag to compare

Breaking Changes

  • Renamed Trigger.table_schematarget_schema
  • Renamed Trigger.tabletarget_name
  • Renamed MigrationOp::DropTrigger fields similarly

This fixes semantic accuracy: INSTEAD OF triggers target views (not tables), so "target" is more appropriate than "table".

Upgrading

Update any code that:

  • Constructs Trigger structs directly
  • Matches on MigrationOp::DropTrigger variants
  • Accesses trigger.table or trigger.table_schema fields

v0.5.0

05 Dec 06:48

Choose a tag to compare

What's New

Schema Dump Command

New pgmold dump command to export database schemas to SQL DDL files.

# Dump schema to stdout
pgmold dump --database db:postgres://localhost/mydb

# Dump to file with specific schemas
pgmold dump --database db:postgres://localhost/mydb --target-schemas auth,api,public --output schema.sql

Features:

  • Exports all schema objects (tables, indexes, foreign keys, enums, sequences, functions, views, triggers, policies)
  • Dependency-ordered output (tables before foreign keys, etc.)
  • Multi-schema support
  • Optional header with metadata

Installation

cargo install pgmold

v0.4.0

05 Dec 06:11

Choose a tag to compare

Features

  • SERIAL column support: Automatically expand SERIAL, BIGSERIAL, and SMALLSERIAL columns to their underlying integer type + sequence
  • Sequence support: Full support for CREATE SEQUENCE including parsing, introspection, diff, and SQL generation
  • Sequence lint rules: Added warnings for destructive sequence operations (DROP SEQUENCE, RESTART)

Improvements

  • Stricter error handling: Removed silent fallbacks in favor of explicit errors for:
    • Unknown referential action codes from PostgreSQL
    • Unknown sequence data types
    • Missing function return types or bodies
    • Invalid UTF-8 paths
    • Missing tables during RLS introspection

Testing

  • Added integration tests for sequence roundtrip and alterations
  • Added parser tests for SERIAL variants with schema qualifiers

v0.3.1

02 Dec 06:00

Choose a tag to compare

  • Fix function body comparison producing false diffs due to dollar-quote delimiters.

v0.3.0

02 Dec 04:41

Choose a tag to compare

  • Add views support (CREATE VIEW, materialized views)

v0.2.0

02 Dec 02:31

Choose a tag to compare

What's New

  • Multi-file schema support: Load SQL schemas from multiple files, directories, and glob patterns
    • --schema ./schema/ loads all *.sql files recursively
    • --schema "schema/**/*.sql" supports glob patterns
    • Multiple --schema flags can be combined
    • Duplicate object detection with clear error messages

Usage

# Directory
pgmold apply --schema ./schema/ --database $DB_URL

# Glob pattern
pgmold apply --schema "schema/**/*.sql" --database $DB_URL

# Multiple sources
pgmold apply --schema types.sql --schema "tables/*.sql" --database $DB_URL

v0.1.1

21 Nov 08:16

Choose a tag to compare

  • Add whitespace-insensitive comparison for SQL function bodies
  • Apply clippy fixes