A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/launchql/libpg-query-node below:

launchql/libpg-query-node: 🐘 libpg_query PG port for node.js


The Real PostgreSQL Parser for JavaScript Bring the power of PostgreSQL's native parser to your JavaScript projects — no native builds, no platform headaches.

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.

Built to power pgsql-parser, this library delivers full fidelity with the Postgres C codebase — no rewrites, no shortcuts.

🚀 For Round-trip Codegen

🎯 Want to parse + deparse (full round trip)?
We highly recommend using pgsql-parser which leverages a pure TypeScript deparser that has been battle-tested against 23,000+ SQL statements and is built on top of libpg-query.

🔀 Multi-Version Support with @pgsql/parser

Need to support multiple PostgreSQL versions at runtime?
Use @pgsql/parser for dynamic version selection — parse SQL with PostgreSQL 15, 16, or 17 in a single package!

import { parse } from '@pgsql/parser';

// Parse with specific PostgreSQL version
const result15 = await parse('SELECT * FROM users', 15);
const result17 = await parse('SELECT * FROM users', 17);
import { parse } from 'libpg-query';

const result = await parse('SELECT * FROM users WHERE active = true');
// {"version":170004,"stmts":[{"stmt":{"SelectStmt":{"targetList":[{"ResTarget" ... "op":"SETOP_NONE"}}}]}

This repository contains multiple packages to support different PostgreSQL versions and use cases:

Available Packages & Versions Package Description PostgreSQL Versions npm Package libpg-query Lightweight parser (parse only) 13, 14, 15, 16, 17 libpg-query @pgsql/parser Multi-version parser (runtime selection) 15, 16, 17 @pgsql/parser @pgsql/types TypeScript type definitions 13, 14, 15, 16, 17 @pgsql/types @pgsql/enums TypeScript enum definitions 13, 14, 15, 16, 17 @pgsql/enums @libpg-query/parser Full parser with all features 17 only @libpg-query/parser

Each versioned package uses npm dist-tags for PostgreSQL version selection:

# Install specific PostgreSQL version
npm install libpg-query@pg17      # PostgreSQL 17 (latest)
npm install libpg-query@pg16      # PostgreSQL 16
npm install @pgsql/types@pg17     # Types for PostgreSQL 17
npm install @pgsql/enums@pg15     # Enums for PostgreSQL 15

# Install latest (defaults to pg17)
npm install libpg-query
npm install @pgsql/types
npm install @pgsql/enums
Which Package Should I Use?

For detailed API documentation and usage examples, see the package-specific READMEs:

This package uses a WASM-only build system for true cross-platform compatibility without native compilation dependencies.

  1. Install dependencies:

  2. Build WASM artifacts:

  3. Clean WASM build (if needed):

  4. Rebuild WASM artifacts from scratch:

    pnpm run clean && pnpm run build

The WASM build process:

"fetch failed" errors during tests:

"WASM module not initialized" errors:

Build environment issues:

To avoid duplication across PostgreSQL versions, common files are maintained in the templates/ directory:

To update version-specific files from templates:

This ensures consistency while allowing version-specific customizations (e.g., patches for version 13).

The build process generates these files:

Built on the excellent work of several contributors:

AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.

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.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4