internal/

directory
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2026 License: MIT

Directories

Path Synopsis
Ported from postgres_deparse.c (libpg_query 18.0.0).
Ported from postgres_deparse.c (libpg_query 18.0.0).
Package emit renders parse trees as JSON with byte-parity to libpg_query's hand-rolled C emitter (pg_query_outfuncs_json.c + pg_query_json_helper.c at the pinned 18.0.0).
Package emit renders parse trees as JSON with byte-parity to libpg_query's hand-rolled C emitter (pg_query_outfuncs_json.c + pg_query_json_helper.c at the pinned 18.0.0).
Package fingerprint computes libpg_query's version-3 query fingerprints (pg_query_fingerprint.c + the generated pg_query_fingerprint_defs.c / pg_query_fingerprint_conds.c at the pinned 18.0.0).
Package fingerprint computes libpg_query's version-3 query fingerprints (pg_query_fingerprint.c + the generated pg_query_fingerprint_defs.c / pg_query_fingerprint_conds.c at the pinned 18.0.0).
Package lexer is a hand-written port of PostgreSQL's scanner as patched and pinned by libpg_query 18.0.0 (internal/reference/scan.l), plus the base_yylex token-merge filter from internal/reference/parser.c.
Package lexer is a hand-written port of PostgreSQL's scanner as patched and pinned by libpg_query 18.0.0 (internal/reference/scan.l), plus the base_yylex token-merge filter from internal/reference/parser.c.
Package normalize ports pg_query_normalize.c at the pinned 18.0.0: constants in the query text are replaced with $n parameter references, numbered in tree-walk order after the highest existing $n.
Package normalize ports pg_query_normalize.c at the pinned 18.0.0: constants in the query text are replaced with $n parameter references, numbered in tree-walk order after the highest existing $n.
Package parse is the hand-written recursive-descent port of the pinned grammar (internal/reference/gram.y, libpg_query 18.0.0).
Package parse is the hand-written recursive-descent port of the pinned grammar (internal/reference/gram.y, libpg_query 18.0.0).
Package plpgsql is the hand-written port of libpg_query's PL/pgSQL support as pinned at 18.0.0: pl_gram.y + pl_scanner.c (patched, see internal/reference/), the pl_comp.c / pl_funcs.c subset libpg_query extracts (including its mocks — parse_datatype and friends do not consult the catalogs), pg_query_json_plpgsql.c, and the pg_query_parse_plpgsql.c driver behind ParsePlPgSqlToJSON.
Package plpgsql is the hand-written port of libpg_query's PL/pgSQL support as pinned at 18.0.0: pl_gram.y + pl_scanner.c (patched, see internal/reference/), the pl_comp.c / pl_funcs.c subset libpg_query extracts (including its mocks — parse_datatype and friends do not consult the catalogs), pg_query_json_plpgsql.c, and the pg_query_parse_plpgsql.c driver behind ParsePlPgSqlToJSON.
Package rawwalk is raw_expression_tree_walker (src/backend/nodes/ nodeFuncs.c, PostgreSQL 18) over the protobuf tree, gated exactly as pg_query_raw_tree_walker_supports allows: node types outside the walker's switch return false without descending.
Package rawwalk is raw_expression_tree_walker (src/backend/nodes/ nodeFuncs.c, PostgreSQL 18) over the protobuf tree, gated exactly as pg_query_raw_tree_walker_supports allows: node types outside the walker's switch return false without descending.
pg_qsort (src/port/qsort.c via lib/sort_template.h): the Bentley & McIlroy quicksort PostgreSQL uses — list_sort() maps to it at the pin (port.h defines qsort as pg_qsort).
pg_qsort (src/port/qsort.c via lib/sort_template.h): the Bentley & McIlroy quicksort PostgreSQL uses — list_sort() maps to it at the pin (port.h defines qsort as pg_qsort).
Package testfile reads and writes the consolidated corpus format shared by the sqlc parser family: cases separated by `== <name>` lines, input and expectation separated by a `--` line, with a metadata.json sidecar per file tracking which cases are still todo.
Package testfile reads and writes the consolidated corpus format shared by the sqlc parser family: cases separated by `== <name>` lines, input and expectation separated by a `--` line, with a metadata.json sidecar per file tracking which cases are still todo.
Package xxh3 is an in-house, pure Go implementation of the XXH3 hash function's 64-bit variant (XXH3_64bits_withSeed), ported from the xxHash reference implementation vendored by libpg_query (xxhash.h, v0.8.x, BSD-2-Clause, (c) Yann Collet).
Package xxh3 is an in-house, pure Go implementation of the XXH3 hash function's 64-bit variant (XXH3_64bits_withSeed), ported from the xxHash reference implementation vendored by libpg_query (xxhash.h, v0.8.x, BSD-2-Clause, (c) Yann Collet).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL