Skip to content

Postgresql support - #52

Merged
skurfuerst merged 7 commits into
sandstorm:mainfrom
finjaadam:postgresql-support
Aug 19, 2026
Merged

skurfuerst merged 7 commits into
sandstorm:mainfrom
finjaadam:postgresql-support

Conversation

@finjaadam

Copy link
Copy Markdown
  • Add PostgreSQL support to the content-dump tool, mirroring the existing MySQL/MariaDB path: full schema reconstruction (columns/types, NOT NULL, defaults, identity/generated columns, PK/UNIQUE/CHECK/FK constraints, indexes, sequence state) from pg_catalog, with data streamed via COPY ... FROM stdin — no pg_dump/psql binary shelled out to, keeping synco self-contained.
    • Wire driver detection (pdo_pgsql/pgsql) through Flow and Laravel credential extraction, the shared DatabaseDump dispatcher, and the receive download switch (dto.TYPE_POSTGRESDUMP, previously an unimplemented stub).
    • Fix two bugs found in review along the way: an ignored EncryptToFile error that could panic on a nil writer, and unescaped single quotes in the setval sequence-name literal.
    • Document known limitations (custom types/extensions, non-public schemas, materialized views, partitioned tables, triggers/functions, comments, GRANTs — not dumped) in docs/README.md/docs/architecture.md.

Test plan

  • Unit tests for DDL/constraint/index/sequence/COPY generation (pkg/util/postgres/go_pgdump, sqlmock-based) and driver detection (flowServe, laravelServe)
  • New e2e test (test_e2e/postgresframework_test.go) using gnomock's Postgres preset, mirroring the existing MariaDB e2e test
  • Manually verified end-to-end against a real local Neos/Flow-on-Postgres project: serve/receive round-trip, dump replayed into a scratch Postgres via psql -f, row counts matched, and a post-restore insert confirmed no identity/sequence collision

@skurfuerst
skurfuerst merged commit 6396799 into sandstorm:main Aug 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants