Skip to content

feat(v18)!: retire full/ — libpg-query pg18+ ships the full API (13–17 stay slim)#161

Merged
pyramation merged 2 commits into
mainfrom
feat/full-pg18
Jul 21, 2026
Merged

feat(v18)!: retire full/ — libpg-query pg18+ ships the full API (13–17 stay slim)#161
pyramation merged 2 commits into
mainfrom
feat/full-pg18

Conversation

@pyramation

@pyramation pyramation commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Per discussion: instead of maintaining a separate full package, full/ (@libpg-query/parser) is deleted entirely and the regular libpg-query PG18 build (versions/18) becomes the full-API build. PG 13–17 remain slim (parse/parseSync only) — the full API is a PG18+ upgrade incentive.

  • versions/18 now exports: parse, parseSync, parsePlPgSQL(+Sync), scan(+Sync), fingerprint(+Sync), normalize(+Sync), loadModule + SqlError helpers
  • Weight: wasm 1.17 MB → 1.72 MB raw (gzipped 228 KB → 338 KB, +110 KB). Node users unaffected (wasm loaded from disk, not bundled); only browser consumers pay +110 KB over the wire
  • Template system extended instead of forked:
    • templates/full/{index.ts, wasm_wrapper.c, libpg-query.d.ts} — full-API variants
    • templates/Makefile.template gains {{EXPORTED_FUNCTIONS}}; copy-templates.js picks slim vs full via a new x-publish.fullApi: true flag (set only on versions/18, whose libpgQueryTag is also corrected to 18-constructive)
  • versions/18 gains the full test suites (fingerprint/normalize/plpgsql/scan) plus pg18.test.js: version 180004, RETURNING OLD.a AS oa, NEW.a AS na (returningClause.exprs), GENERATED ... VIRTUAL (generated_kind: "v"), ALTER CONSTRAINT c NOT ENFORCED (ATAlterConstraint.alterEnforceability), scan of OLD/NEW tokens
  • No C API changes were needed for PG18 — the pg_query.h surface (parse/plpgsql/fingerprint/normalize/scan) is unchanged from 17; only AST output shapes differ
  • CI: full matrix entry removed (v18 covers it); manual build-wasm workflows point at versions/18; publish-versions.js full-package block removed; docs (README, PUBLISH.md, versions/18 README + SCAN.md) updated

Verification (local, docker emscripten/emsdk — same as CI)

  • versions/18 full build: 90/90 tests pass; exports verified from built wasm/index.cjs
  • versions/13–17 untouched, all built + tests pass; types/13–18 + @pgsql/parser rebuilt against the new v18 wasm — all pass (parser only uses _wasm_parse_query_raw, still exported)

Publishing (not done — for Dan)

pnpm run publish:versions     # select 18, pick "minor" → publishes libpg-query@18.1.0 --tag pg18

or manually:

cd versions/18
pnpm version minor            # 18.0.2 -> 18.1.0 (new exports = semver-minor)
git add . && git commit -m "release: bump libpg-query v18 version"
pnpm build && pnpm test
pnpm run publish:pkg          # publishes libpg-query@18.1.0 --tag pg18

Optional cleanup on npm afterwards:

npm deprecate @libpg-query/parser "Retired: use libpg-query@pg18 — the full API now ships in the regular package (PG18+)."

Link to Devin session: https://app.devin.ai/sessions/2ca64f9082684d28890888748447face
Requested by: @pyramation

@pyramation pyramation self-assigned this Jul 21, 2026
@devin-ai-integration

Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot changed the title feat(full): version @libpg-query/parser per PG major — full/17 (pg17) + full/18 (pg18) feat(v18)!: retire full/ — libpg-query pg18+ ships the full API (13–17 stay slim) Jul 21, 2026
@pyramation
pyramation merged commit 649a2c0 into main Jul 21, 2026
58 checks 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.

1 participant