|
15 | 15 | <a href="https://github.com/launchql/libpg-query-node/actions/workflows/ci.yml"><img height="20" src="https://img.shields.io/badge/Linux-available-333333?logo=linux&logoColor=white" /></a> |
16 | 16 | </p> |
17 | 17 |
|
18 | | -The real PostgreSQL parser for Node.js, powered by **WebAssembly (WASM)** for true cross-platform compatibility. |
| 18 | +# The Real PostgreSQL Parser for JavaScript |
19 | 19 |
|
20 | | -A WASM-based PostgreSQL query parser that provides the same functionality as the native PostgreSQL parser without requiring native compilation or platform-specific binaries. Primarily used for the node.js parser and deparser [pgsql-parser](https://github.com/pyramation/pgsql-parser). |
| 20 | +### Bring the power of PostgreSQL’s native parser to your JavaScript projects — no native builds, no platform headaches. |
21 | 21 |
|
| 22 | +This is the official PostgreSQL parser, compiled to WebAssembly (WASM) for seamless, cross-platform compatibility. Use it in Node.js or the browser, on Linux, Windows, or anywhere JavaScript runs. |
22 | 23 |
|
23 | | -## Table of Contents |
| 24 | +Built to power [pgsql-parser](https://github.com/pyramation/pgsql-parser), this library delivers full fidelity with the Postgres C codebase — no rewrites, no shortcuts. |
24 | 25 |
|
25 | | -1. [Installation](#installation) |
26 | | -2. [Usage](#usage) |
27 | | -3. [Build Instructions](#build-instructions) |
28 | | -4. [Testing](#testing) |
29 | | -5. [Versions](#versions) |
30 | | -6. [Related Projects](#related-projects) |
31 | | -7. [Credit](#credit) |
| 26 | +### Features |
32 | 27 |
|
| 28 | +* 🔧 **Powered by PostgreSQL** – Uses the official Postgres C parser compiled to WebAssembly |
| 29 | +* 🖥️ **Cross-Platform** – Runs smoothly on macOS, Linux, and Windows |
| 30 | +* 🌐 **Node.js & Browser Support** – Consistent behavior in any JS environment |
| 31 | +* 📦 **No Native Builds Required** – No compilation, no system-specific dependencies |
| 32 | +* 🧠 **Spec-Accurate Parsing** – Produces faithful, standards-compliant ASTs |
| 33 | +* 🚀 **Production-Grade** – Powers tools like [`pgsql-parser`](https://github.com/pyramation/pgsql-parser) |
33 | 34 |
|
34 | 35 | ## Installation |
35 | 36 |
|
@@ -322,13 +323,13 @@ pnpm run test |
322 | 323 | Our latest is built with `17-latest` branch from libpg_query |
323 | 324 |
|
324 | 325 |
|
325 | | -| PG Major Version | libpg_query | Branch | npm |
326 | | -|--------------------------|-------------|------------------------------------------------------------------------------------------------|---------| |
327 | | -| 17 | 17- latest | [`17-latest`](https://github.com/launchql/libpg-query-node/tree/17-latest) | [`[email protected]`](https://www.npmjs.com/package/libpg-query/v/latest) |
328 | | -| 16 | 16- latest | [`16-latest`](https://github.com/launchql/libpg-query-node/tree/16-latest) | [`[email protected]`](https://www.npmjs.com/package/libpg-query/v/16.2.0) |
329 | | -| 15 | 15- latest | [`15-latest`](https://github.com/launchql/libpg-query-node/tree/15-latest) | [`[email protected]`](https://www.npmjs.com/package/libpg-query/v/15.1.0) |
330 | | -| 14 | 14- latest | [`14-latest`](https://github.com/launchql/libpg-query-node/tree/14-latest) | [`[email protected]`](https://www.npmjs.com/package/libpg-query/v/14.0.0) |
331 | | -| 13 | 13- latest | [`13-latest`](https://github.com/launchql/libpg-query-node/tree/13-latest) | [`[email protected]`](https://www.npmjs.com/package/libpg-query/v/13.3.1) |
| 326 | +| PG Major Version | libpg_query | npm dist-tag |
| 327 | +|--------------------------|-------------|---------| |
| 328 | +| 17 | 17-6.1.0 | [`pg17`](https://www.npmjs.com/package/libpg-query/v/latest) |
| 329 | +| 16 | 16-5.2.0 | [`pg16`](https://www.npmjs.com/package/libpg-query/v/pg16) |
| 330 | +| 15 | 15-4.2.4 | [`pg15`](https://www.npmjs.com/package/libpg-query/v/pg15) |
| 331 | +| 14 | 14-3.0.0 | [`pg14`](https://www.npmjs.com/package/libpg-query/v/pg14) |
| 332 | +| 13 | 13-2.2.0 | [`pg13`](https://www.npmjs.com/package/libpg-query/v/pg13) |
332 | 333 | | 12 | (n/a) | | |
333 | 334 | | 11 | (n/a) | | |
334 | 335 | | 10 | 10-latest | | `@1.3.1` ([tree](https://github.com/pyramation/pgsql-parser/tree/39b7b1adc8914253226e286a48105785219a81ca)) | |
@@ -367,10 +368,25 @@ The build process generates these files: |
367 | 368 |
|
368 | 369 | ## Credit |
369 | 370 |
|
370 | | -This is based on the output of [libpg_query](https://github.com/pganalyze/libpg_query). This wraps the static library output and links it into a node module for use in js. |
| 371 | +* This is based on the output of [libpg_query](https://github.com/pganalyze/libpg_query). This wraps the static library output and links it into a node module for use in js. |
371 | 372 |
|
372 | | -All credit for the hard problems goes to [Lukas Fittl](https://github.com/lfittl). |
| 373 | +* All credit for the hard problems goes to [Lukas Fittl](https://github.com/lfittl). |
373 | 374 |
|
374 | | -Additional thanks for the original Node.js integration work by [Ethan Resnick](https://github.com/ethanresnick). |
| 375 | +* Additional thanks for the original Node.js integration work by [Ethan Resnick](https://github.com/ethanresnick). |
375 | 376 |
|
376 | | -Original [Code](https://github.com/zhm/node-pg-query-native) and [License](https://github.com/zhm/node-pg-query-native/blob/master/LICENSE.md) |
| 377 | +* Original [Code](https://github.com/zhm/node-pg-query-native) and [License](https://github.com/zhm/node-pg-query-native/blob/master/LICENSE.md) |
| 378 | + |
| 379 | +## Related |
| 380 | + |
| 381 | +* [pgsql-parser](https://github.com/launchql/pgsql-parser): The real PostgreSQL parser for Node.js, providing symmetric parsing and deparsing of SQL statements with actual PostgreSQL parser integration. |
| 382 | +* [pgsql-deparser](https://github.com/launchql/pgsql-parser/tree/main/packages/deparser): A streamlined tool designed for converting PostgreSQL ASTs back into SQL queries, focusing solely on deparser functionality to complement `pgsql-parser`. |
| 383 | +* [@pgsql/types](https://github.com/launchql/pgsql-parser/tree/main/packages/types): Offers TypeScript type definitions for PostgreSQL AST nodes, facilitating type-safe construction, analysis, and manipulation of ASTs. |
| 384 | +* [@pgsql/utils](https://github.com/launchql/pgsql-parser/tree/main/packages/utils): A comprehensive utility library for PostgreSQL, offering type-safe AST node creation and enum value conversions, simplifying the construction and manipulation of PostgreSQL ASTs. |
| 385 | +* [pg-proto-parser](https://github.com/launchql/pg-proto-parser): A TypeScript tool that parses PostgreSQL Protocol Buffers definitions to generate TypeScript interfaces, utility functions, and JSON mappings for enums. |
| 386 | +* [libpg-query](https://github.com/launchql/libpg-query-node): The real PostgreSQL parser exposed for Node.js, used primarily in `pgsql-parser` for parsing and deparsing SQL queries. |
| 387 | + |
| 388 | +## Disclaimer |
| 389 | + |
| 390 | +AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED “AS IS”, AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. |
| 391 | + |
| 392 | +No developer or entity involved in creating Software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the Software code or Software CLI, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value. |
0 commit comments