Skip to content

feat(generate): PGlite support for v1-template projects; dataDir fix - #146

Merged
cultron merged 1 commit into
mainfrom
feat/upgrade-v1-orm-pglite
Oct 4, 2026
Merged

cultron merged 1 commit into
mainfrom
feat/upgrade-v1-orm-pglite

Conversation

@cultron

@cultron cultron commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

So the pre-deploy checks run (instead of skip) on old v1 services like prod svc 52.

  • v1 upgrade: when src/orm.config.ts is still the stock v1 file (whitespace-insensitive), generate replaces it with the same config plus a DATABASE_TYPE=pglite branch, and declares typeorm-pglite / @electric-sql/pglite (template versions). Customized configs are untouched; the checks keep skipping for them.
  • dataDir bug: typeorm-pglite 0.3.4 takes an options object; a string data dir is ignored and PGlite runs in memory, so schema:sync and the server used different databases ("relation does not exist"). The config now passes { dataDir } (also works on 0.3.2), and generate rewrites the old string form in existing configs.
  • migrate verify --skip-build builds anyway when the migration isn't compiled (it otherwise ran nothing and reported drift).

Verified on svc 52's saved code: generate + npm install → tsc 0 errors, build ok; test smoke runs and passes on all 9 entities; migrate generate + migrate verify pass for a dropped field. 376 tests, lint 0 errors.

…deploy checks

- A stock v1 src/orm.config.ts (whitespace-insensitive match) is replaced
  with the same config plus a DATABASE_TYPE=pglite branch, and the PGlite
  packages are declared. A customized config is left alone (checks skip).
- PGLITE_DATA_DIR is passed as { dataDir }: typeorm-pglite 0.3.4 ignores a
  string and runs in memory, so schema:sync and the server saw different
  databases. Existing configs with the string form are rewritten.
- migrate verify --skip-build still builds when the migration isn't compiled.

Verified on prod svc 52's saved code: generate + install -> tsc 0 errors,
smoke runs (not skipped) and passes on all 9 entities, migrate generate +
verify pass for a dropped field.
@cultron
cultron merged commit 06b0436 into main Oct 4, 2026
4 checks passed
@cultron
cultron deleted the feat/upgrade-v1-orm-pglite branch October 4, 2026 18:53
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.

1 participant