Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build-wasm-no-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ jobs:
./emsdk install 3.1.59
./emsdk activate 3.1.59
source ./emsdk_env.sh
working-directory: full
working-directory: versions/18
- name: Build with Emscripten 🏗
run: |
source ./emsdk/emsdk_env.sh
emmake make
emmake make build
working-directory: full
working-directory: versions/18
- name: Archive production artifacts 🏛
uses: actions/upload-artifact@v4
with:
name: wasm-artifacts
path: full/wasm
path: versions/18/wasm
4 changes: 2 additions & 2 deletions .github/workflows/build-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ jobs:

- name: Build WASM 🏗
run: pnpm run build
working-directory: full
working-directory: versions/18

- name: Archive production artifacts 🏛
uses: actions/upload-artifact@v4
with:
name: wasm-artifacts
path: full/wasm/
path: versions/18/wasm/
retention-days: 7
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ jobs:
strategy:
matrix:
package:
- { name: 'full', path: 'full', version: '18' }
- { name: 'v13', path: 'versions/13', version: '13' }
- { name: 'v14', path: 'versions/14', version: '14' }
- { name: 'v15', path: 'versions/15', version: '15' }
Expand Down Expand Up @@ -78,7 +77,6 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
package:
- { name: 'full', path: 'full', version: '18' }
- { name: 'v13', path: 'versions/13', version: '13' }
- { name: 'v14', path: 'versions/14', version: '14' }
- { name: 'v15', path: 'versions/15', version: '15' }
Expand Down
31 changes: 7 additions & 24 deletions PUBLISH.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ pnpm run publish:versions
This interactive script will:
- Check for uncommitted changes (will error if any exist)
- Let you select which versions to publish (or all)
- Also includes the full package (@libpg-query/parser)
- Ask for version bump type (patch or minor only)
- Ask if you want to skip the build step (useful if already built)
- Always run tests (even if build is skipped)
Expand Down Expand Up @@ -163,32 +162,16 @@ npm install libpg-query@pg16 # PostgreSQL 16 specific
npm install libpg-query # Latest/default version
```

## Full Package (@libpg-query/parser)
## Full API on PG 18+

### Quick Publish
```bash
cd full
pnpm version patch
git add . && git commit -m "release: bump @libpg-query/parser version"
pnpm build
pnpm test
pnpm publish --tag pg17
```
The former `full/` package (`@libpg-query/parser`) has been retired. Starting with
PostgreSQL 18, the regular `libpg-query` package (`versions/18`) ships the full API:
`parse`, `parsePlPgSQL`, `scan`, `fingerprint`, `normalize` + sync variants.
Versions 13–17 remain slim (parse only).

### Promote to latest (optional)
```bash
npm dist-tag add @libpg-query/parser@pg17 latest
```

### What it does
- Publishes `@libpg-query/parser` with tag `pg17`
- Currently based on PostgreSQL 17
- Includes full parser with all features

### Install published package
```bash
npm install @libpg-query/parser@pg17 # PostgreSQL 17 specific
npm install @libpg-query/parser # Latest version
npm install libpg-query@pg18 # full API
npm install libpg-query@pg17 # parse only
```

## Parser Package (@pgsql/parser)
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,10 @@ This repository contains multiple packages to support different PostgreSQL versi

| Package | Description | PostgreSQL Versions | npm Package |
|---------|-------------|---------------------|-------------|
| **[libpg-query](https://github.com/constructive-io/libpg-query-node/tree/main/versions)** | Lightweight parser (parse only) | 13, 14, 15, 16, 17, 18 | [`libpg-query`](https://www.npmjs.com/package/libpg-query) |
| **[libpg-query](https://github.com/constructive-io/libpg-query-node/tree/main/versions)** | PostgreSQL parser (full API on PG 18+, parse-only on 13–17) | 13, 14, 15, 16, 17, 18 | [`libpg-query`](https://www.npmjs.com/package/libpg-query) |
| **[@pgsql/parser](https://github.com/constructive-io/libpg-query-node/tree/main/parser)** | Multi-version parser (runtime selection) | 15, 16, 17, 18 | [`@pgsql/parser`](https://www.npmjs.com/package/@pgsql/parser) |
| **[@pgsql/types](https://github.com/constructive-io/libpg-query-node/tree/main/types)** | TypeScript type definitions | 13, 14, 15, 16, 17, 18 | [`@pgsql/types`](https://www.npmjs.com/package/@pgsql/types) |
| **[@pgsql/enums](https://github.com/constructive-io/libpg-query-node/tree/main/enums)** | TypeScript enum definitions | 13, 14, 15, 16, 17, 18 | [`@pgsql/enums`](https://www.npmjs.com/package/@pgsql/enums) |
| **[@libpg-query/parser](https://github.com/constructive-io/libpg-query-node/tree/main/full)** | Full parser with all features | 17 only | [`@libpg-query/parser`](https://www.npmjs.com/package/@libpg-query/parser) |

### Version Tags

Expand All @@ -99,10 +98,10 @@ npm install @pgsql/enums

### Which Package Should I Use?

- **Just need to parse SQL?** → Use `libpg-query` (lightweight, all PG versions)
- **Just need to parse SQL?** → Use `libpg-query` (all PG versions)
- **Need multiple versions at runtime?** → Use `@pgsql/parser` (dynamic version selection)
- **Need TypeScript types?** → Add `@pgsql/types` and/or `@pgsql/enums`
- **Need fingerprint, normalize, scan, or PL/pgSQL parsing?** → Use `@libpg-query/parser` (PG 18)
- **Need fingerprint, normalize, scan, or PL/pgSQL parsing?** → Use `libpg-query@pg18` — the full API ships on PG 18+ (13–17 remain parse-only)


## API Documentation
Expand All @@ -113,7 +112,6 @@ For detailed API documentation and usage examples, see the package-specific READ
- **@pgsql/parser** - [Multi-Version Parser Documentation](https://github.com/constructive-io/libpg-query-node/tree/main/parser)
- **@pgsql/types** - [Types Documentation](https://github.com/constructive-io/libpg-query-node/tree/main/types/18)
- **@pgsql/enums** - [Enums Documentation](https://github.com/constructive-io/libpg-query-node/tree/main/enums/18)
- **@libpg-query/parser** - [Full Parser Documentation](https://github.com/constructive-io/libpg-query-node/tree/main/full)

## Build Instructions

Expand Down
8 changes: 8 additions & 0 deletions REPO_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

There is a templates/ dir to solve some of this.

Versions with `x-publish.fullApi: true` (currently 18) are generated from the
full-API templates in `templates/full/` and export the full API
(parse, parsePlPgSQL, scan, fingerprint, normalize + sync variants);
the other versions use the slim (parse-only) templates.
⚠️ Note: the Makefiles for 15/17/18 have been hand-edited to point at
constructive-io/libpg_query branches; `copy:templates` regenerates Makefiles
with the pganalyze repo URL, so re-apply the repo override if you regenerate.

## Code Duplication 📋

### 1. Identical Test Files
Expand Down
18 changes: 0 additions & 18 deletions full/.npmignore

This file was deleted.

38 changes: 0 additions & 38 deletions full/CHANGELOG.md

This file was deleted.

96 changes: 0 additions & 96 deletions full/Makefile

This file was deleted.

Loading
Loading