diff --git a/.github/workflows/build-wasm-no-docker.yaml b/.github/workflows/build-wasm-no-docker.yaml
index c4e6f3bb..98e64496 100644
--- a/.github/workflows/build-wasm-no-docker.yaml
+++ b/.github/workflows/build-wasm-no-docker.yaml
@@ -2,7 +2,7 @@ name: Build Wasm No Docker π
'on':
workflow_dispatch: null
jobs:
- build-wasm:
+ build-wasm-no-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository π₯
diff --git a/.github/workflows/build-wasm.yml b/.github/workflows/build-wasm.yml
index 60958f83..a32db7cb 100644
--- a/.github/workflows/build-wasm.yml
+++ b/.github/workflows/build-wasm.yml
@@ -5,7 +5,7 @@ on:
jobs:
build-wasm:
- runs-on: ubuntu-latest
+ runs-on: macos-latest
steps:
- name: Checkout Repository π₯
uses: actions/checkout@v4
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f75df528..b61e3740 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -9,8 +9,18 @@ on:
jobs:
build-wasm:
- name: Build WASM π§
+ name: Build WASM ${{ matrix.package }} π§
runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ package:
+ - { name: 'libpg-query', path: 'libpg-query', version: '17' }
+ - { name: 'v13', path: 'versions/13', version: '13' }
+ - { name: 'v14', path: 'versions/14', version: '14' }
+ - { name: 'v15', path: 'versions/15', version: '15' }
+ - { name: 'v16', path: 'versions/16', version: '16' }
+ - { name: 'v17', path: 'versions/17', version: '17' }
+ fail-fast: false
steps:
- name: Checkout Repository π₯
uses: actions/checkout@v4
@@ -23,7 +33,7 @@ jobs:
- name: Setup pnpm π¦
uses: pnpm/action-setup@v2
with:
- version: 8.15.0
+ version: 8.15.1
- name: Get pnpm store directory π
shell: bash
@@ -42,22 +52,38 @@ jobs:
run: pnpm install
- name: Build WASM π
- run: pnpm run build
- working-directory: libpg-query
+ run: |
+ if [ "${{ matrix.package.name }}" = "v13" ]; then
+ # Download prebuilt WASM for v13 since it can't build in CI
+ mkdir -p wasm
+ curl -o v13.tgz "https://registry.npmjs.org/@libpg-query/v13/-/v13-13.0.0.tgz"
+ tar -xzf v13.tgz --strip-components=1 package/wasm
+ rm v13.tgz
+ else
+ pnpm run build
+ fi
+ working-directory: ${{ matrix.package.path }}
- name: Upload WASM Artifacts π¦
uses: actions/upload-artifact@v4
with:
- name: wasm-artifacts
- path: libpg-query/wasm/
+ name: wasm-artifacts-${{ matrix.package.name }}
+ path: ${{ matrix.package.path }}/wasm/
retention-days: 1
test:
- name: Test on ${{ matrix.os }} ${{ matrix.os == 'ubuntu-latest' && 'π§' || matrix.os == 'macos-latest' && 'π' || 'πͺ' }}
+ name: Test ${{ matrix.package.name }} on ${{ matrix.os }} ${{ matrix.os == 'ubuntu-latest' && 'π§' || matrix.os == 'macos-latest' && 'π' || 'πͺ' }}
needs: build-wasm
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
+ package:
+ - { name: 'libpg-query', path: 'libpg-query', version: '17' }
+ - { name: 'v13', path: 'versions/13', version: '13' }
+ - { name: 'v14', path: 'versions/14', version: '14' }
+ - { name: 'v15', path: 'versions/15', version: '15' }
+ - { name: 'v16', path: 'versions/16', version: '16' }
+ - { name: 'v17', path: 'versions/17', version: '17' }
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
@@ -72,7 +98,7 @@ jobs:
- name: Setup pnpm π¦
uses: pnpm/action-setup@v2
with:
- version: 8.15.0
+ version: 8.15.1
- name: Get pnpm store directory π
shell: bash
@@ -93,8 +119,9 @@ jobs:
- name: Download WASM Artifacts π₯
uses: actions/download-artifact@v4
with:
- name: wasm-artifacts
- path: libpg-query/wasm/
+ name: wasm-artifacts-${{ matrix.package.name }}
+ path: ${{ matrix.package.path }}/wasm/
- name: Run Tests π
run: pnpm run test
+ working-directory: ${{ matrix.package.path }}
diff --git a/.gitignore b/.gitignore
index e112f514..de4837c3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,14 +1,27 @@
+# Dependencies
node_modules/
+.pnpm-store/
+
+# Build artifacts
build/
libs/
-npm-debug.log
-libpg_query/**/*.proto
-wasm/libpg-query.js
-*.wasm
-.cache
esm/
cjs/
-.claude
+dist/
-# pnpm
-.pnpm-store/
+# WASM build outputs
+wasm/
+versions/*/wasm/
+*.wasm
+wasm/libpg-query.js
+
+# Build cache and temporary files
+.cache
+
+# Generated files
+libpg_query/**/*.proto
+
+# Development tools and logs
+npm-debug.log
+.claude
+.openhands/
diff --git a/.npmrc b/.npmrc
new file mode 100644
index 00000000..107103a4
--- /dev/null
+++ b/.npmrc
@@ -0,0 +1,31 @@
+# PNPM workspace optimization settings
+
+# Use hard links to save disk space (when possible)
+node-linker=hoisted
+
+# Strict peer dependency resolution
+strict-peer-dependencies=true
+
+# Auto-install peers (useful for workspace packages)
+auto-install-peers=true
+
+# Save exact versions in package.json
+save-exact=true
+
+# Use workspace protocol for local dependencies
+link-workspace-packages=true
+
+# Prefer workspace packages over registry
+prefer-workspace-packages=true
+
+# Hoist pattern for shared dependencies
+# This helps reduce duplication
+public-hoist-pattern[]=*types*
+public-hoist-pattern[]=*eslint*
+public-hoist-pattern[]=*prettier*
+
+# Shamefully hoist these common dev dependencies
+shamefully-hoist=false
+
+# Enable workspace protocol
+enable-pre-post-scripts=true
\ No newline at end of file
diff --git a/BUILD_SIZE_REPORT.md b/BUILD_SIZE_REPORT.md
new file mode 100644
index 00000000..2d42636f
--- /dev/null
+++ b/BUILD_SIZE_REPORT.md
@@ -0,0 +1,53 @@
+# Build Size Analysis Report
+
+Generated on: 2025-06-22T06:22:35.227Z
+
+## Summary
+
+| Package | Total Size | Total Gzipped | Reduction |
+|---------|------------|---------------|-----------|
+| libpg-query (Original) | 2.07 MB | 428.77 KB | Baseline |
+| @libpg-query/v17 | 2.05 MB | 427.95 KB | 0.7% |
+
+## Detailed Breakdown
+
+### libpg-query (Original)
+
+| File | Size | Gzipped | Gzip Ratio |
+|------|------|---------|------------|
+| WASM Binary | 1.99 MB | 409.96 KB | 79.9% |
+| WASM Loader | 58.66 KB | 16.24 KB | 72.3% |
+| ES Module | 9.48 KB | 1.07 KB | 88.8% |
+| CommonJS | 10.75 KB | 1.5 KB | 86.1% |
+
+### @libpg-query/v17
+
+| File | Size | Gzipped | Gzip Ratio |
+|------|------|---------|------------|
+| WASM Binary | 1.99 MB | 409.96 KB | 79.9% |
+| WASM Loader | 58.66 KB | 16.24 KB | 72.3% |
+| ES Module | 2.29 KB | 694 Bytes | 70.4% |
+| CommonJS | 3.29 KB | 1.06 KB | 67.7% |
+
+## Size Comparison
+
+### WASM Binary Comparison
+
+| Package | WASM Size | Difference |
+|---------|-----------|------------|
+| libpg-query (Original) | 1.99 MB | Baseline |
+| @libpg-query/v17 | 1.99 MB | 0.0 KB (0.0%) |
+
+### JavaScript Bundle Comparison
+
+| Package | ES Module | CommonJS | Combined |
+|---------|-----------|----------|----------|
+| libpg-query (Original) | 9.48 KB | 10.75 KB | 20.23 KB |
+| @libpg-query/v17 | 2.29 KB | 3.29 KB | 5.57 KB |
+
+## Notes
+
+- Gzipped sizes represent the approximate size when served with compression
+- The WASM binary is the largest component and is shared across all API methods
+- JavaScript wrapper size varies based on the number of exported functions
+- @libpg-query/v17 only exports parse/parseSync, reducing JavaScript bundle size
diff --git a/PUBLISH.md b/PUBLISH.md
new file mode 100644
index 00000000..05b7acae
--- /dev/null
+++ b/PUBLISH.md
@@ -0,0 +1,59 @@
+# Publishing Guide
+
+## Types Packages
+
+```bash
+# Set the version (e.g. 17, 16, 15, etc.)
+VERSION=17
+
+cd types/${VERSION}
+pnpm version patch
+git add . && git commit -m "release: bump @pgsql/types${VERSION} version"
+pnpm build
+pnpm prepare:types
+pnpm publish --tag pg${VERSION}
+```
+
+Promote to latest (optional)
+
+```bash
+# Set the version (e.g. 17, 16, 15, etc.)
+VERSION=17
+
+# Promote pg${VERSION} tag to latest
+npm dist-tag add @pgsql/types@pg${VERSION} latest
+```
+
+### What it does
+- Transforms `@libpg-query/types17` β `@pgsql/types` with tag `pg17`
+- Transforms `@libpg-query/types16` β `@pgsql/types` with tag `pg16`
+- etc.
+
+## Version Packages
+
+### Quick Publish
+```bash
+# Set the version (e.g. 17, 16, 15, etc.)
+VERSION=17
+
+# Build and publish a specific version
+cd versions/${VERSION}
+pnpm version patch
+git add . && git commit -m "release: bump libpg-query${VERSION} version"
+pnpm build
+pnpm test
+pnpm run publish:pkg
+```
+
+### What it does
+- Transforms `@libpg-query/v17` β `libpg-query` with tag `pg17`
+- Transforms `@libpg-query/v16` β `libpg-query` with tag `pg16`
+- Uses `x-publish.publishName` and `x-publish.distTag` from package.json
+- Temporarily modifies package.json during publish, then restores it
+
+### Install published packages
+```bash
+npm install libpg-query@pg17 # PostgreSQL 17 specific
+npm install libpg-query@pg16 # PostgreSQL 16 specific
+npm install libpg-query # Latest/default version
+```
\ No newline at end of file
diff --git a/README.md b/README.md
index f027b1b1..d056ca44 100644
--- a/README.md
+++ b/README.md
@@ -15,21 +15,22 @@
-The real PostgreSQL parser for Node.js, powered by **WebAssembly (WASM)** for true cross-platform compatibility.
+# The Real PostgreSQL Parser for JavaScript
-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).
+### 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.
-## Table of Contents
+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.
-1. [Installation](#installation)
-2. [Usage](#usage)
-3. [Build Instructions](#build-instructions)
-4. [Testing](#testing)
-5. [Versions](#versions)
-6. [Related Projects](#related-projects)
-7. [Credit](#credit)
+### Features
+* π§ **Powered by PostgreSQL** β Uses the official Postgres C parser compiled to WebAssembly
+* π₯οΈ **Cross-Platform** β Runs smoothly on macOS, Linux, and Windows
+* π **Node.js & Browser Support** β Consistent behavior in any JS environment
+* π¦ **No Native Builds Required** β No compilation, no system-specific dependencies
+* π§ **Spec-Accurate Parsing** β Produces faithful, standards-compliant ASTs
+* π **Production-Grade** β Powers tools like [`pgsql-parser`](https://github.com/pyramation/pgsql-parser)
## Installation
@@ -322,13 +323,13 @@ pnpm run test
Our latest is built with `17-latest` branch from libpg_query
-| PG Major Version | libpg_query | Branch | npm
-|--------------------------|-------------|------------------------------------------------------------------------------------------------|---------|
-| 17 | 17-latest | [`17-latest`](https://github.com/launchql/libpg-query-node/tree/17-latest) | [`libpg-query@17.2.0`](https://www.npmjs.com/package/libpg-query/v/latest)
-| 16 | 16-latest | [`16-latest`](https://github.com/launchql/libpg-query-node/tree/16-latest) | [`libpg-query@16.2.0`](https://www.npmjs.com/package/libpg-query/v/16.2.0)
-| 15 | 15-latest | [`15-latest`](https://github.com/launchql/libpg-query-node/tree/15-latest) | [`libpg-query@15.1.0`](https://www.npmjs.com/package/libpg-query/v/15.1.0)
-| 14 | 14-latest | [`14-latest`](https://github.com/launchql/libpg-query-node/tree/14-latest) | [`libpg-query@14.0.0`](https://www.npmjs.com/package/libpg-query/v/14.0.0)
-| 13 | 13-latest | [`13-latest`](https://github.com/launchql/libpg-query-node/tree/13-latest) | [`libpg-query@13.3.1`](https://www.npmjs.com/package/libpg-query/v/13.3.1)
+| PG Major Version | libpg_query | npm dist-tag
+|--------------------------|-------------|---------|
+| 17 | 17-6.1.0 | [`pg17`](https://www.npmjs.com/package/libpg-query/v/latest)
+| 16 | 16-5.2.0 | [`pg16`](https://www.npmjs.com/package/libpg-query/v/pg16)
+| 15 | 15-4.2.4 | [`pg15`](https://www.npmjs.com/package/libpg-query/v/pg15)
+| 14 | 14-3.0.0 | [`pg14`](https://www.npmjs.com/package/libpg-query/v/pg14)
+| 13 | 13-2.2.0 | [`pg13`](https://www.npmjs.com/package/libpg-query/v/pg13)
| 12 | (n/a) | |
| 11 | (n/a) | |
| 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:
## Credit
-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.
+* 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.
-All credit for the hard problems goes to [Lukas Fittl](https://github.com/lfittl).
+* All credit for the hard problems goes to [Lukas Fittl](https://github.com/lfittl).
-Additional thanks for the original Node.js integration work by [Ethan Resnick](https://github.com/ethanresnick).
+* Additional thanks for the original Node.js integration work by [Ethan Resnick](https://github.com/ethanresnick).
-Original [Code](https://github.com/zhm/node-pg-query-native) and [License](https://github.com/zhm/node-pg-query-native/blob/master/LICENSE.md)
+* Original [Code](https://github.com/zhm/node-pg-query-native) and [License](https://github.com/zhm/node-pg-query-native/blob/master/LICENSE.md)
+
+## Related
+
+* [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.
+* [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`.
+* [@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.
+* [@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.
+* [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.
+* [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.
+
+## Disclaimer
+
+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.
\ No newline at end of file
diff --git a/libpg-query/Makefile b/libpg-query/Makefile
index c00f4373..cd5229b7 100644
--- a/libpg-query/Makefile
+++ b/libpg-query/Makefile
@@ -50,6 +50,7 @@ $(LIBPG_QUERY_ARCHIVE): $(LIBPG_QUERY_DIR)
# Build libpg-query-node WASM module
$(OUT_FILES): $(LIBPG_QUERY_ARCHIVE) $(LIBPG_QUERY_HEADER) $(SRC_FILES)
ifdef EMSCRIPTEN
+ mkdir -p $(WASM_OUT_DIR)
$(CC) \
-v \
$(CXXFLAGS) \
diff --git a/libpg-query/README.md b/libpg-query/README.md
index fe08e1ea..64edce30 100644
--- a/libpg-query/README.md
+++ b/libpg-query/README.md
@@ -15,21 +15,22 @@
-The real PostgreSQL parser for Node.js, powered by **WebAssembly (WASM)** for true cross-platform compatibility.
+# The Real PostgreSQL Parser for JavaScript
-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).
+### 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.
-## Table of Contents
+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.
-1. [Installation](#installation)
-2. [Usage](#usage)
-3. [Build Instructions](#build-instructions)
-4. [Testing](#testing)
-5. [Versions](#versions)
-6. [Related Projects](#related-projects)
-7. [Credit](#credit)
+### Features
+* π§ **Powered by PostgreSQL** β Uses the official Postgres C parser compiled to WebAssembly
+* π₯οΈ **Cross-Platform** β Runs smoothly on macOS, Linux, and Windows
+* π **Node.js & Browser Support** β Consistent behavior in any JS environment
+* π¦ **No Native Builds Required** β No compilation, no system-specific dependencies
+* π§ **Spec-Accurate Parsing** β Produces faithful, standards-compliant ASTs
+* π **Production-Grade** β Powers tools like [`pgsql-parser`](https://github.com/pyramation/pgsql-parser)
## Installation
@@ -267,27 +268,28 @@ This package uses a **WASM-only build system** for true cross-platform compatibi
### Prerequisites
- Node.js (version 16 or higher recommended)
+- [pnpm](https://pnpm.io/) (v8+ recommended)
### Building WASM Artifacts
1. **Install dependencies:**
```bash
- npm install
+ pnpm install
```
2. **Build WASM artifacts:**
```bash
- npm run wasm:build
+ pnpm run build
```
3. **Clean WASM build (if needed):**
```bash
- npm run wasm:clean
+ pnpm run clean
```
4. **Rebuild WASM artifacts from scratch:**
```bash
- npm run wasm:clean && npm run wasm:build
+ pnpm run clean && pnpm run build
```
### Build Process Details
@@ -303,7 +305,7 @@ The WASM build process:
### Running Tests
```bash
-npm test
+pnpm run test
```
### Test Requirements
@@ -311,7 +313,7 @@ npm test
- WASM artifacts must be built before running tests
- If tests fail with "fetch failed" errors, rebuild WASM artifacts:
```bash
- npm run wasm:clean && npm run wasm:build && npm test
+ pnpm run clean && pnpm run build && pnpm run test
```
@@ -339,7 +341,7 @@ Our latest is built with `17-latest` branch from libpg_query
**"fetch failed" errors during tests:**
- This indicates stale or missing WASM artifacts
-- Solution: `npm run wasm:clean && npm run wasm:build`
+- Solution: `pnpm run clean && pnpm run build`
**"WASM module not initialized" errors:**
- Ensure you call an async method first to initialize the WASM module
diff --git a/libpg-query/package.json b/libpg-query/package.json
index c6d442e5..fc33fc11 100644
--- a/libpg-query/package.json
+++ b/libpg-query/package.json
@@ -22,7 +22,7 @@
"wasm:rebuild": "pnpm wasm:make rebuild",
"wasm:clean": "pnpm wasm:make clean",
"wasm:clean-cache": "pnpm wasm:make clean-cache",
- "test": "mocha test/*.test.js --timeout 5000",
+ "test": "node --test test/parsing.test.js test/deparsing.test.js test/fingerprint.test.js test/normalize.test.js test/plpgsql.test.js test/scan.test.js",
"yamlize": "node ./scripts/yamlize.js",
"protogen": "node ./scripts/protogen.js"
},
@@ -34,14 +34,10 @@
},
"devDependencies": {
"@launchql/proto-cli": "1.25.0",
- "@yamlize/cli": "^0.8.0",
- "chai": "^3.5.0",
- "mocha": "^11.7.0",
- "rimraf": "5.0.0",
- "typescript": "^5.3.3"
+ "@yamlize/cli": "^0.8.0"
},
"dependencies": {
- "@pgsql/types": "^17.0.0",
+ "@pgsql/types": "^17.4.2",
"@launchql/protobufjs": "7.2.6"
},
"keywords": [
diff --git a/libpg-query/scripts/build.js b/libpg-query/scripts/build.js
index 271c4648..55d83240 100644
--- a/libpg-query/scripts/build.js
+++ b/libpg-query/scripts/build.js
@@ -12,6 +12,11 @@ const wasmDir = path.join(__dirname, '../wasm');
const cjsDir = path.join(__dirname, '../cjs');
const esmDir = path.join(__dirname, '../esm');
+// Ensure wasm directory exists
+if (!fs.existsSync(wasmDir)) {
+ fs.mkdirSync(wasmDir, { recursive: true });
+}
+
// Rename CommonJS files
fs.renameSync(
path.join(cjsDir, 'index.js'),
diff --git a/libpg-query/test/deparsing.test.js b/libpg-query/test/deparsing.test.js
index 321de72b..f1407873 100644
--- a/libpg-query/test/deparsing.test.js
+++ b/libpg-query/test/deparsing.test.js
@@ -1,5 +1,6 @@
const query = require("../");
-const { expect } = require("chai");
+const { describe, it, before, after, beforeEach, afterEach } = require('node:test');
+const assert = require('node:assert/strict');
describe("Query Deparsing", () => {
before(async () => {
@@ -11,18 +12,18 @@ describe("Query Deparsing", () => {
const sql = 'SELECT * FROM users';
const parseTree = query.parseSync(sql);
const deparsed = query.deparseSync(parseTree);
- expect(deparsed).to.equal(sql);
+ assert.equal(deparsed, sql);
});
it("should deparse a complex query", () => {
const sql = 'SELECT a, b, c FROM t1 JOIN t2 ON t1.id = t2.id WHERE t1.x > 10';
const parseTree = query.parseSync(sql);
const deparsed = query.deparseSync(parseTree);
- expect(deparsed).to.equal(sql);
+ assert.equal(deparsed, sql);
});
it("should fail to deparse without protobuf data", () => {
- expect(() => query.deparseSync({})).to.throw('No parseTree provided');
+ assert.throws(() => query.deparseSync({}), /No parseTree provided/);
});
});
@@ -31,7 +32,7 @@ describe("Query Deparsing", () => {
const sql = 'SELECT * FROM users';
const parseTree = await query.parse(sql);
const deparsed = await query.deparse(parseTree);
- expect(deparsed).to.equal(sql);
+ assert.equal(deparsed, sql);
});
it("should reject when no protobuf data", async () => {
@@ -39,7 +40,7 @@ describe("Query Deparsing", () => {
await query.deparse({});
throw new Error('should have rejected');
} catch (err) {
- expect(err.message).to.equal('No parseTree provided');
+ assert.equal(err.message, 'No parseTree provided');
}
});
});
@@ -49,7 +50,7 @@ describe("Query Deparsing", () => {
const sql = 'SELECT a, b, c FROM t1 JOIN t2 ON t1.id = t2.id WHERE t1.x > 10';
const parseTree = await query.parse(sql);
const deparsed = await query.deparse(parseTree);
- expect(deparsed).to.equal(sql);
+ assert.equal(deparsed, sql);
});
});
@@ -57,13 +58,13 @@ describe("Query Deparsing", () => {
const sql = 'SELECT * FROM users';
const parseTree = await query.parse(sql);
const deparsed = await query.deparse(parseTree);
- expect(deparsed).to.equal(sql);
+ assert.equal(deparsed, sql);
});
it('should throw on invalid parse tree', () => {
try {
query.deparseSync({});
} catch (err) { }
- expect(() => query.deparseSync({})).to.throw('No parseTree provided');
+ assert.throws(() => query.deparseSync({}), /No parseTree provided/);
});
});
diff --git a/libpg-query/test/fingerprint.test.js b/libpg-query/test/fingerprint.test.js
index 70d2f47d..07171c82 100644
--- a/libpg-query/test/fingerprint.test.js
+++ b/libpg-query/test/fingerprint.test.js
@@ -1,5 +1,6 @@
const query = require("../");
-const { expect } = require("chai");
+const { describe, it, before, after, beforeEach, afterEach } = require('node:test');
+const assert = require('node:assert/strict');
describe("Query Fingerprinting", () => {
before(async () => {
@@ -9,8 +10,8 @@ describe("Query Fingerprinting", () => {
describe("Sync Fingerprinting", () => {
it("should return a fingerprint for a simple query", () => {
const fingerprint = query.fingerprintSync("select 1");
- expect(fingerprint).to.be.a("string");
- expect(fingerprint).to.have.lengthOf(16);
+ assert.equal(typeof fingerprint, "string");
+ assert.equal(fingerprint.length, 16);
});
it("should return same fingerprint for equivalent queries", () => {
@@ -18,26 +19,26 @@ describe("Query Fingerprinting", () => {
const fp2 = query.fingerprintSync("SELECT 1");
const fp3 = query.fingerprintSync("select 1");
- expect(fp1).to.eq(fp2);
- expect(fp1).to.eq(fp3);
+ assert.equal(fp1, fp2);
+ assert.equal(fp1, fp3);
});
it("should return different fingerprints for different queries", () => {
const fp1 = query.fingerprintSync("select name from users");
const fp2 = query.fingerprintSync("select id from customers");
- expect(fp1).to.not.eq(fp2);
+ assert.notEqual(fp1, fp2);
});
it("should normalize parameter values", () => {
const fp1 = query.fingerprintSync("select * from users where id = 123");
const fp2 = query.fingerprintSync("select * from users where id = 456");
- expect(fp1).to.eq(fp2);
+ assert.equal(fp1, fp2);
});
it("should fail on invalid queries", () => {
- expect(() => query.fingerprintSync("NOT A QUERY")).to.throw(Error);
+ assert.throws(() => query.fingerprintSync("NOT A QUERY"), Error);
});
});
@@ -47,8 +48,8 @@ describe("Query Fingerprinting", () => {
const fpPromise = query.fingerprint(testQuery);
const fp = await fpPromise;
- expect(fpPromise).to.be.instanceof(Promise);
- expect(fp).to.eq(query.fingerprintSync(testQuery));
+ assert.ok(fpPromise instanceof Promise);
+ assert.equal(fp, query.fingerprintSync(testQuery));
});
it("should reject on bogus queries", async () => {
@@ -57,8 +58,8 @@ describe("Query Fingerprinting", () => {
throw new Error("should have rejected");
},
(e) => {
- expect(e).instanceof(Error);
- expect(e.message).to.match(/NOT/);
+ assert.ok(e instanceof Error);
+ assert.match(e.message, /NOT/);
}
);
});
diff --git a/libpg-query/test/normalize.test.js b/libpg-query/test/normalize.test.js
index a93a572c..14f0a431 100644
--- a/libpg-query/test/normalize.test.js
+++ b/libpg-query/test/normalize.test.js
@@ -1,5 +1,6 @@
const query = require("../");
-const { expect } = require("chai");
+const { describe, it, before, after, beforeEach, afterEach } = require('node:test');
+const assert = require('node:assert/strict');
describe("Query Normalization", () => {
before(async () => {
@@ -9,37 +10,37 @@ describe("Query Normalization", () => {
describe("Sync Normalization", () => {
it("should normalize a simple query", () => {
const normalized = query.normalizeSync("select 1");
- expect(normalized).to.be.a("string");
- expect(normalized).to.include("$1");
+ assert.equal(typeof normalized, "string");
+ assert.ok(normalized.includes("$1"));
});
it("should normalize parameter values", () => {
const normalized1 = query.normalizeSync("select * from users where id = 123");
const normalized2 = query.normalizeSync("select * from users where id = 456");
- expect(normalized1).to.eq(normalized2);
- expect(normalized1).to.include("$1");
+ assert.equal(normalized1, normalized2);
+ assert.ok(normalized1.includes("$1"));
});
it("should normalize string literals", () => {
const normalized1 = query.normalizeSync("select * from users where name = 'john'");
const normalized2 = query.normalizeSync("select * from users where name = 'jane'");
- expect(normalized1).to.eq(normalized2);
- expect(normalized1).to.include("$1");
+ assert.equal(normalized1, normalized2);
+ assert.ok(normalized1.includes("$1"));
});
it("should preserve query structure", () => {
const normalized = query.normalizeSync("SELECT id, name FROM users WHERE active = true ORDER BY name");
- expect(normalized).to.include("SELECT");
- expect(normalized).to.include("FROM");
- expect(normalized).to.include("WHERE");
- expect(normalized).to.include("ORDER BY");
+ assert.ok(normalized.includes("SELECT"));
+ assert.ok(normalized.includes("FROM"));
+ assert.ok(normalized.includes("WHERE"));
+ assert.ok(normalized.includes("ORDER BY"));
});
it("should fail on invalid queries", () => {
- expect(() => query.normalizeSync("NOT A QUERY")).to.throw(Error);
+ assert.throws(() => query.normalizeSync("NOT A QUERY"), Error);
});
});
@@ -49,8 +50,8 @@ describe("Query Normalization", () => {
const normalizedPromise = query.normalize(testQuery);
const normalized = await normalizedPromise;
- expect(normalizedPromise).to.be.instanceof(Promise);
- expect(normalized).to.eq(query.normalizeSync(testQuery));
+ assert.ok(normalizedPromise instanceof Promise);
+ assert.equal(normalized, query.normalizeSync(testQuery));
});
it("should reject on bogus queries", async () => {
@@ -59,8 +60,8 @@ describe("Query Normalization", () => {
throw new Error("should have rejected");
},
(e) => {
- expect(e).instanceof(Error);
- expect(e.message).to.match(/NOT/);
+ assert.ok(e instanceof Error);
+ assert.match(e.message, /NOT/);
}
);
});
diff --git a/libpg-query/test/parsing.test.js b/libpg-query/test/parsing.test.js
index 25e1fd3d..5477c6a0 100644
--- a/libpg-query/test/parsing.test.js
+++ b/libpg-query/test/parsing.test.js
@@ -1,5 +1,6 @@
const query = require("../");
-const { expect } = require("chai");
+const { describe, it, before, after, beforeEach, afterEach } = require('node:test');
+const assert = require('node:assert/strict');
function removeLocationProperties(obj) {
if (typeof obj !== 'object' || obj === null) {
@@ -32,29 +33,29 @@ describe("Query Parsing", () => {
const queries = ["select 1", "select null", "select ''", "select a, b"];
const results = queries.map(query.parseSync);
results.forEach((res) => {
- expect(res.stmts).to.have.lengthOf(1);
+ assert.equal(res.stmts.length, 1);
});
const selectedDatas = results.map(
(it) => it.stmts[0].stmt.SelectStmt.targetList
);
- expect(selectedDatas[0][0].ResTarget.val.A_Const.ival.ival).to.eq(1);
- expect(selectedDatas[1][0].ResTarget.val.A_Const.isnull).to.eq(true);
- expect(selectedDatas[2][0].ResTarget.val.A_Const.sval.sval).to.eq("");
- expect(selectedDatas[3]).to.have.lengthOf(2);
+ assert.equal(selectedDatas[0][0].ResTarget.val.A_Const.ival.ival, 1);
+ assert.equal(selectedDatas[1][0].ResTarget.val.A_Const.isnull, true);
+ assert.equal(selectedDatas[2][0].ResTarget.val.A_Const.sval.sval, "");
+ assert.equal(selectedDatas[3].length, 2);
});
it("should support parsing multiple queries", () => {
const res = query.parseSync("select 1; select null;");
- expect(res.stmts.map(removeLocationProperties)).to.deep.eq([
+ assert.deepEqual(res.stmts.map(removeLocationProperties), [
...query.parseSync("select 1;").stmts.map(removeLocationProperties),
...query.parseSync("select null;").stmts.map(removeLocationProperties),
]);
});
it("should not parse a bogus query", () => {
- expect(() => query.parseSync("NOT A QUERY")).to.throw(Error);
+ assert.throws(() => query.parseSync("NOT A QUERY"), Error);
});
});
@@ -64,8 +65,8 @@ describe("Query Parsing", () => {
const resPromise = query.parse(testQuery);
const res = await resPromise;
- expect(resPromise).to.be.instanceof(Promise);
- expect(res).to.deep.eq(query.parseSync(testQuery));
+ assert.ok(resPromise instanceof Promise);
+ assert.deepEqual(res, query.parseSync(testQuery));
});
it("should reject on bogus queries", async () => {
@@ -74,8 +75,8 @@ describe("Query Parsing", () => {
throw new Error("should have rejected");
},
(e) => {
- expect(e).instanceof(Error);
- expect(e.message).to.match(/NOT/);
+ assert.ok(e instanceof Error);
+ assert.match(e.message, /NOT/);
}
);
});
diff --git a/libpg-query/test/plpgsql.test.js b/libpg-query/test/plpgsql.test.js
index c89d3a24..e3235c83 100644
--- a/libpg-query/test/plpgsql.test.js
+++ b/libpg-query/test/plpgsql.test.js
@@ -1,5 +1,6 @@
const query = require("../");
-const { expect } = require("chai");
+const { describe, it, before, after, beforeEach, afterEach } = require('node:test');
+const assert = require('node:assert/strict');
describe("PL/pgSQL Parsing", () => {
before(async () => {
@@ -18,8 +19,8 @@ describe("PL/pgSQL Parsing", () => {
`;
const result = query.parsePlPgSQLSync(funcSql);
- expect(result).to.be.an("object");
- expect(result.plpgsql_funcs).to.be.an("array");
+ assert.equal(typeof result, "object");
+ assert.ok(Array.isArray(result.plpgsql_funcs));
});
it("should parse function with parameters", () => {
@@ -33,11 +34,11 @@ describe("PL/pgSQL Parsing", () => {
`;
const result = query.parsePlPgSQLSync(funcSql);
- expect(result.plpgsql_funcs).to.have.length.greaterThan(0);
+ assert.ok(result.plpgsql_funcs.length > 0);
});
it("should fail on invalid PL/pgSQL", () => {
- expect(() => query.parsePlPgSQLSync("NOT A FUNCTION")).to.throw(Error);
+ assert.throws(() => query.parsePlPgSQLSync("NOT A FUNCTION"), Error);
});
});
@@ -55,8 +56,8 @@ describe("PL/pgSQL Parsing", () => {
const resultPromise = query.parsePlPgSQL(funcSql);
const result = await resultPromise;
- expect(resultPromise).to.be.instanceof(Promise);
- expect(result).to.deep.eq(query.parsePlPgSQLSync(funcSql));
+ assert.ok(resultPromise instanceof Promise);
+ assert.deepEqual(result, query.parsePlPgSQLSync(funcSql));
});
it("should reject on invalid PL/pgSQL", async () => {
@@ -65,8 +66,8 @@ describe("PL/pgSQL Parsing", () => {
throw new Error("should have rejected");
},
(e) => {
- expect(e).instanceof(Error);
- expect(e.message).to.match(/NOT/);
+ assert.ok(e instanceof Error);
+ assert.match(e.message, /NOT/);
}
);
});
diff --git a/libpg-query/test/scan.test.js b/libpg-query/test/scan.test.js
index f693290f..7f86b95b 100644
--- a/libpg-query/test/scan.test.js
+++ b/libpg-query/test/scan.test.js
@@ -1,5 +1,6 @@
const query = require("../");
-const { expect } = require("chai");
+const { describe, it, before, after, beforeEach, afterEach } = require('node:test');
+const assert = require('node:assert/strict');
describe("Query Scanning", () => {
before(async () => {
@@ -10,45 +11,45 @@ describe("Query Scanning", () => {
it("should return a scan result with version and tokens", () => {
const result = query.scanSync("SELECT 1");
- expect(result).to.be.an("object");
- expect(result).to.have.property("version");
- expect(result).to.have.property("tokens");
- expect(result.version).to.be.a("number");
- expect(result.tokens).to.be.an("array");
+ assert.equal(typeof result, "object");
+ assert.ok("version" in result);
+ assert.ok("tokens" in result);
+ assert.equal(typeof result.version, "number");
+ assert.ok(Array.isArray(result.tokens));
});
it("should scan a simple SELECT query correctly", () => {
const result = query.scanSync("SELECT 1");
- expect(result.tokens).to.have.lengthOf(2);
+ assert.equal(result.tokens.length, 2);
// First token should be SELECT
const selectToken = result.tokens[0];
- expect(selectToken.text).to.eq("SELECT");
- expect(selectToken.start).to.eq(0);
- expect(selectToken.end).to.eq(6);
- expect(selectToken.tokenName).to.eq("UNKNOWN"); // SELECT is mapped as UNKNOWN in our simplified mapping
- expect(selectToken.keywordName).to.eq("RESERVED_KEYWORD");
+ assert.equal(selectToken.text, "SELECT");
+ assert.equal(selectToken.start, 0);
+ assert.equal(selectToken.end, 6);
+ assert.equal(selectToken.tokenName, "UNKNOWN"); // SELECT is mapped as UNKNOWN in our simplified mapping
+ assert.equal(selectToken.keywordName, "RESERVED_KEYWORD");
// Second token should be 1
const numberToken = result.tokens[1];
- expect(numberToken.text).to.eq("1");
- expect(numberToken.start).to.eq(7);
- expect(numberToken.end).to.eq(8);
- expect(numberToken.tokenName).to.eq("ICONST");
- expect(numberToken.keywordName).to.eq("NO_KEYWORD");
+ assert.equal(numberToken.text, "1");
+ assert.equal(numberToken.start, 7);
+ assert.equal(numberToken.end, 8);
+ assert.equal(numberToken.tokenName, "ICONST");
+ assert.equal(numberToken.keywordName, "NO_KEYWORD");
});
it("should scan tokens with correct positions", () => {
const sql = "SELECT * FROM users";
const result = query.scanSync(sql);
- expect(result.tokens).to.have.lengthOf(4);
+ assert.equal(result.tokens.length, 4);
// Verify each token position matches the original SQL
result.tokens.forEach(token => {
const actualText = sql.substring(token.start, token.end);
- expect(token.text).to.eq(actualText);
+ assert.equal(token.text, actualText);
});
});
@@ -56,12 +57,12 @@ describe("Query Scanning", () => {
const result = query.scanSync("SELECT 'string', 123, 3.14, $1 FROM users");
const tokenTypes = result.tokens.map(t => t.tokenName);
- expect(tokenTypes).to.include("SCONST"); // String constant
- expect(tokenTypes).to.include("ICONST"); // Integer constant
- expect(tokenTypes).to.include("FCONST"); // Float constant
- expect(tokenTypes).to.include("PARAM"); // Parameter marker
+ assert.ok(tokenTypes.includes("SCONST")); // String constant
+ assert.ok(tokenTypes.includes("ICONST")); // Integer constant
+ assert.ok(tokenTypes.includes("FCONST")); // Float constant
+ assert.ok(tokenTypes.includes("PARAM")); // Parameter marker
// Note: keywords like FROM may be tokenized as UNKNOWN in our simplified mapping
- expect(tokenTypes).to.include("UNKNOWN"); // Keywords and identifiers
+ assert.ok(tokenTypes.includes("UNKNOWN")); // Keywords and identifiers
});
it("should identify operators and punctuation", () => {
@@ -71,9 +72,9 @@ describe("Query Scanning", () => {
t.tokenName.startsWith("ASCII_") || t.text === "="
);
- expect(operators).to.have.length.greaterThan(0);
- expect(operators.some(t => t.text === "*")).to.be.true;
- expect(operators.some(t => t.text === "=")).to.be.true;
+ assert.ok(operators.length > 0);
+ assert.equal(operators.some(t => t.text === "*"), true);
+ assert.equal(operators.some(t => t.text === "="), true);
});
it("should classify keyword types correctly", () => {
@@ -86,68 +87,68 @@ describe("Query Scanning", () => {
t.keywordName === "UNRESERVED_KEYWORD"
);
- expect(reservedKeywords.length).to.be.greaterThan(0);
+ assert.ok(reservedKeywords.length > 0);
// SELECT, FROM, WHERE should be reserved keywords
- expect(reservedKeywords.some(t => t.text === "SELECT")).to.be.true;
- expect(reservedKeywords.some(t => t.text === "FROM")).to.be.true;
- expect(reservedKeywords.some(t => t.text === "WHERE")).to.be.true;
+ assert.equal(reservedKeywords.some(t => t.text === "SELECT"), true);
+ assert.equal(reservedKeywords.some(t => t.text === "FROM"), true);
+ assert.equal(reservedKeywords.some(t => t.text === "WHERE"), true);
});
it("should handle complex queries with parameters", () => {
const result = query.scanSync("SELECT * FROM users WHERE id = $1 AND name = $2");
const params = result.tokens.filter(t => t.tokenName === "PARAM");
- expect(params).to.have.lengthOf(2);
- expect(params[0].text).to.eq("$1");
- expect(params[1].text).to.eq("$2");
+ assert.equal(params.length, 2);
+ assert.equal(params[0].text, "$1");
+ assert.equal(params[1].text, "$2");
});
it("should handle string escaping in JSON output", () => {
const result = query.scanSync("SELECT 'text with \"quotes\" and \\backslash'");
const stringToken = result.tokens.find(t => t.tokenName === "SCONST");
- expect(stringToken).to.exist;
- expect(stringToken.text).to.include('"');
- expect(stringToken.text).to.include('\\');
+ assert.ok(stringToken);
+ assert.ok(stringToken.text.includes('"'));
+ assert.ok(stringToken.text.includes('\\'));
});
it("should scan INSERT statements", () => {
const result = query.scanSync("INSERT INTO table VALUES (1, 'text', 3.14)");
- expect(result.tokens.some(t => t.text === "INSERT")).to.be.true;
- expect(result.tokens.some(t => t.text === "INTO")).to.be.true;
- expect(result.tokens.some(t => t.text === "VALUES")).to.be.true;
- expect(result.tokens.some(t => t.tokenName === "ICONST")).to.be.true;
- expect(result.tokens.some(t => t.tokenName === "SCONST")).to.be.true;
- expect(result.tokens.some(t => t.tokenName === "FCONST")).to.be.true;
+ assert.equal(result.tokens.some(t => t.text === "INSERT"), true);
+ assert.equal(result.tokens.some(t => t.text === "INTO"), true);
+ assert.equal(result.tokens.some(t => t.text === "VALUES"), true);
+ assert.equal(result.tokens.some(t => t.tokenName === "ICONST"), true);
+ assert.equal(result.tokens.some(t => t.tokenName === "SCONST"), true);
+ assert.equal(result.tokens.some(t => t.tokenName === "FCONST"), true);
});
it("should scan UPDATE statements", () => {
const result = query.scanSync("UPDATE users SET name = 'John' WHERE id = 1");
- expect(result.tokens.some(t => t.text === "UPDATE")).to.be.true;
- expect(result.tokens.some(t => t.text === "SET")).to.be.true;
- expect(result.tokens.some(t => t.text === "=")).to.be.true;
+ assert.equal(result.tokens.some(t => t.text === "UPDATE"), true);
+ assert.equal(result.tokens.some(t => t.text === "SET"), true);
+ assert.equal(result.tokens.some(t => t.text === "="), true);
});
it("should scan DELETE statements", () => {
const result = query.scanSync("DELETE FROM users WHERE active = false");
- expect(result.tokens.some(t => t.text === "DELETE")).to.be.true;
- expect(result.tokens.some(t => t.text === "FROM")).to.be.true;
- expect(result.tokens.some(t => t.text === "WHERE")).to.be.true;
+ assert.equal(result.tokens.some(t => t.text === "DELETE"), true);
+ assert.equal(result.tokens.some(t => t.text === "FROM"), true);
+ assert.equal(result.tokens.some(t => t.text === "WHERE"), true);
});
it("should handle empty or whitespace-only input", () => {
const result = query.scanSync(" ");
- expect(result.tokens).to.have.lengthOf(0);
+ assert.equal(result.tokens.length, 0);
});
it("should handle unusual input gracefully", () => {
// The scanner is more permissive than the parser and may tokenize unusual input
const result = query.scanSync("$$$INVALID$$$");
- expect(result).to.be.an("object");
- expect(result.tokens).to.be.an("array");
+ assert.equal(typeof result, "object");
+ assert.ok(Array.isArray(result.tokens));
// Scanner may still produce tokens even for unusual input
});
@@ -157,7 +158,7 @@ describe("Query Scanning", () => {
// Tokens should be in order of appearance
for (let i = 1; i < result.tokens.length; i++) {
- expect(result.tokens[i].start).to.be.at.least(result.tokens[i-1].end);
+ assert.ok(result.tokens[i].start >= result.tokens[i-1].end);
}
});
});
@@ -168,24 +169,24 @@ describe("Query Scanning", () => {
const resultPromise = query.scan(testQuery);
const result = await resultPromise;
- expect(resultPromise).to.be.instanceof(Promise);
- expect(result).to.deep.eq(query.scanSync(testQuery));
+ assert.ok(resultPromise instanceof Promise);
+ assert.deepEqual(result, query.scanSync(testQuery));
});
it("should handle complex queries asynchronously", async () => {
const testQuery = "SELECT COUNT(*) as total FROM orders WHERE status = 'completed' AND created_at > '2023-01-01'";
const result = await query.scan(testQuery);
- expect(result).to.be.an("object");
- expect(result.tokens).to.be.an("array");
- expect(result.tokens.length).to.be.greaterThan(10);
+ assert.equal(typeof result, "object");
+ assert.ok(Array.isArray(result.tokens));
+ assert.ok(result.tokens.length > 10);
});
it("should handle unusual input asynchronously", async () => {
// Scanner is more permissive than parser
const result = await query.scan("$$$INVALID$$$");
- expect(result).to.be.an("object");
- expect(result.tokens).to.be.an("array");
+ assert.equal(typeof result, "object");
+ assert.ok(Array.isArray(result.tokens));
});
});
@@ -194,9 +195,9 @@ describe("Query Scanning", () => {
const result = query.scanSync("SELECT 1 -- this is a comment");
// Should have at least SELECT and 1 tokens
- expect(result.tokens.length).to.be.at.least(2);
- expect(result.tokens.some(t => t.text === "SELECT")).to.be.true;
- expect(result.tokens.some(t => t.text === "1")).to.be.true;
+ assert.ok(result.tokens.length >= 2);
+ assert.equal(result.tokens.some(t => t.text === "SELECT"), true);
+ assert.equal(result.tokens.some(t => t.text === "1"), true);
});
it("should handle very long identifiers", () => {
@@ -204,25 +205,25 @@ describe("Query Scanning", () => {
const result = query.scanSync(`SELECT ${longIdentifier} FROM table`);
const identToken = result.tokens.find(t => t.text === longIdentifier);
- expect(identToken).to.exist;
- expect(identToken.tokenName).to.eq("IDENT");
+ assert.ok(identToken);
+ assert.equal(identToken.tokenName, "IDENT");
});
it("should handle special PostgreSQL operators", () => {
const result = query.scanSync("SELECT id::text FROM users");
- expect(result.tokens.some(t => t.text === "::")).to.be.true;
+ assert.equal(result.tokens.some(t => t.text === "::"), true);
const typecastToken = result.tokens.find(t => t.text === "::");
- expect(typecastToken?.tokenName).to.eq("TYPECAST");
+ assert.equal(typecastToken?.tokenName, "TYPECAST");
});
it("should provide consistent version information", () => {
const result1 = query.scanSync("SELECT 1");
const result2 = query.scanSync("INSERT INTO table VALUES (1)");
- expect(result1.version).to.eq(result2.version);
- expect(result1.version).to.be.a("number");
- expect(result1.version).to.be.greaterThan(0);
+ assert.equal(result1.version, result2.version);
+ assert.equal(typeof result1.version, "number");
+ assert.ok(result1.version > 0);
});
});
});
\ No newline at end of file
diff --git a/libpg-query/wasm/index.cjs b/libpg-query/wasm/index.cjs
deleted file mode 100644
index 7cc9bffa..00000000
--- a/libpg-query/wasm/index.cjs
+++ /dev/null
@@ -1,321 +0,0 @@
-"use strict";
-var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- var desc = Object.getOwnPropertyDescriptor(m, k);
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
- desc = { enumerable: true, get: function() { return m[k]; } };
- }
- Object.defineProperty(o, k2, desc);
-}) : (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- o[k2] = m[k];
-}));
-var __exportStar = (this && this.__exportStar) || function(m, exports) {
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
-};
-var __importDefault = (this && this.__importDefault) || function (mod) {
- return (mod && mod.__esModule) ? mod : { "default": mod };
-};
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.scan = exports.normalize = exports.fingerprint = exports.parsePlPgSQL = exports.deparse = exports.parse = void 0;
-exports.loadModule = loadModule;
-exports.parseSync = parseSync;
-exports.deparseSync = deparseSync;
-exports.parsePlPgSQLSync = parsePlPgSQLSync;
-exports.fingerprintSync = fingerprintSync;
-exports.normalizeSync = normalizeSync;
-exports.scanSync = scanSync;
-__exportStar(require("@pgsql/types"), exports);
-// @ts-ignore
-const libpg_query_js_1 = __importDefault(require("./libpg-query.js"));
-// @ts-ignore
-const proto_js_1 = require("../proto.js");
-let wasmModule;
-const initPromise = (0, libpg_query_js_1.default)().then((module) => {
- wasmModule = module;
-});
-function ensureLoaded() {
- if (!wasmModule)
- throw new Error("WASM module not initialized. Call `loadModule()` first.");
-}
-async function loadModule() {
- if (!wasmModule) {
- await initPromise;
- }
-}
-function awaitInit(fn) {
- return (async (...args) => {
- await initPromise;
- return fn(...args);
- });
-}
-function stringToPtr(str) {
- ensureLoaded();
- if (typeof str !== 'string') {
- throw new TypeError(`Expected a string, got ${typeof str}`);
- }
- const len = wasmModule.lengthBytesUTF8(str) + 1;
- const ptr = wasmModule._malloc(len);
- try {
- wasmModule.stringToUTF8(str, ptr, len);
- return ptr;
- }
- catch (error) {
- wasmModule._free(ptr);
- throw error;
- }
-}
-function ptrToString(ptr) {
- ensureLoaded();
- if (typeof ptr !== 'number') {
- throw new TypeError(`Expected a number, got ${typeof ptr}`);
- }
- return wasmModule.UTF8ToString(ptr);
-}
-exports.parse = awaitInit(async (query) => {
- const queryPtr = stringToPtr(query);
- let resultPtr = 0;
- try {
- resultPtr = wasmModule._wasm_parse_query(queryPtr);
- const resultStr = ptrToString(resultPtr);
- if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
- throw new Error(resultStr);
- }
- return JSON.parse(resultStr);
- }
- finally {
- wasmModule._free(queryPtr);
- if (resultPtr) {
- wasmModule._wasm_free_string(resultPtr);
- }
- }
-});
-exports.deparse = awaitInit(async (parseTree) => {
- if (!parseTree || typeof parseTree !== 'object' || !Array.isArray(parseTree.stmts) || parseTree.stmts.length === 0) {
- throw new Error('No parseTree provided');
- }
- const msg = proto_js_1.pg_query.ParseResult.fromObject(parseTree);
- const data = proto_js_1.pg_query.ParseResult.encode(msg).finish();
- const dataPtr = wasmModule._malloc(data.length);
- let resultPtr = 0;
- try {
- wasmModule.HEAPU8.set(data, dataPtr);
- resultPtr = wasmModule._wasm_deparse_protobuf(dataPtr, data.length);
- const resultStr = ptrToString(resultPtr);
- if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
- throw new Error(resultStr);
- }
- return resultStr;
- }
- finally {
- wasmModule._free(dataPtr);
- if (resultPtr) {
- wasmModule._wasm_free_string(resultPtr);
- }
- }
-});
-exports.parsePlPgSQL = awaitInit(async (query) => {
- const queryPtr = stringToPtr(query);
- let resultPtr = 0;
- try {
- resultPtr = wasmModule._wasm_parse_plpgsql(queryPtr);
- const resultStr = ptrToString(resultPtr);
- if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
- throw new Error(resultStr);
- }
- return JSON.parse(resultStr);
- }
- finally {
- wasmModule._free(queryPtr);
- if (resultPtr) {
- wasmModule._wasm_free_string(resultPtr);
- }
- }
-});
-exports.fingerprint = awaitInit(async (query) => {
- const queryPtr = stringToPtr(query);
- let resultPtr = 0;
- try {
- resultPtr = wasmModule._wasm_fingerprint(queryPtr);
- const resultStr = ptrToString(resultPtr);
- if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
- throw new Error(resultStr);
- }
- return resultStr;
- }
- finally {
- wasmModule._free(queryPtr);
- if (resultPtr) {
- wasmModule._wasm_free_string(resultPtr);
- }
- }
-});
-exports.normalize = awaitInit(async (query) => {
- const queryPtr = stringToPtr(query);
- let resultPtr = 0;
- try {
- resultPtr = wasmModule._wasm_normalize_query(queryPtr);
- const resultStr = ptrToString(resultPtr);
- if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
- throw new Error(resultStr);
- }
- return resultStr;
- }
- finally {
- wasmModule._free(queryPtr);
- if (resultPtr) {
- wasmModule._wasm_free_string(resultPtr);
- }
- }
-});
-// Sync versions
-function parseSync(query) {
- if (!wasmModule) {
- throw new Error('WASM module not initialized. Call loadModule() first.');
- }
- const queryPtr = stringToPtr(query);
- let resultPtr = 0;
- try {
- resultPtr = wasmModule._wasm_parse_query(queryPtr);
- const resultStr = ptrToString(resultPtr);
- if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
- throw new Error(resultStr);
- }
- return JSON.parse(resultStr);
- }
- finally {
- wasmModule._free(queryPtr);
- if (resultPtr) {
- wasmModule._wasm_free_string(resultPtr);
- }
- }
-}
-function deparseSync(parseTree) {
- if (!wasmModule) {
- throw new Error('WASM module not initialized. Call loadModule() first.');
- }
- if (!parseTree || typeof parseTree !== 'object' || !Array.isArray(parseTree.stmts) || parseTree.stmts.length === 0) {
- throw new Error('No parseTree provided');
- }
- const msg = proto_js_1.pg_query.ParseResult.fromObject(parseTree);
- const data = proto_js_1.pg_query.ParseResult.encode(msg).finish();
- const dataPtr = wasmModule._malloc(data.length);
- let resultPtr = 0;
- try {
- wasmModule.HEAPU8.set(data, dataPtr);
- resultPtr = wasmModule._wasm_deparse_protobuf(dataPtr, data.length);
- const resultStr = ptrToString(resultPtr);
- if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
- throw new Error(resultStr);
- }
- return resultStr;
- }
- finally {
- wasmModule._free(dataPtr);
- if (resultPtr) {
- wasmModule._wasm_free_string(resultPtr);
- }
- }
-}
-function parsePlPgSQLSync(query) {
- if (!wasmModule) {
- throw new Error('WASM module not initialized. Call loadModule() first.');
- }
- const queryPtr = stringToPtr(query);
- let resultPtr = 0;
- try {
- resultPtr = wasmModule._wasm_parse_plpgsql(queryPtr);
- const resultStr = ptrToString(resultPtr);
- if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
- throw new Error(resultStr);
- }
- return JSON.parse(resultStr);
- }
- finally {
- wasmModule._free(queryPtr);
- if (resultPtr) {
- wasmModule._wasm_free_string(resultPtr);
- }
- }
-}
-function fingerprintSync(query) {
- if (!wasmModule) {
- throw new Error('WASM module not initialized. Call loadModule() first.');
- }
- const queryPtr = stringToPtr(query);
- let resultPtr = 0;
- try {
- resultPtr = wasmModule._wasm_fingerprint(queryPtr);
- const resultStr = ptrToString(resultPtr);
- if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
- throw new Error(resultStr);
- }
- return resultStr;
- }
- finally {
- wasmModule._free(queryPtr);
- if (resultPtr) {
- wasmModule._wasm_free_string(resultPtr);
- }
- }
-}
-function normalizeSync(query) {
- if (!wasmModule) {
- throw new Error('WASM module not initialized. Call loadModule() first.');
- }
- const queryPtr = stringToPtr(query);
- let resultPtr = 0;
- try {
- resultPtr = wasmModule._wasm_normalize_query(queryPtr);
- const resultStr = ptrToString(resultPtr);
- if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
- throw new Error(resultStr);
- }
- return resultStr;
- }
- finally {
- wasmModule._free(queryPtr);
- if (resultPtr) {
- wasmModule._wasm_free_string(resultPtr);
- }
- }
-}
-exports.scan = awaitInit(async (query) => {
- const queryPtr = stringToPtr(query);
- let resultPtr = 0;
- try {
- resultPtr = wasmModule._wasm_scan(queryPtr);
- const resultStr = ptrToString(resultPtr);
- if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
- throw new Error(resultStr);
- }
- return JSON.parse(resultStr);
- }
- finally {
- wasmModule._free(queryPtr);
- if (resultPtr) {
- wasmModule._wasm_free_string(resultPtr);
- }
- }
-});
-function scanSync(query) {
- if (!wasmModule) {
- throw new Error('WASM module not initialized. Call loadModule() first.');
- }
- const queryPtr = stringToPtr(query);
- let resultPtr = 0;
- try {
- resultPtr = wasmModule._wasm_scan(queryPtr);
- const resultStr = ptrToString(resultPtr);
- if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
- throw new Error(resultStr);
- }
- return JSON.parse(resultStr);
- }
- finally {
- wasmModule._free(queryPtr);
- if (resultPtr) {
- wasmModule._wasm_free_string(resultPtr);
- }
- }
-}
diff --git a/libpg-query/wasm/index.d.ts b/libpg-query/wasm/index.d.ts
deleted file mode 100644
index 22b11125..00000000
--- a/libpg-query/wasm/index.d.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import { ParseResult } from "@pgsql/types";
-export * from "@pgsql/types";
-export interface ScanToken {
- start: number;
- end: number;
- text: string;
- tokenType: number;
- tokenName: string;
- keywordKind: number;
- keywordName: string;
-}
-export interface ScanResult {
- version: number;
- tokens: ScanToken[];
-}
-export declare function loadModule(): Promise;
-export declare const parse: (query: string) => Promise;
-export declare const deparse: (parseTree: ParseResult) => Promise;
-export declare const parsePlPgSQL: (query: string) => Promise;
-export declare const fingerprint: (query: string) => Promise;
-export declare const normalize: (query: string) => Promise;
-export declare function parseSync(query: string): ParseResult;
-export declare function deparseSync(parseTree: ParseResult): string;
-export declare function parsePlPgSQLSync(query: string): ParseResult;
-export declare function fingerprintSync(query: string): string;
-export declare function normalizeSync(query: string): string;
-export declare const scan: (query: string) => Promise;
-export declare function scanSync(query: string): ScanResult;
diff --git a/libpg-query/wasm/index.js b/libpg-query/wasm/index.js
deleted file mode 100644
index 1fc6191d..00000000
--- a/libpg-query/wasm/index.js
+++ /dev/null
@@ -1,294 +0,0 @@
-export * from "@pgsql/types";
-// @ts-ignore
-import PgQueryModule from './libpg-query.js';
-// @ts-ignore
-import { pg_query } from '../proto.js';
-let wasmModule;
-const initPromise = PgQueryModule().then((module) => {
- wasmModule = module;
-});
-function ensureLoaded() {
- if (!wasmModule)
- throw new Error("WASM module not initialized. Call `loadModule()` first.");
-}
-export async function loadModule() {
- if (!wasmModule) {
- await initPromise;
- }
-}
-function awaitInit(fn) {
- return (async (...args) => {
- await initPromise;
- return fn(...args);
- });
-}
-function stringToPtr(str) {
- ensureLoaded();
- if (typeof str !== 'string') {
- throw new TypeError(`Expected a string, got ${typeof str}`);
- }
- const len = wasmModule.lengthBytesUTF8(str) + 1;
- const ptr = wasmModule._malloc(len);
- try {
- wasmModule.stringToUTF8(str, ptr, len);
- return ptr;
- }
- catch (error) {
- wasmModule._free(ptr);
- throw error;
- }
-}
-function ptrToString(ptr) {
- ensureLoaded();
- if (typeof ptr !== 'number') {
- throw new TypeError(`Expected a number, got ${typeof ptr}`);
- }
- return wasmModule.UTF8ToString(ptr);
-}
-export const parse = awaitInit(async (query) => {
- const queryPtr = stringToPtr(query);
- let resultPtr = 0;
- try {
- resultPtr = wasmModule._wasm_parse_query(queryPtr);
- const resultStr = ptrToString(resultPtr);
- if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
- throw new Error(resultStr);
- }
- return JSON.parse(resultStr);
- }
- finally {
- wasmModule._free(queryPtr);
- if (resultPtr) {
- wasmModule._wasm_free_string(resultPtr);
- }
- }
-});
-export const deparse = awaitInit(async (parseTree) => {
- if (!parseTree || typeof parseTree !== 'object' || !Array.isArray(parseTree.stmts) || parseTree.stmts.length === 0) {
- throw new Error('No parseTree provided');
- }
- const msg = pg_query.ParseResult.fromObject(parseTree);
- const data = pg_query.ParseResult.encode(msg).finish();
- const dataPtr = wasmModule._malloc(data.length);
- let resultPtr = 0;
- try {
- wasmModule.HEAPU8.set(data, dataPtr);
- resultPtr = wasmModule._wasm_deparse_protobuf(dataPtr, data.length);
- const resultStr = ptrToString(resultPtr);
- if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
- throw new Error(resultStr);
- }
- return resultStr;
- }
- finally {
- wasmModule._free(dataPtr);
- if (resultPtr) {
- wasmModule._wasm_free_string(resultPtr);
- }
- }
-});
-export const parsePlPgSQL = awaitInit(async (query) => {
- const queryPtr = stringToPtr(query);
- let resultPtr = 0;
- try {
- resultPtr = wasmModule._wasm_parse_plpgsql(queryPtr);
- const resultStr = ptrToString(resultPtr);
- if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
- throw new Error(resultStr);
- }
- return JSON.parse(resultStr);
- }
- finally {
- wasmModule._free(queryPtr);
- if (resultPtr) {
- wasmModule._wasm_free_string(resultPtr);
- }
- }
-});
-export const fingerprint = awaitInit(async (query) => {
- const queryPtr = stringToPtr(query);
- let resultPtr = 0;
- try {
- resultPtr = wasmModule._wasm_fingerprint(queryPtr);
- const resultStr = ptrToString(resultPtr);
- if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
- throw new Error(resultStr);
- }
- return resultStr;
- }
- finally {
- wasmModule._free(queryPtr);
- if (resultPtr) {
- wasmModule._wasm_free_string(resultPtr);
- }
- }
-});
-export const normalize = awaitInit(async (query) => {
- const queryPtr = stringToPtr(query);
- let resultPtr = 0;
- try {
- resultPtr = wasmModule._wasm_normalize_query(queryPtr);
- const resultStr = ptrToString(resultPtr);
- if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
- throw new Error(resultStr);
- }
- return resultStr;
- }
- finally {
- wasmModule._free(queryPtr);
- if (resultPtr) {
- wasmModule._wasm_free_string(resultPtr);
- }
- }
-});
-// Sync versions
-export function parseSync(query) {
- if (!wasmModule) {
- throw new Error('WASM module not initialized. Call loadModule() first.');
- }
- const queryPtr = stringToPtr(query);
- let resultPtr = 0;
- try {
- resultPtr = wasmModule._wasm_parse_query(queryPtr);
- const resultStr = ptrToString(resultPtr);
- if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
- throw new Error(resultStr);
- }
- return JSON.parse(resultStr);
- }
- finally {
- wasmModule._free(queryPtr);
- if (resultPtr) {
- wasmModule._wasm_free_string(resultPtr);
- }
- }
-}
-export function deparseSync(parseTree) {
- if (!wasmModule) {
- throw new Error('WASM module not initialized. Call loadModule() first.');
- }
- if (!parseTree || typeof parseTree !== 'object' || !Array.isArray(parseTree.stmts) || parseTree.stmts.length === 0) {
- throw new Error('No parseTree provided');
- }
- const msg = pg_query.ParseResult.fromObject(parseTree);
- const data = pg_query.ParseResult.encode(msg).finish();
- const dataPtr = wasmModule._malloc(data.length);
- let resultPtr = 0;
- try {
- wasmModule.HEAPU8.set(data, dataPtr);
- resultPtr = wasmModule._wasm_deparse_protobuf(dataPtr, data.length);
- const resultStr = ptrToString(resultPtr);
- if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
- throw new Error(resultStr);
- }
- return resultStr;
- }
- finally {
- wasmModule._free(dataPtr);
- if (resultPtr) {
- wasmModule._wasm_free_string(resultPtr);
- }
- }
-}
-export function parsePlPgSQLSync(query) {
- if (!wasmModule) {
- throw new Error('WASM module not initialized. Call loadModule() first.');
- }
- const queryPtr = stringToPtr(query);
- let resultPtr = 0;
- try {
- resultPtr = wasmModule._wasm_parse_plpgsql(queryPtr);
- const resultStr = ptrToString(resultPtr);
- if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
- throw new Error(resultStr);
- }
- return JSON.parse(resultStr);
- }
- finally {
- wasmModule._free(queryPtr);
- if (resultPtr) {
- wasmModule._wasm_free_string(resultPtr);
- }
- }
-}
-export function fingerprintSync(query) {
- if (!wasmModule) {
- throw new Error('WASM module not initialized. Call loadModule() first.');
- }
- const queryPtr = stringToPtr(query);
- let resultPtr = 0;
- try {
- resultPtr = wasmModule._wasm_fingerprint(queryPtr);
- const resultStr = ptrToString(resultPtr);
- if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
- throw new Error(resultStr);
- }
- return resultStr;
- }
- finally {
- wasmModule._free(queryPtr);
- if (resultPtr) {
- wasmModule._wasm_free_string(resultPtr);
- }
- }
-}
-export function normalizeSync(query) {
- if (!wasmModule) {
- throw new Error('WASM module not initialized. Call loadModule() first.');
- }
- const queryPtr = stringToPtr(query);
- let resultPtr = 0;
- try {
- resultPtr = wasmModule._wasm_normalize_query(queryPtr);
- const resultStr = ptrToString(resultPtr);
- if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
- throw new Error(resultStr);
- }
- return resultStr;
- }
- finally {
- wasmModule._free(queryPtr);
- if (resultPtr) {
- wasmModule._wasm_free_string(resultPtr);
- }
- }
-}
-export const scan = awaitInit(async (query) => {
- const queryPtr = stringToPtr(query);
- let resultPtr = 0;
- try {
- resultPtr = wasmModule._wasm_scan(queryPtr);
- const resultStr = ptrToString(resultPtr);
- if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
- throw new Error(resultStr);
- }
- return JSON.parse(resultStr);
- }
- finally {
- wasmModule._free(queryPtr);
- if (resultPtr) {
- wasmModule._wasm_free_string(resultPtr);
- }
- }
-});
-export function scanSync(query) {
- if (!wasmModule) {
- throw new Error('WASM module not initialized. Call loadModule() first.');
- }
- const queryPtr = stringToPtr(query);
- let resultPtr = 0;
- try {
- resultPtr = wasmModule._wasm_scan(queryPtr);
- const resultStr = ptrToString(resultPtr);
- if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
- throw new Error(resultStr);
- }
- return JSON.parse(resultStr);
- }
- finally {
- wasmModule._free(queryPtr);
- if (resultPtr) {
- wasmModule._wasm_free_string(resultPtr);
- }
- }
-}
diff --git a/libpg-query/wasm/libpg-query.js b/libpg-query/wasm/libpg-query.js
deleted file mode 100644
index fe5b6d61..00000000
--- a/libpg-query/wasm/libpg-query.js
+++ /dev/null
@@ -1,20 +0,0 @@
-var PgQueryModule = (() => {
- var _scriptName = typeof document != 'undefined' ? document.currentScript?.src : undefined;
- return (
-async function(moduleArg = {}) {
- var moduleRtn;
-
-var Module=moduleArg;var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof WorkerGlobalScope!="undefined";var ENVIRONMENT_IS_NODE=typeof process=="object"&&process.versions?.node&&process.type!="renderer";var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};if(typeof __filename!="undefined"){_scriptName=__filename}else{}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs");scriptDirectory=__dirname+"/";readBinary=filename=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename);return ret};readAsync=async(filename,binary=true)=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename,binary?undefined:"utf8");return ret};if(process.argv.length>1){thisProgram=process.argv[1].replace(/\\/g,"/")}arguments_=process.argv.slice(2);quit_=(status,toThrow)=>{process.exitCode=status;throw toThrow}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){try{scriptDirectory=new URL(".",_scriptName).href}catch{}{readAsync=async url=>{var response=await fetch(url,{credentials:"same-origin"});if(response.ok){return response.arrayBuffer()}throw new Error(response.status+" : "+response.url)}}}else{}var out=console.log.bind(console);var err=console.error.bind(console);var wasmBinary;var ABORT=false;var EXITSTATUS;var isFileURI=filename=>filename.startsWith("file://");var readyPromiseResolve,readyPromiseReject;var wasmMemory;var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;var HEAP64,HEAPU64;var runtimeInitialized=false;function updateMemoryViews(){var b=wasmMemory.buffer;HEAP8=new Int8Array(b);HEAP16=new Int16Array(b);Module["HEAPU8"]=HEAPU8=new Uint8Array(b);HEAPU16=new Uint16Array(b);HEAP32=new Int32Array(b);Module["HEAPU32"]=HEAPU32=new Uint32Array(b);HEAPF32=new Float32Array(b);HEAPF64=new Float64Array(b);HEAP64=new BigInt64Array(b);HEAPU64=new BigUint64Array(b)}function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(onPreRuns)}function initRuntime(){runtimeInitialized=true;if(!Module["noFSInit"]&&!FS.initialized)FS.init();TTY.init();wasmExports["w"]();FS.ignorePermissions=false}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(onPostRuns)}var runDependencies=0;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;Module["monitorRunDependencies"]?.(runDependencies)}function removeRunDependency(id){runDependencies--;Module["monitorRunDependencies"]?.(runDependencies);if(runDependencies==0){if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}function abort(what){Module["onAbort"]?.(what);what="Aborted("+what+")";err(what);ABORT=true;what+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject?.(e);throw e}var wasmBinaryFile;function findWasmBinary(){return locateFile("libpg-query.wasm")}function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}async function getWasmBinary(binaryFile){if(!wasmBinary){try{var response=await readAsync(binaryFile);return new Uint8Array(response)}catch{}}return getBinarySync(binaryFile)}async function instantiateArrayBuffer(binaryFile,imports){try{var binary=await getWasmBinary(binaryFile);var instance=await WebAssembly.instantiate(binary,imports);return instance}catch(reason){err(`failed to asynchronously prepare wasm: ${reason}`);abort(reason)}}async function instantiateAsync(binary,binaryFile,imports){if(!binary&&typeof WebAssembly.instantiateStreaming=="function"&&!ENVIRONMENT_IS_NODE){try{var response=fetch(binaryFile,{credentials:"same-origin"});var instantiationResult=await WebAssembly.instantiateStreaming(response,imports);return instantiationResult}catch(reason){err(`wasm streaming compile failed: ${reason}`);err("falling back to ArrayBuffer instantiation")}}return instantiateArrayBuffer(binaryFile,imports)}function getWasmImports(){return{a:wasmImports}}async function createWasm(){function receiveInstance(instance,module){wasmExports=instance.exports;wasmMemory=wasmExports["v"];updateMemoryViews();wasmTable=wasmExports["z"];assignWasmExports(wasmExports);removeRunDependency("wasm-instantiate");return wasmExports}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){return receiveInstance(result["instance"])}var info=getWasmImports();if(Module["instantiateWasm"]){return new Promise((resolve,reject)=>{Module["instantiateWasm"](info,(mod,inst)=>{resolve(receiveInstance(mod,inst))})})}wasmBinaryFile??=findWasmBinary();var result=await instantiateAsync(wasmBinary,wasmBinaryFile,info);var exports=receiveInstantiationResult(result);return exports}class ExitStatus{name="ExitStatus";constructor(status){this.message=`Program terminated with exit(${status})`;this.status=status}}var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};var onPostRuns=[];var addOnPostRun=cb=>onPostRuns.push(cb);var onPreRuns=[];var addOnPreRun=cb=>onPreRuns.push(cb);var noExitRuntime=true;var stackRestore=val=>__emscripten_stack_restore(val);var stackSave=()=>_emscripten_stack_get_current();var UTF8Decoder=typeof TextDecoder!="undefined"?new TextDecoder:undefined;var UTF8ArrayToString=(heapOrArray,idx=0,maxBytesToRead=NaN)=>{var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx>10,56320|ch&1023)}}return str};var UTF8ToString=(ptr,maxBytesToRead)=>ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):"";var ___assert_fail=(condition,filename,line,func)=>abort(`Assertion failed: ${UTF8ToString(condition)}, at: `+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"]);var __abort_js=()=>abort("");var __emscripten_throw_longjmp=()=>{throw Infinity};var getHeapMax=()=>2147483648;var alignMemory=(size,alignment)=>Math.ceil(size/alignment)*alignment;var growMemory=size=>{var b=wasmMemory.buffer;var pages=(size-b.byteLength+65535)/65536|0;try{wasmMemory.grow(pages);updateMemoryViews();return 1}catch(e){}};var _emscripten_resize_heap=requestedSize=>{var oldSize=HEAPU8.length;requestedSize>>>=0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignMemory(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true}}return false};var runtimeKeepaliveCounter=0;var keepRuntimeAlive=()=>noExitRuntime||runtimeKeepaliveCounter>0;var _proc_exit=code=>{EXITSTATUS=code;if(!keepRuntimeAlive()){Module["onExit"]?.(code);ABORT=true}quit_(code,new ExitStatus(code))};var exitJS=(status,implicit)=>{EXITSTATUS=status;_proc_exit(status)};var _exit=exitJS;var PATH={isAbs:path=>path.charAt(0)==="/",splitPath:filename=>{var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:(parts,allowAboveRoot)=>{var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:path=>{var isAbsolute=PATH.isAbs(path),trailingSlash=path.slice(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(p=>!!p),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:path=>{var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.slice(0,-1)}return root+dir},basename:path=>path&&path.match(/([^\/]+|\/)\/*$/)[1],join:(...paths)=>PATH.normalize(paths.join("/")),join2:(l,r)=>PATH.normalize(l+"/"+r)};var initRandomFill=()=>{if(ENVIRONMENT_IS_NODE){var nodeCrypto=require("crypto");return view=>nodeCrypto.randomFillSync(view)}return view=>crypto.getRandomValues(view)};var randomFill=view=>{(randomFill=initRandomFill())(view)};var PATH_FS={resolve:(...args)=>{var resolvedPath="",resolvedAbsolute=false;for(var i=args.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?args[i]:FS.cwd();if(typeof path!="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=PATH.isAbs(path)}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(p=>!!p),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:(from,to)=>{from=PATH_FS.resolve(from).slice(1);to=PATH_FS.resolve(to).slice(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i{var len=0;for(var i=0;i=55296&&c<=57343){len+=4;++i}else{len+=3}}return len};var stringToUTF8Array=(str,heap,outIdx,maxBytesToWrite)=>{if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63;i++}}heap[outIdx]=0;return outIdx-startIdx};var intArrayFromString=(stringy,dontAddNull,length)=>{var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array};var FS_stdin_getChar=()=>{if(!FS_stdin_getChar_buffer.length){var result=null;if(ENVIRONMENT_IS_NODE){var BUFSIZE=256;var buf=Buffer.alloc(BUFSIZE);var bytesRead=0;var fd=process.stdin.fd;try{bytesRead=fs.readSync(fd,buf,0,BUFSIZE)}catch(e){if(e.toString().includes("EOF"))bytesRead=0;else throw e}if(bytesRead>0){result=buf.slice(0,bytesRead).toString("utf-8")}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else{}if(!result){return null}FS_stdin_getChar_buffer=intArrayFromString(result,true)}return FS_stdin_getChar_buffer.shift()};var TTY={ttys:[],init(){},shutdown(){},register(dev,ops){TTY.ttys[dev]={input:[],output:[],ops};FS.registerDevice(dev,TTY.stream_ops)},stream_ops:{open(stream){var tty=TTY.ttys[stream.node.rdev];if(!tty){throw new FS.ErrnoError(43)}stream.tty=tty;stream.seekable=false},close(stream){stream.tty.ops.fsync(stream.tty)},fsync(stream){stream.tty.ops.fsync(stream.tty)},read(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.get_char){throw new FS.ErrnoError(60)}var bytesRead=0;for(var i=0;i0){out(UTF8ArrayToString(tty.output));tty.output=[]}},ioctl_tcgets(tty){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(tty,optional_actions,data){return 0},ioctl_tiocgwinsz(tty){return[24,80]}},default_tty1_ops:{put_char(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output));tty.output=[]}else{if(val!=0)tty.output.push(val)}},fsync(tty){if(tty.output?.length>0){err(UTF8ArrayToString(tty.output));tty.output=[]}}}};var mmapAlloc=size=>{abort()};var MEMFS={ops_table:null,mount(mount){return MEMFS.createNode(null,"/",16895,0)},createNode(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(63)}MEMFS.ops_table||={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}};var node=FS.createNode(parent,name,mode,dev);if(FS.isDir(node.mode)){node.node_ops=MEMFS.ops_table.dir.node;node.stream_ops=MEMFS.ops_table.dir.stream;node.contents={}}else if(FS.isFile(node.mode)){node.node_ops=MEMFS.ops_table.file.node;node.stream_ops=MEMFS.ops_table.file.stream;node.usedBytes=0;node.contents=null}else if(FS.isLink(node.mode)){node.node_ops=MEMFS.ops_table.link.node;node.stream_ops=MEMFS.ops_table.link.stream}else if(FS.isChrdev(node.mode)){node.node_ops=MEMFS.ops_table.chrdev.node;node.stream_ops=MEMFS.ops_table.chrdev.stream}node.atime=node.mtime=node.ctime=Date.now();if(parent){parent.contents[name]=node;parent.atime=parent.mtime=parent.ctime=node.atime}return node},getFileDataAsTypedArray(node){if(!node.contents)return new Uint8Array(0);if(node.contents.subarray)return node.contents.subarray(0,node.usedBytes);return new Uint8Array(node.contents)},expandFileStorage(node,newCapacity){var prevCapacity=node.contents?node.contents.length:0;if(prevCapacity>=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.atime);attr.mtime=new Date(node.mtime);attr.ctime=new Date(node.ctime);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr(node,attr){for(const key of["mode","atime","mtime","ctime"]){if(attr[key]!=null){node[key]=attr[key]}}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup(parent,name){throw MEMFS.doesNotExistError},mknod(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename(old_node,new_dir,new_name){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){if(FS.isDir(old_node.mode)){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}FS.hashRemoveNode(new_node)}delete old_node.parent.contents[old_node.name];new_dir.contents[new_name]=old_node;old_node.name=new_name;new_dir.ctime=new_dir.mtime=old_node.parent.ctime=old_node.parent.mtime=Date.now()},unlink(parent,name){delete parent.contents[name];parent.ctime=parent.mtime=Date.now()},rmdir(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.ctime=parent.mtime=Date.now()},readdir(node){return[".","..",...Object.keys(node.contents)]},symlink(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length{var arrayBuffer=await readAsync(url);return new Uint8Array(arrayBuffer)};var FS_createDataFile=(...args)=>FS.createDataFile(...args);var getUniqueRunDependency=id=>id;var preloadPlugins=[];var FS_handledByPreloadPlugin=(byteArray,fullname,finish,onerror)=>{if(typeof Browser!="undefined")Browser.init();var handled=false;preloadPlugins.forEach(plugin=>{if(handled)return;if(plugin["canHandle"](fullname)){plugin["handle"](byteArray,fullname,finish,onerror);handled=true}});return handled};var FS_createPreloadedFile=(parent,name,url,canRead,canWrite,onload,onerror,dontCreateFile,canOwn,preFinish)=>{var fullname=name?PATH_FS.resolve(PATH.join2(parent,name)):parent;var dep=getUniqueRunDependency(`cp ${fullname}`);function processData(byteArray){function finish(byteArray){preFinish?.();if(!dontCreateFile){FS_createDataFile(parent,name,byteArray,canRead,canWrite,canOwn)}onload?.();removeRunDependency(dep)}if(FS_handledByPreloadPlugin(byteArray,fullname,finish,()=>{onerror?.();removeRunDependency(dep)})){return}finish(byteArray)}addRunDependency(dep);if(typeof url=="string"){asyncLoad(url).then(processData,onerror)}else{processData(url)}};var FS_modeStringToFlags=str=>{var flagModes={r:0,"r+":2,w:512|64|1,"w+":512|64|2,a:1024|64|1,"a+":1024|64|2};var flags=flagModes[str];if(typeof flags=="undefined"){throw new Error(`Unknown file open mode: ${str}`)}return flags};var FS_getMode=(canRead,canWrite)=>{var mode=0;if(canRead)mode|=292|73;if(canWrite)mode|=146;return mode};var FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,filesystems:null,syncFSRequests:0,readFiles:{},ErrnoError:class{name="ErrnoError";constructor(errno){this.errno=errno}},FSStream:class{shared={};get object(){return this.node}set object(val){this.node=val}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(val){this.shared.flags=val}get position(){return this.shared.position}set position(val){this.shared.position=val}},FSNode:class{node_ops={};stream_ops={};readMode=292|73;writeMode=146;mounted=null;constructor(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.rdev=rdev;this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&this.readMode)===this.readMode}set read(val){val?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(val){val?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return FS.isDir(this.mode)}get isDevice(){return FS.isChrdev(this.mode)}},lookupPath(path,opts={}){if(!path){throw new FS.ErrnoError(44)}opts.follow_mount??=true;if(!PATH.isAbs(path)){path=FS.cwd()+"/"+path}linkloop:for(var nlinks=0;nlinks<40;nlinks++){var parts=path.split("/").filter(p=>!!p);var current=FS.root;var current_path="/";for(var i=0;i>>0)%FS.nameTable.length},hashAddNode(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode(node){FS.hashRemoveNode(node)},isRoot(node){return node===node.parent},isMountpoint(node){return!!node.mounted},isFile(mode){return(mode&61440)===32768},isDir(mode){return(mode&61440)===16384},isLink(mode){return(mode&61440)===40960},isChrdev(mode){return(mode&61440)===8192},isBlkdev(mode){return(mode&61440)===24576},isFIFO(mode){return(mode&61440)===4096},isSocket(mode){return(mode&49152)===49152},flagsToPermissionString(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup(dir){if(!FS.isDir(dir.mode))return 54;var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate(dir,name){if(!FS.isDir(dir.mode)){return 54}try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&(512|64)){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},checkOpExists(op,err){if(!op){throw new FS.ErrnoError(err)}return op},MAX_OPEN_FDS:4096,nextfd(){for(var fd=0;fd<=FS.MAX_OPEN_FDS;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStreamChecked(fd){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(8)}return stream},getStream:fd=>FS.streams[fd],createStream(stream,fd=-1){stream=Object.assign(new FS.FSStream,stream);if(fd==-1){fd=FS.nextfd()}stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream(fd){FS.streams[fd]=null},dupStream(origStream,fd=-1){var stream=FS.createStream(origStream,fd);stream.stream_ops?.dup?.(stream);return stream},doSetAttr(stream,node,attr){var setattr=stream?.stream_ops.setattr;var arg=setattr?stream:node;setattr??=node.node_ops.setattr;FS.checkOpExists(setattr,63);setattr(arg,attr)},chrdev_stream_ops:{open(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;stream.stream_ops.open?.(stream)},llseek(){throw new FS.ErrnoError(70)}},major:dev=>dev>>8,minor:dev=>dev&255,makedev:(ma,mi)=>ma<<8|mi,registerDevice(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:dev=>FS.devices[dev],getMounts(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push(...m.mounts)}return mounts},syncfs(populate,callback){if(typeof populate=="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err(`warning: ${FS.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`)}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(mount=>{if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type,opts,mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(hash=>{var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup(parent,name){return parent.node_ops.lookup(parent,name)},mknod(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name){throw new FS.ErrnoError(28)}if(name==="."||name===".."){throw new FS.ErrnoError(20)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},statfs(path){return FS.statfsNode(FS.lookupPath(path,{follow:true}).node)},statfsStream(stream){return FS.statfsNode(stream.node)},statfsNode(node){var rtn={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:FS.nextInode,ffree:FS.nextInode-1,fsid:42,flags:2,namelen:255};if(node.node_ops.statfs){Object.assign(rtn,node.node_ops.statfs(node.mount.opts.root))}return rtn},create(path,mode=438){mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir(path,mode=511){mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree(path,mode){var dirs=path.split("/");var d="";for(var dir of dirs){if(!dir)continue;if(d||PATH.isAbs(path))d+="/";d+=dir;try{FS.mkdir(d,mode)}catch(e){if(e.errno!=20)throw e}}},mkdev(path,mode,dev){if(typeof dev=="undefined"){dev=mode;mode=438}mode|=8192;return FS.mknod(path,mode,dev)},symlink(oldpath,newpath){if(!PATH_FS.resolve(oldpath)){throw new FS.ErrnoError(44)}var lookup=FS.lookupPath(newpath,{parent:true});var parent=lookup.node;if(!parent){throw new FS.ErrnoError(44)}var newname=PATH.basename(newpath);var errCode=FS.mayCreate(parent,newname);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.symlink){throw new FS.ErrnoError(63)}return parent.node_ops.symlink(parent,newname,oldpath)},rename(old_path,new_path){var old_dirname=PATH.dirname(old_path);var new_dirname=PATH.dirname(new_path);var old_name=PATH.basename(old_path);var new_name=PATH.basename(new_path);var lookup,old_dir,new_dir;lookup=FS.lookupPath(old_path,{parent:true});old_dir=lookup.node;lookup=FS.lookupPath(new_path,{parent:true});new_dir=lookup.node;if(!old_dir||!new_dir)throw new FS.ErrnoError(44);if(old_dir.mount!==new_dir.mount){throw new FS.ErrnoError(75)}var old_node=FS.lookupNode(old_dir,old_name);var relative=PATH_FS.relative(old_path,new_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(28)}relative=PATH_FS.relative(new_path,old_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(55)}var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(old_node===new_node){return}var isdir=FS.isDir(old_node.mode);var errCode=FS.mayDelete(old_dir,old_name,isdir);if(errCode){throw new FS.ErrnoError(errCode)}errCode=new_node?FS.mayDelete(new_dir,new_name,isdir):FS.mayCreate(new_dir,new_name);if(errCode){throw new FS.ErrnoError(errCode)}if(!old_dir.node_ops.rename){throw new FS.ErrnoError(63)}if(FS.isMountpoint(old_node)||new_node&&FS.isMountpoint(new_node)){throw new FS.ErrnoError(10)}if(new_dir!==old_dir){errCode=FS.nodePermissions(old_dir,"w");if(errCode){throw new FS.ErrnoError(errCode)}}FS.hashRemoveNode(old_node);try{old_dir.node_ops.rename(old_node,new_dir,new_name);old_node.parent=new_dir}catch(e){throw e}finally{FS.hashAddNode(old_node)}},rmdir(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var errCode=FS.mayDelete(parent,name,true);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.rmdir){throw new FS.ErrnoError(63)}if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}parent.node_ops.rmdir(parent,name);FS.destroyNode(node)},readdir(path){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;var readdir=FS.checkOpExists(node.node_ops.readdir,54);return readdir(node)},unlink(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;if(!parent){throw new FS.ErrnoError(44)}var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var errCode=FS.mayDelete(parent,name,false);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.unlink){throw new FS.ErrnoError(63)}if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}parent.node_ops.unlink(parent,name);FS.destroyNode(node)},readlink(path){var lookup=FS.lookupPath(path);var link=lookup.node;if(!link){throw new FS.ErrnoError(44)}if(!link.node_ops.readlink){throw new FS.ErrnoError(28)}return link.node_ops.readlink(link)},stat(path,dontFollow){var lookup=FS.lookupPath(path,{follow:!dontFollow});var node=lookup.node;var getattr=FS.checkOpExists(node.node_ops.getattr,63);return getattr(node)},fstat(fd){var stream=FS.getStreamChecked(fd);var node=stream.node;var getattr=stream.stream_ops.getattr;var arg=getattr?stream:node;getattr??=node.node_ops.getattr;FS.checkOpExists(getattr,63);return getattr(arg)},lstat(path){return FS.stat(path,true)},doChmod(stream,node,mode,dontFollow){FS.doSetAttr(stream,node,{mode:mode&4095|node.mode&~4095,ctime:Date.now(),dontFollow})},chmod(path,mode,dontFollow){var node;if(typeof path=="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node}else{node=path}FS.doChmod(null,node,mode,dontFollow)},lchmod(path,mode){FS.chmod(path,mode,true)},fchmod(fd,mode){var stream=FS.getStreamChecked(fd);FS.doChmod(stream,stream.node,mode,false)},doChown(stream,node,dontFollow){FS.doSetAttr(stream,node,{timestamp:Date.now(),dontFollow})},chown(path,uid,gid,dontFollow){var node;if(typeof path=="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node}else{node=path}FS.doChown(null,node,dontFollow)},lchown(path,uid,gid){FS.chown(path,uid,gid,true)},fchown(fd,uid,gid){var stream=FS.getStreamChecked(fd);FS.doChown(stream,stream.node,false)},doTruncate(stream,node,len){if(FS.isDir(node.mode)){throw new FS.ErrnoError(31)}if(!FS.isFile(node.mode)){throw new FS.ErrnoError(28)}var errCode=FS.nodePermissions(node,"w");if(errCode){throw new FS.ErrnoError(errCode)}FS.doSetAttr(stream,node,{size:len,timestamp:Date.now()})},truncate(path,len){if(len<0){throw new FS.ErrnoError(28)}var node;if(typeof path=="string"){var lookup=FS.lookupPath(path,{follow:true});node=lookup.node}else{node=path}FS.doTruncate(null,node,len)},ftruncate(fd,len){var stream=FS.getStreamChecked(fd);if(len<0||(stream.flags&2097155)===0){throw new FS.ErrnoError(28)}FS.doTruncate(stream,stream.node,len)},utime(path,atime,mtime){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;var setattr=FS.checkOpExists(node.node_ops.setattr,63);setattr(node,{atime,mtime})},open(path,flags,mode=438){if(path===""){throw new FS.ErrnoError(44)}flags=typeof flags=="string"?FS_modeStringToFlags(flags):flags;if(flags&64){mode=mode&4095|32768}else{mode=0}var node;var isDirPath;if(typeof path=="object"){node=path}else{isDirPath=path.endsWith("/");var lookup=FS.lookupPath(path,{follow:!(flags&131072),noent_okay:true});node=lookup.node;path=lookup.path}var created=false;if(flags&64){if(node){if(flags&128){throw new FS.ErrnoError(20)}}else if(isDirPath){throw new FS.ErrnoError(31)}else{node=FS.mknod(path,mode|511,0);created=true}}if(!node){throw new FS.ErrnoError(44)}if(FS.isChrdev(node.mode)){flags&=~512}if(flags&65536&&!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}if(!created){var errCode=FS.mayOpen(node,flags);if(errCode){throw new FS.ErrnoError(errCode)}}if(flags&512&&!created){FS.truncate(node,0)}flags&=~(128|512|131072);var stream=FS.createStream({node,path:FS.getPath(node),flags,seekable:true,position:0,stream_ops:node.stream_ops,ungotten:[],error:false});if(stream.stream_ops.open){stream.stream_ops.open(stream)}if(created){FS.chmod(node,mode&511)}if(Module["logReadFiles"]&&!(flags&1)){if(!(path in FS.readFiles)){FS.readFiles[path]=1}}return stream},close(stream){if(FS.isClosed(stream)){throw new FS.ErrnoError(8)}if(stream.getdents)stream.getdents=null;try{if(stream.stream_ops.close){stream.stream_ops.close(stream)}}catch(e){throw e}finally{FS.closeStream(stream.fd)}stream.fd=null},isClosed(stream){return stream.fd===null},llseek(stream,offset,whence){if(FS.isClosed(stream)){throw new FS.ErrnoError(8)}if(!stream.seekable||!stream.stream_ops.llseek){throw new FS.ErrnoError(70)}if(whence!=0&&whence!=1&&whence!=2){throw new FS.ErrnoError(28)}stream.position=stream.stream_ops.llseek(stream,offset,whence);stream.ungotten=[];return stream.position},read(stream,buffer,offset,length,position){if(length<0||position<0){throw new FS.ErrnoError(28)}if(FS.isClosed(stream)){throw new FS.ErrnoError(8)}if((stream.flags&2097155)===1){throw new FS.ErrnoError(8)}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(31)}if(!stream.stream_ops.read){throw new FS.ErrnoError(28)}var seeking=typeof position!="undefined";if(!seeking){position=stream.position}else if(!stream.seekable){throw new FS.ErrnoError(70)}var bytesRead=stream.stream_ops.read(stream,buffer,offset,length,position);if(!seeking)stream.position+=bytesRead;return bytesRead},write(stream,buffer,offset,length,position,canOwn){if(length<0||position<0){throw new FS.ErrnoError(28)}if(FS.isClosed(stream)){throw new FS.ErrnoError(8)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(8)}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(31)}if(!stream.stream_ops.write){throw new FS.ErrnoError(28)}if(stream.seekable&&stream.flags&1024){FS.llseek(stream,0,2)}var seeking=typeof position!="undefined";if(!seeking){position=stream.position}else if(!stream.seekable){throw new FS.ErrnoError(70)}var bytesWritten=stream.stream_ops.write(stream,buffer,offset,length,position,canOwn);if(!seeking)stream.position+=bytesWritten;return bytesWritten},mmap(stream,length,position,prot,flags){if((prot&2)!==0&&(flags&2)===0&&(stream.flags&2097155)!==2){throw new FS.ErrnoError(2)}if((stream.flags&2097155)===1){throw new FS.ErrnoError(2)}if(!stream.stream_ops.mmap){throw new FS.ErrnoError(43)}if(!length){throw new FS.ErrnoError(28)}return stream.stream_ops.mmap(stream,length,position,prot,flags)},msync(stream,buffer,offset,length,mmapFlags){if(!stream.stream_ops.msync){return 0}return stream.stream_ops.msync(stream,buffer,offset,length,mmapFlags)},ioctl(stream,cmd,arg){if(!stream.stream_ops.ioctl){throw new FS.ErrnoError(59)}return stream.stream_ops.ioctl(stream,cmd,arg)},readFile(path,opts={}){opts.flags=opts.flags||0;opts.encoding=opts.encoding||"binary";if(opts.encoding!=="utf8"&&opts.encoding!=="binary"){throw new Error(`Invalid encoding type "${opts.encoding}"`)}var stream=FS.open(path,opts.flags);var stat=FS.stat(path);var length=stat.size;var buf=new Uint8Array(length);FS.read(stream,buf,0,length,0);if(opts.encoding==="utf8"){buf=UTF8ArrayToString(buf)}FS.close(stream);return buf},writeFile(path,data,opts={}){opts.flags=opts.flags||577;var stream=FS.open(path,opts.flags,opts.mode);if(typeof data=="string"){data=new Uint8Array(intArrayFromString(data,true))}if(ArrayBuffer.isView(data)){FS.write(stream,data,0,data.byteLength,undefined,opts.canOwn)}else{throw new Error("Unsupported data type")}FS.close(stream)},cwd:()=>FS.currentPath,chdir(path){var lookup=FS.lookupPath(path,{follow:true});if(lookup.node===null){throw new FS.ErrnoError(44)}if(!FS.isDir(lookup.node.mode)){throw new FS.ErrnoError(54)}var errCode=FS.nodePermissions(lookup.node,"x");if(errCode){throw new FS.ErrnoError(errCode)}FS.currentPath=lookup.path},createDefaultDirectories(){FS.mkdir("/tmp");FS.mkdir("/home");FS.mkdir("/home/web_user")},createDefaultDevices(){FS.mkdir("/dev");FS.registerDevice(FS.makedev(1,3),{read:()=>0,write:(stream,buffer,offset,length,pos)=>length,llseek:()=>0});FS.mkdev("/dev/null",FS.makedev(1,3));TTY.register(FS.makedev(5,0),TTY.default_tty_ops);TTY.register(FS.makedev(6,0),TTY.default_tty1_ops);FS.mkdev("/dev/tty",FS.makedev(5,0));FS.mkdev("/dev/tty1",FS.makedev(6,0));var randomBuffer=new Uint8Array(1024),randomLeft=0;var randomByte=()=>{if(randomLeft===0){randomFill(randomBuffer);randomLeft=randomBuffer.byteLength}return randomBuffer[--randomLeft]};FS.createDevice("/dev","random",randomByte);FS.createDevice("/dev","urandom",randomByte);FS.mkdir("/dev/shm");FS.mkdir("/dev/shm/tmp")},createSpecialDirectories(){FS.mkdir("/proc");var proc_self=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd");FS.mount({mount(){var node=FS.createNode(proc_self,"fd",16895,73);node.stream_ops={llseek:MEMFS.stream_ops.llseek};node.node_ops={lookup(parent,name){var fd=+name;var stream=FS.getStreamChecked(fd);var ret={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>stream.path},id:fd+1};ret.parent=ret;return ret},readdir(){return Array.from(FS.streams.entries()).filter(([k,v])=>v).map(([k,v])=>k.toString())}};return node}},{},"/proc/self/fd")},createStandardStreams(input,output,error){if(input){FS.createDevice("/dev","stdin",input)}else{FS.symlink("/dev/tty","/dev/stdin")}if(output){FS.createDevice("/dev","stdout",null,output)}else{FS.symlink("/dev/tty","/dev/stdout")}if(error){FS.createDevice("/dev","stderr",null,error)}else{FS.symlink("/dev/tty1","/dev/stderr")}var stdin=FS.open("/dev/stdin",0);var stdout=FS.open("/dev/stdout",1);var stderr=FS.open("/dev/stderr",1)},staticInit(){FS.nameTable=new Array(4096);FS.mount(MEMFS,{},"/");FS.createDefaultDirectories();FS.createDefaultDevices();FS.createSpecialDirectories();FS.filesystems={MEMFS}},init(input,output,error){FS.initialized=true;input??=Module["stdin"];output??=Module["stdout"];error??=Module["stderr"];FS.createStandardStreams(input,output,error)},quit(){FS.initialized=false;for(var stream of FS.streams){if(stream){FS.close(stream)}}},findObject(path,dontResolveLastLink){var ret=FS.analyzePath(path,dontResolveLastLink);if(!ret.exists){return null}return ret.object},analyzePath(path,dontResolveLastLink){try{var lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});path=lookup.path}catch(e){}var ret={isRoot:false,exists:false,error:0,name:null,path:null,object:null,parentExists:false,parentPath:null,parentObject:null};try{var lookup=FS.lookupPath(path,{parent:true});ret.parentExists=true;ret.parentPath=lookup.path;ret.parentObject=lookup.node;ret.name=PATH.basename(path);lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});ret.exists=true;ret.path=lookup.path;ret.object=lookup.node;ret.name=lookup.node.name;ret.isRoot=lookup.path==="/"}catch(e){ret.error=e.errno}return ret},createPath(parent,path,canRead,canWrite){parent=typeof parent=="string"?parent:FS.getPath(parent);var parts=path.split("/").reverse();while(parts.length){var part=parts.pop();if(!part)continue;var current=PATH.join2(parent,part);try{FS.mkdir(current)}catch(e){if(e.errno!=20)throw e}parent=current}return current},createFile(parent,name,properties,canRead,canWrite){var path=PATH.join2(typeof parent=="string"?parent:FS.getPath(parent),name);var mode=FS_getMode(canRead,canWrite);return FS.create(path,mode)},createDataFile(parent,name,data,canRead,canWrite,canOwn){var path=name;if(parent){parent=typeof parent=="string"?parent:FS.getPath(parent);path=name?PATH.join2(parent,name):parent}var mode=FS_getMode(canRead,canWrite);var node=FS.create(path,mode);if(data){if(typeof data=="string"){var arr=new Array(data.length);for(var i=0,len=data.length;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]}setDataGetter(getter){this.getter=getter}cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=(from,to)=>{if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}return intArrayFromString(xhr.responseText||"",true)};var lazyArray=this;lazyArray.setDataGetter(chunkNum=>{var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]=="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]=="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true}get length(){if(!this.lengthKnown){this.cacheLength()}return this._length}get chunkSize(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}if(typeof XMLHttpRequest!="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(key=>{var fn=node.stream_ops[key];stream_ops[key]=(...args)=>{FS.forceLoadFile(node);return fn(...args)}});function writeChunks(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i{FS.forceLoadFile(node);return writeChunks(stream,buffer,offset,length,position)};stream_ops.mmap=(stream,length,position,prot,flags)=>{FS.forceLoadFile(node);var ptr=mmapAlloc(length);if(!ptr){throw new FS.ErrnoError(48)}writeChunks(stream,HEAP8,ptr,length,position);return{ptr,allocated:true}};node.stream_ops=stream_ops;return node}};var SYSCALLS={DEFAULT_POLLMASK:5,calculateAt(dirfd,path,allowEmpty){if(PATH.isAbs(path)){return path}var dir;if(dirfd===-100){dir=FS.cwd()}else{var dirstream=SYSCALLS.getStreamFromFD(dirfd);dir=dirstream.path}if(path.length==0){if(!allowEmpty){throw new FS.ErrnoError(44)}return dir}return dir+"/"+path},writeStat(buf,stat){HEAP32[buf>>2]=stat.dev;HEAP32[buf+4>>2]=stat.mode;HEAPU32[buf+8>>2]=stat.nlink;HEAP32[buf+12>>2]=stat.uid;HEAP32[buf+16>>2]=stat.gid;HEAP32[buf+20>>2]=stat.rdev;HEAP64[buf+24>>3]=BigInt(stat.size);HEAP32[buf+32>>2]=4096;HEAP32[buf+36>>2]=stat.blocks;var atime=stat.atime.getTime();var mtime=stat.mtime.getTime();var ctime=stat.ctime.getTime();HEAP64[buf+40>>3]=BigInt(Math.floor(atime/1e3));HEAPU32[buf+48>>2]=atime%1e3*1e3*1e3;HEAP64[buf+56>>3]=BigInt(Math.floor(mtime/1e3));HEAPU32[buf+64>>2]=mtime%1e3*1e3*1e3;HEAP64[buf+72>>3]=BigInt(Math.floor(ctime/1e3));HEAPU32[buf+80>>2]=ctime%1e3*1e3*1e3;HEAP64[buf+88>>3]=BigInt(stat.ino);return 0},writeStatFs(buf,stats){HEAP32[buf+4>>2]=stats.bsize;HEAP32[buf+40>>2]=stats.bsize;HEAP32[buf+8>>2]=stats.blocks;HEAP32[buf+12>>2]=stats.bfree;HEAP32[buf+16>>2]=stats.bavail;HEAP32[buf+20>>2]=stats.files;HEAP32[buf+24>>2]=stats.ffree;HEAP32[buf+28>>2]=stats.fsid;HEAP32[buf+44>>2]=stats.flags;HEAP32[buf+36>>2]=stats.namelen},doMsync(addr,stream,len,flags,offset){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(43)}if(flags&2){return 0}var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},getStreamFromFD(fd){var stream=FS.getStreamChecked(fd);return stream},varargs:undefined,getStr(ptr){var ret=UTF8ToString(ptr);return ret}};function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}var doReadv=(stream,iov,iovcnt,offset)=>{var ret=0;for(var i=0;i>2];var len=HEAPU32[iov+4>>2];iov+=8;var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2]=num;return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}var INT53_MAX=9007199254740992;var INT53_MIN=-9007199254740992;var bigintToI53Checked=num=>numINT53_MAX?NaN:Number(num);function _fd_seek(fd,offset,whence,newOffset){offset=bigintToI53Checked(offset);try{if(isNaN(offset))return 61;var stream=SYSCALLS.getStreamFromFD(fd);FS.llseek(stream,offset,whence);HEAP64[newOffset>>3]=BigInt(stream.position);if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}var doWritev=(stream,iov,iovcnt,offset)=>{var ret=0;for(var i=0;i>2];var len=HEAPU32[iov+4>>2];iov+=8;var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2]=num;return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}var wasmTableMirror=[];var wasmTable;var getWasmTableEntry=funcPtr=>{var func=wasmTableMirror[funcPtr];if(!func){wasmTableMirror[funcPtr]=func=wasmTable.get(funcPtr)}return func};var stringToUTF8=(str,outPtr,maxBytesToWrite)=>stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);FS.createPreloadedFile=FS_createPreloadedFile;FS.staticInit();MEMFS.doesNotExistError=new FS.ErrnoError(44);MEMFS.doesNotExistError.stack="";{if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(Module["preloadPlugins"])preloadPlugins=Module["preloadPlugins"];if(Module["print"])out=Module["print"];if(Module["printErr"])err=Module["printErr"];if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"]}Module["UTF8ToString"]=UTF8ToString;Module["stringToUTF8"]=stringToUTF8;Module["lengthBytesUTF8"]=lengthBytesUTF8;var _wasm_parse_query,_malloc,_free,_wasm_deparse_protobuf,_wasm_parse_plpgsql,_wasm_fingerprint,_wasm_parse_query_protobuf,_wasm_get_protobuf_len,_wasm_normalize_query,_wasm_parse_query_detailed,_wasm_free_detailed_result,_wasm_scan,_wasm_free_string,_setThrew,__emscripten_stack_restore,_emscripten_stack_get_current;function assignWasmExports(wasmExports){Module["_wasm_parse_query"]=_wasm_parse_query=wasmExports["x"];Module["_malloc"]=_malloc=wasmExports["y"];Module["_free"]=_free=wasmExports["A"];Module["_wasm_deparse_protobuf"]=_wasm_deparse_protobuf=wasmExports["B"];Module["_wasm_parse_plpgsql"]=_wasm_parse_plpgsql=wasmExports["C"];Module["_wasm_fingerprint"]=_wasm_fingerprint=wasmExports["D"];Module["_wasm_parse_query_protobuf"]=_wasm_parse_query_protobuf=wasmExports["E"];Module["_wasm_get_protobuf_len"]=_wasm_get_protobuf_len=wasmExports["F"];Module["_wasm_normalize_query"]=_wasm_normalize_query=wasmExports["G"];Module["_wasm_parse_query_detailed"]=_wasm_parse_query_detailed=wasmExports["H"];Module["_wasm_free_detailed_result"]=_wasm_free_detailed_result=wasmExports["I"];Module["_wasm_scan"]=_wasm_scan=wasmExports["J"];Module["_wasm_free_string"]=_wasm_free_string=wasmExports["K"];_setThrew=wasmExports["L"];__emscripten_stack_restore=wasmExports["M"];_emscripten_stack_get_current=wasmExports["N"]}var wasmImports={c:___assert_fail,u:__abort_js,p:__emscripten_throw_longjmp,q:_emscripten_resize_heap,o:_exit,t:_fd_close,r:_fd_read,s:_fd_seek,m:_fd_write,g:invoke_i,b:invoke_ii,a:invoke_iii,d:invoke_iiii,h:invoke_iiiii,l:invoke_iiiiii,n:invoke_ji,f:invoke_v,e:invoke_vi,i:invoke_vii,k:invoke_viii,j:invoke_viiii};var wasmExports=await createWasm();function invoke_iii(index,a1,a2){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_ii(index,a1){var sp=stackSave();try{return getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_i(index){var sp=stackSave();try{return getWasmTableEntry(index)()}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_v(index){var sp=stackSave();try{getWasmTableEntry(index)()}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vi(index,a1){var sp=stackSave();try{getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vii(index,a1,a2){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_ji(index,a1){var sp=stackSave();try{return getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);return 0n}}function run(){if(runDependencies>0){dependenciesFulfilled=run;return}preRun();if(runDependencies>0){dependenciesFulfilled=run;return}function doRun(){Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve?.(Module);Module["onRuntimeInitialized"]?.();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(()=>{setTimeout(()=>Module["setStatus"](""),1);doRun()},1)}else{doRun()}}function preInit(){if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].shift()()}}}preInit();run();if(runtimeInitialized){moduleRtn=Module}else{moduleRtn=new Promise((resolve,reject)=>{readyPromiseResolve=resolve;readyPromiseReject=reject})}
-
-
- return moduleRtn;
-}
-);
-})();
-if (typeof exports === 'object' && typeof module === 'object') {
- module.exports = PgQueryModule;
- // This default export looks redundant, but it allows TS to import this
- // commonjs style module.
- module.exports.default = PgQueryModule;
-} else if (typeof define === 'function' && define['amd'])
- define([], () => PgQueryModule);
diff --git a/package.json b/package.json
index faee70d5..1df9fba8 100644
--- a/package.json
+++ b/package.json
@@ -6,9 +6,21 @@
"scripts": {
"build": "pnpm --filter libpg-query build",
"test": "pnpm --filter libpg-query test",
- "clean": "pnpm --filter libpg-query clean"
+ "clean": "pnpm --filter libpg-query clean",
+ "build:all": "pnpm -r build",
+ "test:all": "pnpm -r test",
+ "clean:all": "pnpm -r clean",
+ "analyze:sizes": "node scripts/analyze-sizes.js",
+ "fetch:protos": "node scripts/fetch-protos.js",
+ "build:types": "node scripts/build-types.js",
+ "prepare:types": "node scripts/prepare-types.js"
},
"devDependencies": {
- "@types/node": "^20.0.0"
+ "@types/node": "^20.0.0",
+ "copyfiles": "^2.4.1",
+ "rimraf": "^5.0.0",
+ "ts-node": "^10.9.1",
+ "typescript": "^5.3.3",
+ "pg-proto-parser": "^1.28.2"
}
}
\ No newline at end of file
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 6185686c..0d4413f4 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -11,6 +11,21 @@ importers:
'@types/node':
specifier: ^20.0.0
version: 20.19.1
+ copyfiles:
+ specifier: ^2.4.1
+ version: 2.4.1
+ pg-proto-parser:
+ specifier: ^1.28.2
+ version: 1.28.2
+ rimraf:
+ specifier: ^5.0.0
+ version: 5.0.10
+ ts-node:
+ specifier: ^10.9.1
+ version: 10.9.2(@types/node@20.19.1)(typescript@5.8.3)
+ typescript:
+ specifier: ^5.3.3
+ version: 5.8.3
libpg-query:
dependencies:
@@ -18,8 +33,8 @@ importers:
specifier: 7.2.6
version: 7.2.6
'@pgsql/types':
- specifier: ^17.0.0
- version: 17.4.2
+ specifier: ^17.4.2
+ version: 17.5.2
devDependencies:
'@launchql/proto-cli':
specifier: 1.25.0
@@ -27,18 +42,71 @@ importers:
'@yamlize/cli':
specifier: ^0.8.0
version: 0.8.0
- chai:
- specifier: ^3.5.0
- version: 3.5.0
- mocha:
- specifier: ^11.7.0
- version: 11.7.0
- rimraf:
- specifier: 5.0.0
- version: 5.0.0
- typescript:
- specifier: ^5.3.3
- version: 5.8.3
+
+ types/13:
+ devDependencies:
+ pg-proto-parser:
+ specifier: ^1.28.2
+ version: 1.28.2
+ publishDirectory: dist
+
+ types/14:
+ devDependencies:
+ pg-proto-parser:
+ specifier: ^1.28.2
+ version: 1.28.2
+ publishDirectory: dist
+
+ types/15:
+ devDependencies:
+ pg-proto-parser:
+ specifier: ^1.28.2
+ version: 1.28.2
+ publishDirectory: dist
+
+ types/16:
+ devDependencies:
+ pg-proto-parser:
+ specifier: ^1.28.2
+ version: 1.28.2
+ publishDirectory: dist
+
+ types/17:
+ devDependencies:
+ pg-proto-parser:
+ specifier: ^1.28.2
+ version: 1.28.2
+ publishDirectory: dist
+
+ versions/13:
+ dependencies:
+ '@pgsql/types':
+ specifier: ^13.10.0
+ version: 13.10.0
+
+ versions/14:
+ dependencies:
+ '@pgsql/types':
+ specifier: ^14.0.0
+ version: 14.0.0
+
+ versions/15:
+ dependencies:
+ '@pgsql/types':
+ specifier: ^15.0.2
+ version: 15.0.2
+
+ versions/16:
+ dependencies:
+ '@pgsql/types':
+ specifier: ^16.0.0
+ version: 16.0.0
+
+ versions/17:
+ dependencies:
+ '@pgsql/types':
+ specifier: ^17.4.2
+ version: 17.5.2
packages:
@@ -130,7 +198,7 @@ packages:
'@babel/helper-split-export-declaration': 7.24.7
'@babel/parser': 7.27.5
'@babel/types': 7.24.0
- debug: 4.4.1(supports-color@8.1.1)
+ debug: 4.4.1
globals: 11.12.0
transitivePeerDependencies:
- supports-color
@@ -153,6 +221,13 @@ packages:
'@babel/helper-validator-identifier': 7.27.1
dev: true
+ /@cspotcode/source-map-support@0.8.1:
+ resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==}
+ engines: {node: '>=12'}
+ dependencies:
+ '@jridgewell/trace-mapping': 0.3.9
+ dev: true
+
/@isaacs/cliui@8.0.2:
resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==}
engines: {node: '>=12'}
@@ -195,6 +270,13 @@ packages:
'@jridgewell/sourcemap-codec': 1.5.0
dev: true
+ /@jridgewell/trace-mapping@0.3.9:
+ resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==}
+ dependencies:
+ '@jridgewell/resolve-uri': 3.1.2
+ '@jridgewell/sourcemap-codec': 1.5.0
+ dev: true
+
/@jsdoc/salty@0.2.9:
resolution: {integrity: sha512-yYxMVH7Dqw6nO0d5NIV8OQWnitU8k6vXH8NtgqAfIa/IUqRMxRv/NUJJ08VEKbAakwxlgBl5PJdrU0dMPStsnw==}
engines: {node: '>=v12.0.0'}
@@ -214,7 +296,7 @@ packages:
minimist: 1.2.8
mkdirp: 3.0.1
nested-obj: 0.0.1
- pg-proto-parser: 1.24.0
+ pg-proto-parser: 1.28.2
transitivePeerDependencies:
- supports-color
dev: true
@@ -257,8 +339,24 @@ packages:
'@types/node': 20.19.1
long: 5.3.2
- /@pgsql/types@17.4.2:
- resolution: {integrity: sha512-8vD/R/bDpeWjmmofYTWuzW5rw3OjKst4d//zJllDNBW/JkRrsNlCzSUUCIrb6S5GBaU5XPGUggyXRjQYwlnftw==}
+ /@pgsql/types@13.10.0:
+ resolution: {integrity: sha512-W2xBQnbaBzGFFDhxdATV+PHq5HET8HTp8Yu7ZdR3gYSLJOU35GjAUE/WQ+ll8pC1m1j+zW11L97S5B1l5eLlbQ==}
+ dev: false
+
+ /@pgsql/types@14.0.0:
+ resolution: {integrity: sha512-QbqqGhlinfZKrJudTK2LgbxvMzqjtCZIEHhTNoqySwIlV3EVJHpNv5edrcxsMB61QWP8vRusPpcpFq90LT7Gqg==}
+ dev: false
+
+ /@pgsql/types@15.0.2:
+ resolution: {integrity: sha512-K3gtnbqbSUuUVmPm143qx5Gy2EmKuooshV95yMD48EUQ1256sgZBriEfY61OWJnlzdREdqHTIOxQqpZAb7XdZg==}
+ dev: false
+
+ /@pgsql/types@16.0.0:
+ resolution: {integrity: sha512-5y6LsSqrsiZApustJl5a+5Vh2glyhdUVgRJfG+f7AosMvohLG/yptBZg234/rKXsOdFJBXwwUdhv6ynbdZuMHA==}
+ dev: false
+
+ /@pgsql/types@17.5.2:
+ resolution: {integrity: sha512-LAuKOfWhYNR31iE+MSZP215kOhkobCB5R8dm1+ZJTV0jqKJRIr7dCVdYeOJA2YL7gOmZmu55ELH/qiZTZqWLSg==}
dev: false
/@pkgjs/parseargs@0.11.0:
@@ -301,6 +399,22 @@ packages:
/@protobufjs/utf8@1.1.0:
resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==}
+ /@tsconfig/node10@1.0.11:
+ resolution: {integrity: sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==}
+ dev: true
+
+ /@tsconfig/node12@1.0.11:
+ resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==}
+ dev: true
+
+ /@tsconfig/node14@1.0.3:
+ resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==}
+ dev: true
+
+ /@tsconfig/node16@1.0.4:
+ resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==}
+ dev: true
+
/@types/linkify-it@5.0.0:
resolution: {integrity: sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==}
dev: true
@@ -340,6 +454,13 @@ packages:
acorn: 8.15.0
dev: true
+ /acorn-walk@8.3.4:
+ resolution: {integrity: sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==}
+ engines: {node: '>=0.4.0'}
+ dependencies:
+ acorn: 8.15.0
+ dev: true
+
/acorn@8.15.0:
resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==}
engines: {node: '>=0.4.0'}
@@ -368,19 +489,12 @@ packages:
engines: {node: '>=12'}
dev: true
- /argparse@2.0.1:
- resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
- dev: true
-
- /assertion-error@1.1.0:
- resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==}
+ /arg@4.1.3:
+ resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==}
dev: true
- /ast-types@0.16.1:
- resolution: {integrity: sha512-6t10qk83GOG8p0vKmaCr8eiilZwO171AvbROMtvvNiwrTly62t+7XkA8RdIIVbpMhCASAsxgAzdRSwh6nw/5Dg==}
- engines: {node: '>=4'}
- dependencies:
- tslib: 2.8.1
+ /argparse@2.0.1:
+ resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
dev: true
/balanced-match@1.0.2:
@@ -391,8 +505,11 @@ packages:
resolution: {integrity: sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==}
dev: true
- /boolbase@1.0.0:
- resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==}
+ /brace-expansion@1.1.12:
+ resolution: {integrity: sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==}
+ dependencies:
+ balanced-match: 1.0.2
+ concat-map: 0.0.1
dev: true
/brace-expansion@2.0.2:
@@ -401,15 +518,6 @@ packages:
balanced-match: 1.0.2
dev: true
- /browser-stdout@1.3.1:
- resolution: {integrity: sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==}
- dev: true
-
- /camelcase@6.3.0:
- resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==}
- engines: {node: '>=10'}
- dev: true
-
/case@1.6.3:
resolution: {integrity: sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ==}
engines: {node: '>= 0.8.0'}
@@ -422,15 +530,6 @@ packages:
lodash: 4.17.21
dev: true
- /chai@3.5.0:
- resolution: {integrity: sha512-eRYY0vPS2a9zt5w5Z0aCeWbrXTEyvk7u/Xf71EzNObrjSCPgMm1Nku/D/u2tiqHBX5j40wWhj54YJLtgn8g55A==}
- engines: {node: '>= 0.4.0'}
- dependencies:
- assertion-error: 1.1.0
- deep-eql: 0.1.3
- type-detect: 1.0.0
- dev: true
-
/chalk@4.1.0:
resolution: {integrity: sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==}
engines: {node: '>=10'}
@@ -447,16 +546,8 @@ packages:
supports-color: 7.2.0
dev: true
- /chokidar@4.0.3:
- resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==}
- engines: {node: '>= 14.16.0'}
- dependencies:
- readdirp: 4.1.2
- dev: true
-
- /cliui@8.0.1:
- resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==}
- engines: {node: '>=12'}
+ /cliui@7.0.4:
+ resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==}
dependencies:
string-width: 4.2.3
strip-ansi: 6.0.1
@@ -474,6 +565,31 @@ packages:
resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}
dev: true
+ /concat-map@0.0.1:
+ resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
+ dev: true
+
+ /copyfiles@2.4.1:
+ resolution: {integrity: sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==}
+ hasBin: true
+ dependencies:
+ glob: 7.2.3
+ minimatch: 3.1.2
+ mkdirp: 1.0.4
+ noms: 0.0.0
+ through2: 2.0.5
+ untildify: 4.0.0
+ yargs: 16.2.0
+ dev: true
+
+ /core-util-is@1.0.3:
+ resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==}
+ dev: true
+
+ /create-require@1.1.1:
+ resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==}
+ dev: true
+
/cross-spawn@7.0.6:
resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==}
engines: {node: '>= 8'}
@@ -483,22 +599,7 @@ packages:
which: 2.0.2
dev: true
- /css-select@5.1.0:
- resolution: {integrity: sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==}
- dependencies:
- boolbase: 1.0.0
- css-what: 6.1.0
- domhandler: 5.0.3
- domutils: 3.2.2
- nth-check: 2.1.1
- dev: true
-
- /css-what@6.1.0:
- resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==}
- engines: {node: '>= 6'}
- dev: true
-
- /debug@4.4.1(supports-color@8.1.1):
+ /debug@4.4.1:
resolution: {integrity: sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==}
engines: {node: '>=6.0'}
peerDependencies:
@@ -508,18 +609,6 @@ packages:
optional: true
dependencies:
ms: 2.1.3
- supports-color: 8.1.1
- dev: true
-
- /decamelize@4.0.0:
- resolution: {integrity: sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==}
- engines: {node: '>=10'}
- dev: true
-
- /deep-eql@0.1.3:
- resolution: {integrity: sha512-6sEotTRGBFiNcqVoeHwnfopbSpi5NbH1VWJmYCVkmxMmaVTT0bUTrNaGyBwhgP4MZL012W/mkzIn3Da+iDYweg==}
- dependencies:
- type-detect: 0.1.1
dev: true
/deep-is@0.1.4:
@@ -531,38 +620,11 @@ packages:
engines: {node: '>=0.10.0'}
dev: true
- /diff@7.0.0:
- resolution: {integrity: sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==}
+ /diff@4.0.2:
+ resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==}
engines: {node: '>=0.3.1'}
dev: true
- /dom-serializer@2.0.0:
- resolution: {integrity: sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==}
- dependencies:
- domelementtype: 2.3.0
- domhandler: 5.0.3
- entities: 4.5.0
- dev: true
-
- /domelementtype@2.3.0:
- resolution: {integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==}
- dev: true
-
- /domhandler@5.0.3:
- resolution: {integrity: sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==}
- engines: {node: '>= 4'}
- dependencies:
- domelementtype: 2.3.0
- dev: true
-
- /domutils@3.2.2:
- resolution: {integrity: sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==}
- dependencies:
- dom-serializer: 2.0.0
- domelementtype: 2.3.0
- domhandler: 5.0.3
- dev: true
-
/eastasianwidth@0.2.0:
resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==}
dev: true
@@ -590,11 +652,6 @@ packages:
engines: {node: '>=8'}
dev: true
- /escape-string-regexp@4.0.0:
- resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==}
- engines: {node: '>=10'}
- dev: true
-
/escodegen@1.14.3:
resolution: {integrity: sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==}
engines: {node: '>=4.0'}
@@ -647,19 +704,6 @@ packages:
resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==}
dev: true
- /find-up@5.0.0:
- resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==}
- engines: {node: '>=10'}
- dependencies:
- locate-path: 6.0.0
- path-exists: 4.0.0
- dev: true
-
- /flat@5.0.2:
- resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==}
- hasBin: true
- dev: true
-
/foreground-child@3.3.1:
resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==}
engines: {node: '>=14'}
@@ -689,6 +733,18 @@ packages:
path-scurry: 1.11.1
dev: true
+ /glob@7.2.3:
+ resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==}
+ deprecated: Glob versions prior to v9 are no longer supported
+ dependencies:
+ fs.realpath: 1.0.0
+ inflight: 1.0.6
+ inherits: 2.0.4
+ minimatch: 3.1.2
+ once: 1.4.0
+ path-is-absolute: 1.0.1
+ dev: true
+
/glob@8.0.3:
resolution: {integrity: sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==}
engines: {node: '>=12'}
@@ -715,11 +771,6 @@ packages:
engines: {node: '>=8'}
dev: true
- /he@1.2.0:
- resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==}
- hasBin: true
- dev: true
-
/inflight@1.0.6:
resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==}
deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
@@ -755,14 +806,12 @@ packages:
engines: {node: '>=8'}
dev: true
- /is-plain-obj@2.1.0:
- resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==}
- engines: {node: '>=8'}
+ /isarray@0.0.1:
+ resolution: {integrity: sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==}
dev: true
- /is-unicode-supported@0.1.0:
- resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==}
- engines: {node: '>=10'}
+ /isarray@1.0.0:
+ resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==}
dev: true
/isexe@2.0.0:
@@ -842,25 +891,10 @@ packages:
uc.micro: 2.1.0
dev: true
- /locate-path@6.0.0:
- resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==}
- engines: {node: '>=10'}
- dependencies:
- p-locate: 5.0.0
- dev: true
-
/lodash@4.17.21:
resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==}
dev: true
- /log-symbols@4.1.0:
- resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==}
- engines: {node: '>=10'}
- dependencies:
- chalk: 4.1.2
- is-unicode-supported: 0.1.0
- dev: true
-
/long@5.3.2:
resolution: {integrity: sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==}
@@ -868,6 +902,10 @@ packages:
resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==}
dev: true
+ /make-error@1.3.6:
+ resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==}
+ dev: true
+
/markdown-it-anchor@8.6.7(@types/markdown-it@14.1.2)(markdown-it@14.1.0):
resolution: {integrity: sha512-FlCHFwNnutLgVTflOYHPW2pPcl2AACqVzExlkGQNsi4CJgqOHN7YTgDd4LuhgN1BFO3TS0vLAruV1Td6dwWPJA==}
peerDependencies:
@@ -900,6 +938,12 @@ packages:
resolution: {integrity: sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==}
dev: true
+ /minimatch@3.1.2:
+ resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
+ dependencies:
+ brace-expansion: 1.1.12
+ dev: true
+
/minimatch@5.1.6:
resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==}
engines: {node: '>=10'}
@@ -935,33 +979,6 @@ packages:
hasBin: true
dev: true
- /mocha@11.7.0:
- resolution: {integrity: sha512-bXfLy/mI8n4QICg+pWj1G8VduX5vC0SHRwFpiR5/Fxc8S2G906pSfkyMmHVsdJNQJQNh3LE67koad9GzEvkV6g==}
- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
- hasBin: true
- dependencies:
- browser-stdout: 1.3.1
- chokidar: 4.0.3
- debug: 4.4.1(supports-color@8.1.1)
- diff: 7.0.0
- escape-string-regexp: 4.0.0
- find-up: 5.0.0
- glob: 10.4.5
- he: 1.2.0
- js-yaml: 4.1.0
- log-symbols: 4.1.0
- minimatch: 9.0.5
- ms: 2.1.3
- picocolors: 1.1.1
- serialize-javascript: 6.0.2
- strip-json-comments: 3.1.1
- supports-color: 8.1.1
- workerpool: 9.3.2
- yargs: 17.7.2
- yargs-parser: 21.1.1
- yargs-unparser: 2.0.0
- dev: true
-
/ms@2.1.3:
resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
dev: true
@@ -970,17 +987,11 @@ packages:
resolution: {integrity: sha512-kB1WKTng+IePQhZVs1UXtFaHBx4QEM5a0XKGAzYfCKvdx5DhNjCytNDWMUGpNNpHLotln+tiwcA52kWCIgGq1Q==}
dev: true
- /node-html-parser@6.1.12:
- resolution: {integrity: sha512-/bT/Ncmv+fbMGX96XG9g05vFt43m/+SYKIs9oAemQVYyVcZmDAI2Xq/SbNcpOA35eF0Zk2av3Ksf+Xk8Vt8abA==}
- dependencies:
- css-select: 5.1.0
- he: 1.2.0
- dev: true
-
- /nth-check@2.1.1:
- resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==}
+ /noms@0.0.0:
+ resolution: {integrity: sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow==}
dependencies:
- boolbase: 1.0.0
+ inherits: 2.0.4
+ readable-stream: 1.0.34
dev: true
/once@1.4.0:
@@ -1001,27 +1012,13 @@ packages:
word-wrap: 1.2.5
dev: true
- /p-limit@3.1.0:
- resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==}
- engines: {node: '>=10'}
- dependencies:
- yocto-queue: 0.1.0
- dev: true
-
- /p-locate@5.0.0:
- resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==}
- engines: {node: '>=10'}
- dependencies:
- p-limit: 3.1.0
- dev: true
-
/package-json-from-dist@1.0.1:
resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==}
dev: true
- /path-exists@4.0.0:
- resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==}
- engines: {node: '>=8'}
+ /path-is-absolute@1.0.1:
+ resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==}
+ engines: {node: '>=0.10.0'}
dev: true
/path-key@3.1.1:
@@ -1037,8 +1034,8 @@ packages:
minipass: 7.1.2
dev: true
- /pg-proto-parser@1.24.0:
- resolution: {integrity: sha512-6Rr9l0KKvvQJRXGLxAhpEOki3rV7M1IIZWBJGlMZFV0+TunNQBLM+geiXSMALBrB1EvKKes7q3/rt6u7UTzT/g==}
+ /pg-proto-parser@1.28.2:
+ resolution: {integrity: sha512-W+IywDGhYnsWf0pADeeXx9ORmAfUUK4Be6thyXO+uPycdG5EqCHG85G9BG7BubIxHomYxk2xJRgpxfTRfJ49fw==}
dependencies:
'@babel/generator': 7.27.5
'@babel/parser': 7.27.5
@@ -1048,8 +1045,7 @@ packages:
case: 1.6.3
deepmerge: 4.3.1
nested-obj: 0.0.1
- node-html-parser: 6.1.12
- recast: 0.23.6
+ strfy-js: 3.0.1
transitivePeerDependencies:
- supports-color
dev: true
@@ -1063,31 +1059,34 @@ packages:
engines: {node: '>= 0.8.0'}
dev: true
+ /process-nextick-args@2.0.1:
+ resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==}
+ dev: true
+
/punycode.js@2.3.1:
resolution: {integrity: sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==}
engines: {node: '>=6'}
dev: true
- /randombytes@2.1.0:
- resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==}
+ /readable-stream@1.0.34:
+ resolution: {integrity: sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==}
dependencies:
- safe-buffer: 5.2.1
- dev: true
-
- /readdirp@4.1.2:
- resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==}
- engines: {node: '>= 14.18.0'}
+ core-util-is: 1.0.3
+ inherits: 2.0.4
+ isarray: 0.0.1
+ string_decoder: 0.10.31
dev: true
- /recast@0.23.6:
- resolution: {integrity: sha512-9FHoNjX1yjuesMwuthAmPKabxYQdOgihFYmT5ebXfYGBcnqXZf3WOVz+5foEZ8Y83P4ZY6yQD5GMmtV+pgCCAQ==}
- engines: {node: '>= 4'}
+ /readable-stream@2.3.8:
+ resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==}
dependencies:
- ast-types: 0.16.1
- esprima: 4.0.1
- source-map: 0.6.1
- tiny-invariant: 1.3.3
- tslib: 2.8.1
+ core-util-is: 1.0.3
+ inherits: 2.0.4
+ isarray: 1.0.0
+ process-nextick-args: 2.0.1
+ safe-buffer: 5.1.2
+ string_decoder: 1.1.1
+ util-deprecate: 1.0.2
dev: true
/require-directory@2.1.1:
@@ -1101,16 +1100,15 @@ packages:
lodash: 4.17.21
dev: true
- /rimraf@5.0.0:
- resolution: {integrity: sha512-Jf9llaP+RvaEVS5nPShYFhtXIrb3LRKP281ib3So0KkeZKo2wIKyq0Re7TOSwanasA423PSr6CCIL4bP6T040g==}
- engines: {node: '>=14'}
+ /rimraf@5.0.10:
+ resolution: {integrity: sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==}
hasBin: true
dependencies:
glob: 10.4.5
dev: true
- /safe-buffer@5.2.1:
- resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}
+ /safe-buffer@5.1.2:
+ resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==}
dev: true
/semver@7.7.2:
@@ -1119,12 +1117,6 @@ packages:
hasBin: true
dev: true
- /serialize-javascript@6.0.2:
- resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==}
- dependencies:
- randombytes: 2.1.0
- dev: true
-
/shebang-command@2.0.0:
resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==}
engines: {node: '>=8'}
@@ -1145,6 +1137,14 @@ packages:
/source-map@0.6.1:
resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==}
engines: {node: '>=0.10.0'}
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /strfy-js@3.0.1:
+ resolution: {integrity: sha512-GVN7Kz2mZ8ZSXyo5neALGObmah+JVw/nr8zNapzNtrObO+tcW0wOmlOBfRdux+XfIaA/87qe5MWXtscE7VeY+g==}
+ dependencies:
+ minimatch: 9.0.5
dev: true
/string-width@4.2.3:
@@ -1165,6 +1165,16 @@ packages:
strip-ansi: 7.1.0
dev: true
+ /string_decoder@0.10.31:
+ resolution: {integrity: sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==}
+ dev: true
+
+ /string_decoder@1.1.1:
+ resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==}
+ dependencies:
+ safe-buffer: 5.1.2
+ dev: true
+
/strip-ansi@6.0.1:
resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}
engines: {node: '>=8'}
@@ -1191,15 +1201,11 @@ packages:
has-flag: 4.0.0
dev: true
- /supports-color@8.1.1:
- resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==}
- engines: {node: '>=10'}
+ /through2@2.0.5:
+ resolution: {integrity: sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==}
dependencies:
- has-flag: 4.0.0
- dev: true
-
- /tiny-invariant@1.3.3:
- resolution: {integrity: sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==}
+ readable-stream: 2.3.8
+ xtend: 4.0.2
dev: true
/tmp@0.2.3:
@@ -1212,8 +1218,35 @@ packages:
engines: {node: '>=4'}
dev: true
- /tslib@2.8.1:
- resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}
+ /ts-node@10.9.2(@types/node@20.19.1)(typescript@5.8.3):
+ resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==}
+ hasBin: true
+ peerDependencies:
+ '@swc/core': '>=1.2.50'
+ '@swc/wasm': '>=1.2.50'
+ '@types/node': '*'
+ typescript: '>=2.7'
+ peerDependenciesMeta:
+ '@swc/core':
+ optional: true
+ '@swc/wasm':
+ optional: true
+ dependencies:
+ '@cspotcode/source-map-support': 0.8.1
+ '@tsconfig/node10': 1.0.11
+ '@tsconfig/node12': 1.0.11
+ '@tsconfig/node14': 1.0.3
+ '@tsconfig/node16': 1.0.4
+ '@types/node': 20.19.1
+ acorn: 8.15.0
+ acorn-walk: 8.3.4
+ arg: 4.1.3
+ create-require: 1.1.1
+ diff: 4.0.2
+ make-error: 1.3.6
+ typescript: 5.8.3
+ v8-compile-cache-lib: 3.0.1
+ yn: 3.1.1
dev: true
/type-check@0.3.2:
@@ -1223,14 +1256,6 @@ packages:
prelude-ls: 1.1.2
dev: true
- /type-detect@0.1.1:
- resolution: {integrity: sha512-5rqszGVwYgBoDkIm2oUtvkfZMQ0vk29iDMU0W2qCa3rG0vPDNczCMT4hV/bLBgLg8k8ri6+u3Zbt+S/14eMzlA==}
- dev: true
-
- /type-detect@1.0.0:
- resolution: {integrity: sha512-f9Uv6ezcpvCQjJU0Zqbg+65qdcszv3qUQsZfjdRbWiZ7AMenrX1u0lNk9EoWWX6e1F+NULyg27mtdeZ5WhpljA==}
- dev: true
-
/typescript@5.8.3:
resolution: {integrity: sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==}
engines: {node: '>=14.17'}
@@ -1254,6 +1279,19 @@ packages:
/undici-types@6.21.0:
resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==}
+ /untildify@4.0.0:
+ resolution: {integrity: sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==}
+ engines: {node: '>=8'}
+ dev: true
+
+ /util-deprecate@1.0.2:
+ resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
+ dev: true
+
+ /v8-compile-cache-lib@3.0.1:
+ resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==}
+ dev: true
+
/which@2.0.2:
resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==}
engines: {node: '>= 8'}
@@ -1267,10 +1305,6 @@ packages:
engines: {node: '>=0.10.0'}
dev: true
- /workerpool@9.3.2:
- resolution: {integrity: sha512-Xz4Nm9c+LiBHhDR5bDLnNzmj6+5F+cyEAWPMkbs2awq/dYazR/efelZzUAjB/y3kNHL+uzkHvxVVpaOfGCPV7A==}
- dev: true
-
/wrap-ansi@7.0.0:
resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==}
engines: {node: '>=10'}
@@ -1297,6 +1331,11 @@ packages:
resolution: {integrity: sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg==}
dev: true
+ /xtend@4.0.2:
+ resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==}
+ engines: {node: '>=0.4'}
+ dev: true
+
/y18n@5.0.8:
resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}
engines: {node: '>=10'}
@@ -1310,35 +1349,25 @@ packages:
nested-obj: 0.0.1
dev: true
- /yargs-parser@21.1.1:
- resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==}
- engines: {node: '>=12'}
- dev: true
-
- /yargs-unparser@2.0.0:
- resolution: {integrity: sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==}
+ /yargs-parser@20.2.9:
+ resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==}
engines: {node: '>=10'}
- dependencies:
- camelcase: 6.3.0
- decamelize: 4.0.0
- flat: 5.0.2
- is-plain-obj: 2.1.0
dev: true
- /yargs@17.7.2:
- resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==}
- engines: {node: '>=12'}
+ /yargs@16.2.0:
+ resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==}
+ engines: {node: '>=10'}
dependencies:
- cliui: 8.0.1
+ cliui: 7.0.4
escalade: 3.2.0
get-caller-file: 2.0.5
require-directory: 2.1.1
string-width: 4.2.3
y18n: 5.0.8
- yargs-parser: 21.1.1
+ yargs-parser: 20.2.9
dev: true
- /yocto-queue@0.1.0:
- resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
- engines: {node: '>=10'}
+ /yn@3.1.1:
+ resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==}
+ engines: {node: '>=6'}
dev: true
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index 428cc892..4392b2e2 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -1,2 +1,12 @@
packages:
- - 'libpg-query'
\ No newline at end of file
+ - 'libpg-query'
+ - 'versions/17'
+ - 'versions/16'
+ - 'versions/15'
+ - 'versions/14'
+ - 'versions/13'
+ - 'types/17'
+ - 'types/16'
+ - 'types/15'
+ - 'types/14'
+ - 'types/13'
\ No newline at end of file
diff --git a/protos/13/pg_query.proto b/protos/13/pg_query.proto
new file mode 100644
index 00000000..ddb40dab
--- /dev/null
+++ b/protos/13/pg_query.proto
@@ -0,0 +1,3495 @@
+// This file is autogenerated by ./scripts/generate_protobuf_and_funcs.rb
+
+syntax = "proto3";
+
+package pg_query;
+
+message ParseResult {
+ int32 version = 1;
+ repeated RawStmt stmts = 2;
+}
+
+message ScanResult {
+ int32 version = 1;
+ repeated ScanToken tokens = 2;
+}
+
+message Node {
+ oneof node {
+ Alias alias = 1 [json_name="Alias"];
+ RangeVar range_var = 2 [json_name="RangeVar"];
+ TableFunc table_func = 3 [json_name="TableFunc"];
+ Expr expr = 4 [json_name="Expr"];
+ Var var = 5 [json_name="Var"];
+ Param param = 6 [json_name="Param"];
+ Aggref aggref = 7 [json_name="Aggref"];
+ GroupingFunc grouping_func = 8 [json_name="GroupingFunc"];
+ WindowFunc window_func = 9 [json_name="WindowFunc"];
+ SubscriptingRef subscripting_ref = 10 [json_name="SubscriptingRef"];
+ FuncExpr func_expr = 11 [json_name="FuncExpr"];
+ NamedArgExpr named_arg_expr = 12 [json_name="NamedArgExpr"];
+ OpExpr op_expr = 13 [json_name="OpExpr"];
+ DistinctExpr distinct_expr = 14 [json_name="DistinctExpr"];
+ NullIfExpr null_if_expr = 15 [json_name="NullIfExpr"];
+ ScalarArrayOpExpr scalar_array_op_expr = 16 [json_name="ScalarArrayOpExpr"];
+ BoolExpr bool_expr = 17 [json_name="BoolExpr"];
+ SubLink sub_link = 18 [json_name="SubLink"];
+ SubPlan sub_plan = 19 [json_name="SubPlan"];
+ AlternativeSubPlan alternative_sub_plan = 20 [json_name="AlternativeSubPlan"];
+ FieldSelect field_select = 21 [json_name="FieldSelect"];
+ FieldStore field_store = 22 [json_name="FieldStore"];
+ RelabelType relabel_type = 23 [json_name="RelabelType"];
+ CoerceViaIO coerce_via_io = 24 [json_name="CoerceViaIO"];
+ ArrayCoerceExpr array_coerce_expr = 25 [json_name="ArrayCoerceExpr"];
+ ConvertRowtypeExpr convert_rowtype_expr = 26 [json_name="ConvertRowtypeExpr"];
+ CollateExpr collate_expr = 27 [json_name="CollateExpr"];
+ CaseExpr case_expr = 28 [json_name="CaseExpr"];
+ CaseWhen case_when = 29 [json_name="CaseWhen"];
+ CaseTestExpr case_test_expr = 30 [json_name="CaseTestExpr"];
+ ArrayExpr array_expr = 31 [json_name="ArrayExpr"];
+ RowExpr row_expr = 32 [json_name="RowExpr"];
+ RowCompareExpr row_compare_expr = 33 [json_name="RowCompareExpr"];
+ CoalesceExpr coalesce_expr = 34 [json_name="CoalesceExpr"];
+ MinMaxExpr min_max_expr = 35 [json_name="MinMaxExpr"];
+ SQLValueFunction sqlvalue_function = 36 [json_name="SQLValueFunction"];
+ XmlExpr xml_expr = 37 [json_name="XmlExpr"];
+ NullTest null_test = 38 [json_name="NullTest"];
+ BooleanTest boolean_test = 39 [json_name="BooleanTest"];
+ CoerceToDomain coerce_to_domain = 40 [json_name="CoerceToDomain"];
+ CoerceToDomainValue coerce_to_domain_value = 41 [json_name="CoerceToDomainValue"];
+ SetToDefault set_to_default = 42 [json_name="SetToDefault"];
+ CurrentOfExpr current_of_expr = 43 [json_name="CurrentOfExpr"];
+ NextValueExpr next_value_expr = 44 [json_name="NextValueExpr"];
+ InferenceElem inference_elem = 45 [json_name="InferenceElem"];
+ TargetEntry target_entry = 46 [json_name="TargetEntry"];
+ RangeTblRef range_tbl_ref = 47 [json_name="RangeTblRef"];
+ JoinExpr join_expr = 48 [json_name="JoinExpr"];
+ FromExpr from_expr = 49 [json_name="FromExpr"];
+ OnConflictExpr on_conflict_expr = 50 [json_name="OnConflictExpr"];
+ IntoClause into_clause = 51 [json_name="IntoClause"];
+ RawStmt raw_stmt = 52 [json_name="RawStmt"];
+ Query query = 53 [json_name="Query"];
+ InsertStmt insert_stmt = 54 [json_name="InsertStmt"];
+ DeleteStmt delete_stmt = 55 [json_name="DeleteStmt"];
+ UpdateStmt update_stmt = 56 [json_name="UpdateStmt"];
+ SelectStmt select_stmt = 57 [json_name="SelectStmt"];
+ AlterTableStmt alter_table_stmt = 58 [json_name="AlterTableStmt"];
+ AlterTableCmd alter_table_cmd = 59 [json_name="AlterTableCmd"];
+ AlterDomainStmt alter_domain_stmt = 60 [json_name="AlterDomainStmt"];
+ SetOperationStmt set_operation_stmt = 61 [json_name="SetOperationStmt"];
+ GrantStmt grant_stmt = 62 [json_name="GrantStmt"];
+ GrantRoleStmt grant_role_stmt = 63 [json_name="GrantRoleStmt"];
+ AlterDefaultPrivilegesStmt alter_default_privileges_stmt = 64 [json_name="AlterDefaultPrivilegesStmt"];
+ ClosePortalStmt close_portal_stmt = 65 [json_name="ClosePortalStmt"];
+ ClusterStmt cluster_stmt = 66 [json_name="ClusterStmt"];
+ CopyStmt copy_stmt = 67 [json_name="CopyStmt"];
+ CreateStmt create_stmt = 68 [json_name="CreateStmt"];
+ DefineStmt define_stmt = 69 [json_name="DefineStmt"];
+ DropStmt drop_stmt = 70 [json_name="DropStmt"];
+ TruncateStmt truncate_stmt = 71 [json_name="TruncateStmt"];
+ CommentStmt comment_stmt = 72 [json_name="CommentStmt"];
+ FetchStmt fetch_stmt = 73 [json_name="FetchStmt"];
+ IndexStmt index_stmt = 74 [json_name="IndexStmt"];
+ CreateFunctionStmt create_function_stmt = 75 [json_name="CreateFunctionStmt"];
+ AlterFunctionStmt alter_function_stmt = 76 [json_name="AlterFunctionStmt"];
+ DoStmt do_stmt = 77 [json_name="DoStmt"];
+ RenameStmt rename_stmt = 78 [json_name="RenameStmt"];
+ RuleStmt rule_stmt = 79 [json_name="RuleStmt"];
+ NotifyStmt notify_stmt = 80 [json_name="NotifyStmt"];
+ ListenStmt listen_stmt = 81 [json_name="ListenStmt"];
+ UnlistenStmt unlisten_stmt = 82 [json_name="UnlistenStmt"];
+ TransactionStmt transaction_stmt = 83 [json_name="TransactionStmt"];
+ ViewStmt view_stmt = 84 [json_name="ViewStmt"];
+ LoadStmt load_stmt = 85 [json_name="LoadStmt"];
+ CreateDomainStmt create_domain_stmt = 86 [json_name="CreateDomainStmt"];
+ CreatedbStmt createdb_stmt = 87 [json_name="CreatedbStmt"];
+ DropdbStmt dropdb_stmt = 88 [json_name="DropdbStmt"];
+ VacuumStmt vacuum_stmt = 89 [json_name="VacuumStmt"];
+ ExplainStmt explain_stmt = 90 [json_name="ExplainStmt"];
+ CreateTableAsStmt create_table_as_stmt = 91 [json_name="CreateTableAsStmt"];
+ CreateSeqStmt create_seq_stmt = 92 [json_name="CreateSeqStmt"];
+ AlterSeqStmt alter_seq_stmt = 93 [json_name="AlterSeqStmt"];
+ VariableSetStmt variable_set_stmt = 94 [json_name="VariableSetStmt"];
+ VariableShowStmt variable_show_stmt = 95 [json_name="VariableShowStmt"];
+ DiscardStmt discard_stmt = 96 [json_name="DiscardStmt"];
+ CreateTrigStmt create_trig_stmt = 97 [json_name="CreateTrigStmt"];
+ CreatePLangStmt create_plang_stmt = 98 [json_name="CreatePLangStmt"];
+ CreateRoleStmt create_role_stmt = 99 [json_name="CreateRoleStmt"];
+ AlterRoleStmt alter_role_stmt = 100 [json_name="AlterRoleStmt"];
+ DropRoleStmt drop_role_stmt = 101 [json_name="DropRoleStmt"];
+ LockStmt lock_stmt = 102 [json_name="LockStmt"];
+ ConstraintsSetStmt constraints_set_stmt = 103 [json_name="ConstraintsSetStmt"];
+ ReindexStmt reindex_stmt = 104 [json_name="ReindexStmt"];
+ CheckPointStmt check_point_stmt = 105 [json_name="CheckPointStmt"];
+ CreateSchemaStmt create_schema_stmt = 106 [json_name="CreateSchemaStmt"];
+ AlterDatabaseStmt alter_database_stmt = 107 [json_name="AlterDatabaseStmt"];
+ AlterDatabaseSetStmt alter_database_set_stmt = 108 [json_name="AlterDatabaseSetStmt"];
+ AlterRoleSetStmt alter_role_set_stmt = 109 [json_name="AlterRoleSetStmt"];
+ CreateConversionStmt create_conversion_stmt = 110 [json_name="CreateConversionStmt"];
+ CreateCastStmt create_cast_stmt = 111 [json_name="CreateCastStmt"];
+ CreateOpClassStmt create_op_class_stmt = 112 [json_name="CreateOpClassStmt"];
+ CreateOpFamilyStmt create_op_family_stmt = 113 [json_name="CreateOpFamilyStmt"];
+ AlterOpFamilyStmt alter_op_family_stmt = 114 [json_name="AlterOpFamilyStmt"];
+ PrepareStmt prepare_stmt = 115 [json_name="PrepareStmt"];
+ ExecuteStmt execute_stmt = 116 [json_name="ExecuteStmt"];
+ DeallocateStmt deallocate_stmt = 117 [json_name="DeallocateStmt"];
+ DeclareCursorStmt declare_cursor_stmt = 118 [json_name="DeclareCursorStmt"];
+ CreateTableSpaceStmt create_table_space_stmt = 119 [json_name="CreateTableSpaceStmt"];
+ DropTableSpaceStmt drop_table_space_stmt = 120 [json_name="DropTableSpaceStmt"];
+ AlterObjectDependsStmt alter_object_depends_stmt = 121 [json_name="AlterObjectDependsStmt"];
+ AlterObjectSchemaStmt alter_object_schema_stmt = 122 [json_name="AlterObjectSchemaStmt"];
+ AlterOwnerStmt alter_owner_stmt = 123 [json_name="AlterOwnerStmt"];
+ AlterOperatorStmt alter_operator_stmt = 124 [json_name="AlterOperatorStmt"];
+ AlterTypeStmt alter_type_stmt = 125 [json_name="AlterTypeStmt"];
+ DropOwnedStmt drop_owned_stmt = 126 [json_name="DropOwnedStmt"];
+ ReassignOwnedStmt reassign_owned_stmt = 127 [json_name="ReassignOwnedStmt"];
+ CompositeTypeStmt composite_type_stmt = 128 [json_name="CompositeTypeStmt"];
+ CreateEnumStmt create_enum_stmt = 129 [json_name="CreateEnumStmt"];
+ CreateRangeStmt create_range_stmt = 130 [json_name="CreateRangeStmt"];
+ AlterEnumStmt alter_enum_stmt = 131 [json_name="AlterEnumStmt"];
+ AlterTSDictionaryStmt alter_tsdictionary_stmt = 132 [json_name="AlterTSDictionaryStmt"];
+ AlterTSConfigurationStmt alter_tsconfiguration_stmt = 133 [json_name="AlterTSConfigurationStmt"];
+ CreateFdwStmt create_fdw_stmt = 134 [json_name="CreateFdwStmt"];
+ AlterFdwStmt alter_fdw_stmt = 135 [json_name="AlterFdwStmt"];
+ CreateForeignServerStmt create_foreign_server_stmt = 136 [json_name="CreateForeignServerStmt"];
+ AlterForeignServerStmt alter_foreign_server_stmt = 137 [json_name="AlterForeignServerStmt"];
+ CreateUserMappingStmt create_user_mapping_stmt = 138 [json_name="CreateUserMappingStmt"];
+ AlterUserMappingStmt alter_user_mapping_stmt = 139 [json_name="AlterUserMappingStmt"];
+ DropUserMappingStmt drop_user_mapping_stmt = 140 [json_name="DropUserMappingStmt"];
+ AlterTableSpaceOptionsStmt alter_table_space_options_stmt = 141 [json_name="AlterTableSpaceOptionsStmt"];
+ AlterTableMoveAllStmt alter_table_move_all_stmt = 142 [json_name="AlterTableMoveAllStmt"];
+ SecLabelStmt sec_label_stmt = 143 [json_name="SecLabelStmt"];
+ CreateForeignTableStmt create_foreign_table_stmt = 144 [json_name="CreateForeignTableStmt"];
+ ImportForeignSchemaStmt import_foreign_schema_stmt = 145 [json_name="ImportForeignSchemaStmt"];
+ CreateExtensionStmt create_extension_stmt = 146 [json_name="CreateExtensionStmt"];
+ AlterExtensionStmt alter_extension_stmt = 147 [json_name="AlterExtensionStmt"];
+ AlterExtensionContentsStmt alter_extension_contents_stmt = 148 [json_name="AlterExtensionContentsStmt"];
+ CreateEventTrigStmt create_event_trig_stmt = 149 [json_name="CreateEventTrigStmt"];
+ AlterEventTrigStmt alter_event_trig_stmt = 150 [json_name="AlterEventTrigStmt"];
+ RefreshMatViewStmt refresh_mat_view_stmt = 151 [json_name="RefreshMatViewStmt"];
+ ReplicaIdentityStmt replica_identity_stmt = 152 [json_name="ReplicaIdentityStmt"];
+ AlterSystemStmt alter_system_stmt = 153 [json_name="AlterSystemStmt"];
+ CreatePolicyStmt create_policy_stmt = 154 [json_name="CreatePolicyStmt"];
+ AlterPolicyStmt alter_policy_stmt = 155 [json_name="AlterPolicyStmt"];
+ CreateTransformStmt create_transform_stmt = 156 [json_name="CreateTransformStmt"];
+ CreateAmStmt create_am_stmt = 157 [json_name="CreateAmStmt"];
+ CreatePublicationStmt create_publication_stmt = 158 [json_name="CreatePublicationStmt"];
+ AlterPublicationStmt alter_publication_stmt = 159 [json_name="AlterPublicationStmt"];
+ CreateSubscriptionStmt create_subscription_stmt = 160 [json_name="CreateSubscriptionStmt"];
+ AlterSubscriptionStmt alter_subscription_stmt = 161 [json_name="AlterSubscriptionStmt"];
+ DropSubscriptionStmt drop_subscription_stmt = 162 [json_name="DropSubscriptionStmt"];
+ CreateStatsStmt create_stats_stmt = 163 [json_name="CreateStatsStmt"];
+ AlterCollationStmt alter_collation_stmt = 164 [json_name="AlterCollationStmt"];
+ CallStmt call_stmt = 165 [json_name="CallStmt"];
+ AlterStatsStmt alter_stats_stmt = 166 [json_name="AlterStatsStmt"];
+ A_Expr a_expr = 167 [json_name="A_Expr"];
+ ColumnRef column_ref = 168 [json_name="ColumnRef"];
+ ParamRef param_ref = 169 [json_name="ParamRef"];
+ A_Const a_const = 170 [json_name="A_Const"];
+ FuncCall func_call = 171 [json_name="FuncCall"];
+ A_Star a_star = 172 [json_name="A_Star"];
+ A_Indices a_indices = 173 [json_name="A_Indices"];
+ A_Indirection a_indirection = 174 [json_name="A_Indirection"];
+ A_ArrayExpr a_array_expr = 175 [json_name="A_ArrayExpr"];
+ ResTarget res_target = 176 [json_name="ResTarget"];
+ MultiAssignRef multi_assign_ref = 177 [json_name="MultiAssignRef"];
+ TypeCast type_cast = 178 [json_name="TypeCast"];
+ CollateClause collate_clause = 179 [json_name="CollateClause"];
+ SortBy sort_by = 180 [json_name="SortBy"];
+ WindowDef window_def = 181 [json_name="WindowDef"];
+ RangeSubselect range_subselect = 182 [json_name="RangeSubselect"];
+ RangeFunction range_function = 183 [json_name="RangeFunction"];
+ RangeTableSample range_table_sample = 184 [json_name="RangeTableSample"];
+ RangeTableFunc range_table_func = 185 [json_name="RangeTableFunc"];
+ RangeTableFuncCol range_table_func_col = 186 [json_name="RangeTableFuncCol"];
+ TypeName type_name = 187 [json_name="TypeName"];
+ ColumnDef column_def = 188 [json_name="ColumnDef"];
+ IndexElem index_elem = 189 [json_name="IndexElem"];
+ Constraint constraint = 190 [json_name="Constraint"];
+ DefElem def_elem = 191 [json_name="DefElem"];
+ RangeTblEntry range_tbl_entry = 192 [json_name="RangeTblEntry"];
+ RangeTblFunction range_tbl_function = 193 [json_name="RangeTblFunction"];
+ TableSampleClause table_sample_clause = 194 [json_name="TableSampleClause"];
+ WithCheckOption with_check_option = 195 [json_name="WithCheckOption"];
+ SortGroupClause sort_group_clause = 196 [json_name="SortGroupClause"];
+ GroupingSet grouping_set = 197 [json_name="GroupingSet"];
+ WindowClause window_clause = 198 [json_name="WindowClause"];
+ ObjectWithArgs object_with_args = 199 [json_name="ObjectWithArgs"];
+ AccessPriv access_priv = 200 [json_name="AccessPriv"];
+ CreateOpClassItem create_op_class_item = 201 [json_name="CreateOpClassItem"];
+ TableLikeClause table_like_clause = 202 [json_name="TableLikeClause"];
+ FunctionParameter function_parameter = 203 [json_name="FunctionParameter"];
+ LockingClause locking_clause = 204 [json_name="LockingClause"];
+ RowMarkClause row_mark_clause = 205 [json_name="RowMarkClause"];
+ XmlSerialize xml_serialize = 206 [json_name="XmlSerialize"];
+ WithClause with_clause = 207 [json_name="WithClause"];
+ InferClause infer_clause = 208 [json_name="InferClause"];
+ OnConflictClause on_conflict_clause = 209 [json_name="OnConflictClause"];
+ CommonTableExpr common_table_expr = 210 [json_name="CommonTableExpr"];
+ RoleSpec role_spec = 211 [json_name="RoleSpec"];
+ TriggerTransition trigger_transition = 212 [json_name="TriggerTransition"];
+ PartitionElem partition_elem = 213 [json_name="PartitionElem"];
+ PartitionSpec partition_spec = 214 [json_name="PartitionSpec"];
+ PartitionBoundSpec partition_bound_spec = 215 [json_name="PartitionBoundSpec"];
+ PartitionRangeDatum partition_range_datum = 216 [json_name="PartitionRangeDatum"];
+ PartitionCmd partition_cmd = 217 [json_name="PartitionCmd"];
+ VacuumRelation vacuum_relation = 218 [json_name="VacuumRelation"];
+ InlineCodeBlock inline_code_block = 219 [json_name="InlineCodeBlock"];
+ CallContext call_context = 220 [json_name="CallContext"];
+ Integer integer = 221 [json_name="Integer"];
+ Float float = 222 [json_name="Float"];
+ String string = 223 [json_name="String"];
+ BitString bit_string = 224 [json_name="BitString"];
+ Null null = 225 [json_name="Null"];
+ List list = 226 [json_name="List"];
+ IntList int_list = 227 [json_name="IntList"];
+ OidList oid_list = 228 [json_name="OidList"];
+ }
+}
+
+message Integer
+{
+ int32 ival = 1; /* machine integer */
+}
+
+message Float
+{
+ string str = 1; /* string */
+}
+
+message String
+{
+ string str = 1; /* string */
+}
+
+message BitString
+{
+ string str = 1; /* string */
+}
+
+message Null
+{
+ // intentionally empty
+}
+
+message List
+{
+ repeated Node items = 1;
+}
+
+message OidList
+{
+ repeated Node items = 1;
+}
+
+message IntList
+{
+ repeated Node items = 1;
+}
+
+message Alias
+{
+ string aliasname = 1 [json_name="aliasname"];
+ repeated Node colnames = 2 [json_name="colnames"];
+}
+
+message RangeVar
+{
+ string catalogname = 1 [json_name="catalogname"];
+ string schemaname = 2 [json_name="schemaname"];
+ string relname = 3 [json_name="relname"];
+ bool inh = 4 [json_name="inh"];
+ string relpersistence = 5 [json_name="relpersistence"];
+ Alias alias = 6 [json_name="alias"];
+ int32 location = 7 [json_name="location"];
+}
+
+message TableFunc
+{
+ repeated Node ns_uris = 1 [json_name="ns_uris"];
+ repeated Node ns_names = 2 [json_name="ns_names"];
+ Node docexpr = 3 [json_name="docexpr"];
+ Node rowexpr = 4 [json_name="rowexpr"];
+ repeated Node colnames = 5 [json_name="colnames"];
+ repeated Node coltypes = 6 [json_name="coltypes"];
+ repeated Node coltypmods = 7 [json_name="coltypmods"];
+ repeated Node colcollations = 8 [json_name="colcollations"];
+ repeated Node colexprs = 9 [json_name="colexprs"];
+ repeated Node coldefexprs = 10 [json_name="coldefexprs"];
+ repeated uint64 notnulls = 11 [json_name="notnulls"];
+ int32 ordinalitycol = 12 [json_name="ordinalitycol"];
+ int32 location = 13 [json_name="location"];
+}
+
+message Expr
+{
+}
+
+message Var
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 varno = 2 [json_name="varno"];
+ int32 varattno = 3 [json_name="varattno"];
+ uint32 vartype = 4 [json_name="vartype"];
+ int32 vartypmod = 5 [json_name="vartypmod"];
+ uint32 varcollid = 6 [json_name="varcollid"];
+ uint32 varlevelsup = 7 [json_name="varlevelsup"];
+ uint32 varnosyn = 8 [json_name="varnosyn"];
+ int32 varattnosyn = 9 [json_name="varattnosyn"];
+ int32 location = 10 [json_name="location"];
+}
+
+message Param
+{
+ Node xpr = 1 [json_name="xpr"];
+ ParamKind paramkind = 2 [json_name="paramkind"];
+ int32 paramid = 3 [json_name="paramid"];
+ uint32 paramtype = 4 [json_name="paramtype"];
+ int32 paramtypmod = 5 [json_name="paramtypmod"];
+ uint32 paramcollid = 6 [json_name="paramcollid"];
+ int32 location = 7 [json_name="location"];
+}
+
+message Aggref
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 aggfnoid = 2 [json_name="aggfnoid"];
+ uint32 aggtype = 3 [json_name="aggtype"];
+ uint32 aggcollid = 4 [json_name="aggcollid"];
+ uint32 inputcollid = 5 [json_name="inputcollid"];
+ uint32 aggtranstype = 6 [json_name="aggtranstype"];
+ repeated Node aggargtypes = 7 [json_name="aggargtypes"];
+ repeated Node aggdirectargs = 8 [json_name="aggdirectargs"];
+ repeated Node args = 9 [json_name="args"];
+ repeated Node aggorder = 10 [json_name="aggorder"];
+ repeated Node aggdistinct = 11 [json_name="aggdistinct"];
+ Node aggfilter = 12 [json_name="aggfilter"];
+ bool aggstar = 13 [json_name="aggstar"];
+ bool aggvariadic = 14 [json_name="aggvariadic"];
+ string aggkind = 15 [json_name="aggkind"];
+ uint32 agglevelsup = 16 [json_name="agglevelsup"];
+ AggSplit aggsplit = 17 [json_name="aggsplit"];
+ int32 location = 18 [json_name="location"];
+}
+
+message GroupingFunc
+{
+ Node xpr = 1 [json_name="xpr"];
+ repeated Node args = 2 [json_name="args"];
+ repeated Node refs = 3 [json_name="refs"];
+ repeated Node cols = 4 [json_name="cols"];
+ uint32 agglevelsup = 5 [json_name="agglevelsup"];
+ int32 location = 6 [json_name="location"];
+}
+
+message WindowFunc
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 winfnoid = 2 [json_name="winfnoid"];
+ uint32 wintype = 3 [json_name="wintype"];
+ uint32 wincollid = 4 [json_name="wincollid"];
+ uint32 inputcollid = 5 [json_name="inputcollid"];
+ repeated Node args = 6 [json_name="args"];
+ Node aggfilter = 7 [json_name="aggfilter"];
+ uint32 winref = 8 [json_name="winref"];
+ bool winstar = 9 [json_name="winstar"];
+ bool winagg = 10 [json_name="winagg"];
+ int32 location = 11 [json_name="location"];
+}
+
+message SubscriptingRef
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 refcontainertype = 2 [json_name="refcontainertype"];
+ uint32 refelemtype = 3 [json_name="refelemtype"];
+ int32 reftypmod = 4 [json_name="reftypmod"];
+ uint32 refcollid = 5 [json_name="refcollid"];
+ repeated Node refupperindexpr = 6 [json_name="refupperindexpr"];
+ repeated Node reflowerindexpr = 7 [json_name="reflowerindexpr"];
+ Node refexpr = 8 [json_name="refexpr"];
+ Node refassgnexpr = 9 [json_name="refassgnexpr"];
+}
+
+message FuncExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 funcid = 2 [json_name="funcid"];
+ uint32 funcresulttype = 3 [json_name="funcresulttype"];
+ bool funcretset = 4 [json_name="funcretset"];
+ bool funcvariadic = 5 [json_name="funcvariadic"];
+ CoercionForm funcformat = 6 [json_name="funcformat"];
+ uint32 funccollid = 7 [json_name="funccollid"];
+ uint32 inputcollid = 8 [json_name="inputcollid"];
+ repeated Node args = 9 [json_name="args"];
+ int32 location = 10 [json_name="location"];
+}
+
+message NamedArgExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ string name = 3 [json_name="name"];
+ int32 argnumber = 4 [json_name="argnumber"];
+ int32 location = 5 [json_name="location"];
+}
+
+message OpExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 opno = 2 [json_name="opno"];
+ uint32 opfuncid = 3 [json_name="opfuncid"];
+ uint32 opresulttype = 4 [json_name="opresulttype"];
+ bool opretset = 5 [json_name="opretset"];
+ uint32 opcollid = 6 [json_name="opcollid"];
+ uint32 inputcollid = 7 [json_name="inputcollid"];
+ repeated Node args = 8 [json_name="args"];
+ int32 location = 9 [json_name="location"];
+}
+
+message DistinctExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 opno = 2 [json_name="opno"];
+ uint32 opfuncid = 3 [json_name="opfuncid"];
+ uint32 opresulttype = 4 [json_name="opresulttype"];
+ bool opretset = 5 [json_name="opretset"];
+ uint32 opcollid = 6 [json_name="opcollid"];
+ uint32 inputcollid = 7 [json_name="inputcollid"];
+ repeated Node args = 8 [json_name="args"];
+ int32 location = 9 [json_name="location"];
+}
+
+message NullIfExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 opno = 2 [json_name="opno"];
+ uint32 opfuncid = 3 [json_name="opfuncid"];
+ uint32 opresulttype = 4 [json_name="opresulttype"];
+ bool opretset = 5 [json_name="opretset"];
+ uint32 opcollid = 6 [json_name="opcollid"];
+ uint32 inputcollid = 7 [json_name="inputcollid"];
+ repeated Node args = 8 [json_name="args"];
+ int32 location = 9 [json_name="location"];
+}
+
+message ScalarArrayOpExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 opno = 2 [json_name="opno"];
+ uint32 opfuncid = 3 [json_name="opfuncid"];
+ bool use_or = 4 [json_name="useOr"];
+ uint32 inputcollid = 5 [json_name="inputcollid"];
+ repeated Node args = 6 [json_name="args"];
+ int32 location = 7 [json_name="location"];
+}
+
+message BoolExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ BoolExprType boolop = 2 [json_name="boolop"];
+ repeated Node args = 3 [json_name="args"];
+ int32 location = 4 [json_name="location"];
+}
+
+message SubLink
+{
+ Node xpr = 1 [json_name="xpr"];
+ SubLinkType sub_link_type = 2 [json_name="subLinkType"];
+ int32 sub_link_id = 3 [json_name="subLinkId"];
+ Node testexpr = 4 [json_name="testexpr"];
+ repeated Node oper_name = 5 [json_name="operName"];
+ Node subselect = 6 [json_name="subselect"];
+ int32 location = 7 [json_name="location"];
+}
+
+message SubPlan
+{
+ Node xpr = 1 [json_name="xpr"];
+ SubLinkType sub_link_type = 2 [json_name="subLinkType"];
+ Node testexpr = 3 [json_name="testexpr"];
+ repeated Node param_ids = 4 [json_name="paramIds"];
+ int32 plan_id = 5 [json_name="plan_id"];
+ string plan_name = 6 [json_name="plan_name"];
+ uint32 first_col_type = 7 [json_name="firstColType"];
+ int32 first_col_typmod = 8 [json_name="firstColTypmod"];
+ uint32 first_col_collation = 9 [json_name="firstColCollation"];
+ bool use_hash_table = 10 [json_name="useHashTable"];
+ bool unknown_eq_false = 11 [json_name="unknownEqFalse"];
+ bool parallel_safe = 12 [json_name="parallel_safe"];
+ repeated Node set_param = 13 [json_name="setParam"];
+ repeated Node par_param = 14 [json_name="parParam"];
+ repeated Node args = 15 [json_name="args"];
+ double startup_cost = 16 [json_name="startup_cost"];
+ double per_call_cost = 17 [json_name="per_call_cost"];
+}
+
+message AlternativeSubPlan
+{
+ Node xpr = 1 [json_name="xpr"];
+ repeated Node subplans = 2 [json_name="subplans"];
+}
+
+message FieldSelect
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ int32 fieldnum = 3 [json_name="fieldnum"];
+ uint32 resulttype = 4 [json_name="resulttype"];
+ int32 resulttypmod = 5 [json_name="resulttypmod"];
+ uint32 resultcollid = 6 [json_name="resultcollid"];
+}
+
+message FieldStore
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ repeated Node newvals = 3 [json_name="newvals"];
+ repeated Node fieldnums = 4 [json_name="fieldnums"];
+ uint32 resulttype = 5 [json_name="resulttype"];
+}
+
+message RelabelType
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ uint32 resulttype = 3 [json_name="resulttype"];
+ int32 resulttypmod = 4 [json_name="resulttypmod"];
+ uint32 resultcollid = 5 [json_name="resultcollid"];
+ CoercionForm relabelformat = 6 [json_name="relabelformat"];
+ int32 location = 7 [json_name="location"];
+}
+
+message CoerceViaIO
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ uint32 resulttype = 3 [json_name="resulttype"];
+ uint32 resultcollid = 4 [json_name="resultcollid"];
+ CoercionForm coerceformat = 5 [json_name="coerceformat"];
+ int32 location = 6 [json_name="location"];
+}
+
+message ArrayCoerceExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ Node elemexpr = 3 [json_name="elemexpr"];
+ uint32 resulttype = 4 [json_name="resulttype"];
+ int32 resulttypmod = 5 [json_name="resulttypmod"];
+ uint32 resultcollid = 6 [json_name="resultcollid"];
+ CoercionForm coerceformat = 7 [json_name="coerceformat"];
+ int32 location = 8 [json_name="location"];
+}
+
+message ConvertRowtypeExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ uint32 resulttype = 3 [json_name="resulttype"];
+ CoercionForm convertformat = 4 [json_name="convertformat"];
+ int32 location = 5 [json_name="location"];
+}
+
+message CollateExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ uint32 coll_oid = 3 [json_name="collOid"];
+ int32 location = 4 [json_name="location"];
+}
+
+message CaseExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 casetype = 2 [json_name="casetype"];
+ uint32 casecollid = 3 [json_name="casecollid"];
+ Node arg = 4 [json_name="arg"];
+ repeated Node args = 5 [json_name="args"];
+ Node defresult = 6 [json_name="defresult"];
+ int32 location = 7 [json_name="location"];
+}
+
+message CaseWhen
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node expr = 2 [json_name="expr"];
+ Node result = 3 [json_name="result"];
+ int32 location = 4 [json_name="location"];
+}
+
+message CaseTestExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 type_id = 2 [json_name="typeId"];
+ int32 type_mod = 3 [json_name="typeMod"];
+ uint32 collation = 4 [json_name="collation"];
+}
+
+message ArrayExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 array_typeid = 2 [json_name="array_typeid"];
+ uint32 array_collid = 3 [json_name="array_collid"];
+ uint32 element_typeid = 4 [json_name="element_typeid"];
+ repeated Node elements = 5 [json_name="elements"];
+ bool multidims = 6 [json_name="multidims"];
+ int32 location = 7 [json_name="location"];
+}
+
+message RowExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ repeated Node args = 2 [json_name="args"];
+ uint32 row_typeid = 3 [json_name="row_typeid"];
+ CoercionForm row_format = 4 [json_name="row_format"];
+ repeated Node colnames = 5 [json_name="colnames"];
+ int32 location = 6 [json_name="location"];
+}
+
+message RowCompareExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ RowCompareType rctype = 2 [json_name="rctype"];
+ repeated Node opnos = 3 [json_name="opnos"];
+ repeated Node opfamilies = 4 [json_name="opfamilies"];
+ repeated Node inputcollids = 5 [json_name="inputcollids"];
+ repeated Node largs = 6 [json_name="largs"];
+ repeated Node rargs = 7 [json_name="rargs"];
+}
+
+message CoalesceExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 coalescetype = 2 [json_name="coalescetype"];
+ uint32 coalescecollid = 3 [json_name="coalescecollid"];
+ repeated Node args = 4 [json_name="args"];
+ int32 location = 5 [json_name="location"];
+}
+
+message MinMaxExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 minmaxtype = 2 [json_name="minmaxtype"];
+ uint32 minmaxcollid = 3 [json_name="minmaxcollid"];
+ uint32 inputcollid = 4 [json_name="inputcollid"];
+ MinMaxOp op = 5 [json_name="op"];
+ repeated Node args = 6 [json_name="args"];
+ int32 location = 7 [json_name="location"];
+}
+
+message SQLValueFunction
+{
+ Node xpr = 1 [json_name="xpr"];
+ SQLValueFunctionOp op = 2 [json_name="op"];
+ uint32 type = 3 [json_name="type"];
+ int32 typmod = 4 [json_name="typmod"];
+ int32 location = 5 [json_name="location"];
+}
+
+message XmlExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ XmlExprOp op = 2 [json_name="op"];
+ string name = 3 [json_name="name"];
+ repeated Node named_args = 4 [json_name="named_args"];
+ repeated Node arg_names = 5 [json_name="arg_names"];
+ repeated Node args = 6 [json_name="args"];
+ XmlOptionType xmloption = 7 [json_name="xmloption"];
+ uint32 type = 8 [json_name="type"];
+ int32 typmod = 9 [json_name="typmod"];
+ int32 location = 10 [json_name="location"];
+}
+
+message NullTest
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ NullTestType nulltesttype = 3 [json_name="nulltesttype"];
+ bool argisrow = 4 [json_name="argisrow"];
+ int32 location = 5 [json_name="location"];
+}
+
+message BooleanTest
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ BoolTestType booltesttype = 3 [json_name="booltesttype"];
+ int32 location = 4 [json_name="location"];
+}
+
+message CoerceToDomain
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ uint32 resulttype = 3 [json_name="resulttype"];
+ int32 resulttypmod = 4 [json_name="resulttypmod"];
+ uint32 resultcollid = 5 [json_name="resultcollid"];
+ CoercionForm coercionformat = 6 [json_name="coercionformat"];
+ int32 location = 7 [json_name="location"];
+}
+
+message CoerceToDomainValue
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 type_id = 2 [json_name="typeId"];
+ int32 type_mod = 3 [json_name="typeMod"];
+ uint32 collation = 4 [json_name="collation"];
+ int32 location = 5 [json_name="location"];
+}
+
+message SetToDefault
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 type_id = 2 [json_name="typeId"];
+ int32 type_mod = 3 [json_name="typeMod"];
+ uint32 collation = 4 [json_name="collation"];
+ int32 location = 5 [json_name="location"];
+}
+
+message CurrentOfExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 cvarno = 2 [json_name="cvarno"];
+ string cursor_name = 3 [json_name="cursor_name"];
+ int32 cursor_param = 4 [json_name="cursor_param"];
+}
+
+message NextValueExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 seqid = 2 [json_name="seqid"];
+ uint32 type_id = 3 [json_name="typeId"];
+}
+
+message InferenceElem
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node expr = 2 [json_name="expr"];
+ uint32 infercollid = 3 [json_name="infercollid"];
+ uint32 inferopclass = 4 [json_name="inferopclass"];
+}
+
+message TargetEntry
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node expr = 2 [json_name="expr"];
+ int32 resno = 3 [json_name="resno"];
+ string resname = 4 [json_name="resname"];
+ uint32 ressortgroupref = 5 [json_name="ressortgroupref"];
+ uint32 resorigtbl = 6 [json_name="resorigtbl"];
+ int32 resorigcol = 7 [json_name="resorigcol"];
+ bool resjunk = 8 [json_name="resjunk"];
+}
+
+message RangeTblRef
+{
+ int32 rtindex = 1 [json_name="rtindex"];
+}
+
+message JoinExpr
+{
+ JoinType jointype = 1 [json_name="jointype"];
+ bool is_natural = 2 [json_name="isNatural"];
+ Node larg = 3 [json_name="larg"];
+ Node rarg = 4 [json_name="rarg"];
+ repeated Node using_clause = 5 [json_name="usingClause"];
+ Node quals = 6 [json_name="quals"];
+ Alias alias = 7 [json_name="alias"];
+ int32 rtindex = 8 [json_name="rtindex"];
+}
+
+message FromExpr
+{
+ repeated Node fromlist = 1 [json_name="fromlist"];
+ Node quals = 2 [json_name="quals"];
+}
+
+message OnConflictExpr
+{
+ OnConflictAction action = 1 [json_name="action"];
+ repeated Node arbiter_elems = 2 [json_name="arbiterElems"];
+ Node arbiter_where = 3 [json_name="arbiterWhere"];
+ uint32 constraint = 4 [json_name="constraint"];
+ repeated Node on_conflict_set = 5 [json_name="onConflictSet"];
+ Node on_conflict_where = 6 [json_name="onConflictWhere"];
+ int32 excl_rel_index = 7 [json_name="exclRelIndex"];
+ repeated Node excl_rel_tlist = 8 [json_name="exclRelTlist"];
+}
+
+message IntoClause
+{
+ RangeVar rel = 1 [json_name="rel"];
+ repeated Node col_names = 2 [json_name="colNames"];
+ string access_method = 3 [json_name="accessMethod"];
+ repeated Node options = 4 [json_name="options"];
+ OnCommitAction on_commit = 5 [json_name="onCommit"];
+ string table_space_name = 6 [json_name="tableSpaceName"];
+ Node view_query = 7 [json_name="viewQuery"];
+ bool skip_data = 8 [json_name="skipData"];
+}
+
+message RawStmt
+{
+ Node stmt = 1 [json_name="stmt"];
+ int32 stmt_location = 2 [json_name="stmt_location"];
+ int32 stmt_len = 3 [json_name="stmt_len"];
+}
+
+message Query
+{
+ CmdType command_type = 1 [json_name="commandType"];
+ QuerySource query_source = 2 [json_name="querySource"];
+ bool can_set_tag = 3 [json_name="canSetTag"];
+ Node utility_stmt = 4 [json_name="utilityStmt"];
+ int32 result_relation = 5 [json_name="resultRelation"];
+ bool has_aggs = 6 [json_name="hasAggs"];
+ bool has_window_funcs = 7 [json_name="hasWindowFuncs"];
+ bool has_target_srfs = 8 [json_name="hasTargetSRFs"];
+ bool has_sub_links = 9 [json_name="hasSubLinks"];
+ bool has_distinct_on = 10 [json_name="hasDistinctOn"];
+ bool has_recursive = 11 [json_name="hasRecursive"];
+ bool has_modifying_cte = 12 [json_name="hasModifyingCTE"];
+ bool has_for_update = 13 [json_name="hasForUpdate"];
+ bool has_row_security = 14 [json_name="hasRowSecurity"];
+ repeated Node cte_list = 15 [json_name="cteList"];
+ repeated Node rtable = 16 [json_name="rtable"];
+ FromExpr jointree = 17 [json_name="jointree"];
+ repeated Node target_list = 18 [json_name="targetList"];
+ OverridingKind override = 19 [json_name="override"];
+ OnConflictExpr on_conflict = 20 [json_name="onConflict"];
+ repeated Node returning_list = 21 [json_name="returningList"];
+ repeated Node group_clause = 22 [json_name="groupClause"];
+ repeated Node grouping_sets = 23 [json_name="groupingSets"];
+ Node having_qual = 24 [json_name="havingQual"];
+ repeated Node window_clause = 25 [json_name="windowClause"];
+ repeated Node distinct_clause = 26 [json_name="distinctClause"];
+ repeated Node sort_clause = 27 [json_name="sortClause"];
+ Node limit_offset = 28 [json_name="limitOffset"];
+ Node limit_count = 29 [json_name="limitCount"];
+ LimitOption limit_option = 30 [json_name="limitOption"];
+ repeated Node row_marks = 31 [json_name="rowMarks"];
+ Node set_operations = 32 [json_name="setOperations"];
+ repeated Node constraint_deps = 33 [json_name="constraintDeps"];
+ repeated Node with_check_options = 34 [json_name="withCheckOptions"];
+ int32 stmt_location = 35 [json_name="stmt_location"];
+ int32 stmt_len = 36 [json_name="stmt_len"];
+}
+
+message InsertStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ repeated Node cols = 2 [json_name="cols"];
+ Node select_stmt = 3 [json_name="selectStmt"];
+ OnConflictClause on_conflict_clause = 4 [json_name="onConflictClause"];
+ repeated Node returning_list = 5 [json_name="returningList"];
+ WithClause with_clause = 6 [json_name="withClause"];
+ OverridingKind override = 7 [json_name="override"];
+}
+
+message DeleteStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ repeated Node using_clause = 2 [json_name="usingClause"];
+ Node where_clause = 3 [json_name="whereClause"];
+ repeated Node returning_list = 4 [json_name="returningList"];
+ WithClause with_clause = 5 [json_name="withClause"];
+}
+
+message UpdateStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ repeated Node target_list = 2 [json_name="targetList"];
+ Node where_clause = 3 [json_name="whereClause"];
+ repeated Node from_clause = 4 [json_name="fromClause"];
+ repeated Node returning_list = 5 [json_name="returningList"];
+ WithClause with_clause = 6 [json_name="withClause"];
+}
+
+message SelectStmt
+{
+ repeated Node distinct_clause = 1 [json_name="distinctClause"];
+ IntoClause into_clause = 2 [json_name="intoClause"];
+ repeated Node target_list = 3 [json_name="targetList"];
+ repeated Node from_clause = 4 [json_name="fromClause"];
+ Node where_clause = 5 [json_name="whereClause"];
+ repeated Node group_clause = 6 [json_name="groupClause"];
+ Node having_clause = 7 [json_name="havingClause"];
+ repeated Node window_clause = 8 [json_name="windowClause"];
+ repeated Node values_lists = 9 [json_name="valuesLists"];
+ repeated Node sort_clause = 10 [json_name="sortClause"];
+ Node limit_offset = 11 [json_name="limitOffset"];
+ Node limit_count = 12 [json_name="limitCount"];
+ LimitOption limit_option = 13 [json_name="limitOption"];
+ repeated Node locking_clause = 14 [json_name="lockingClause"];
+ WithClause with_clause = 15 [json_name="withClause"];
+ SetOperation op = 16 [json_name="op"];
+ bool all = 17 [json_name="all"];
+ SelectStmt larg = 18 [json_name="larg"];
+ SelectStmt rarg = 19 [json_name="rarg"];
+}
+
+message AlterTableStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ repeated Node cmds = 2 [json_name="cmds"];
+ ObjectType relkind = 3 [json_name="relkind"];
+ bool missing_ok = 4 [json_name="missing_ok"];
+}
+
+message AlterTableCmd
+{
+ AlterTableType subtype = 1 [json_name="subtype"];
+ string name = 2 [json_name="name"];
+ int32 num = 3 [json_name="num"];
+ RoleSpec newowner = 4 [json_name="newowner"];
+ Node def = 5 [json_name="def"];
+ DropBehavior behavior = 6 [json_name="behavior"];
+ bool missing_ok = 7 [json_name="missing_ok"];
+ bool recurse = 8 [json_name="recurse"];
+}
+
+message AlterDomainStmt
+{
+ string subtype = 1 [json_name="subtype"];
+ repeated Node type_name = 2 [json_name="typeName"];
+ string name = 3 [json_name="name"];
+ Node def = 4 [json_name="def"];
+ DropBehavior behavior = 5 [json_name="behavior"];
+ bool missing_ok = 6 [json_name="missing_ok"];
+}
+
+message SetOperationStmt
+{
+ SetOperation op = 1 [json_name="op"];
+ bool all = 2 [json_name="all"];
+ Node larg = 3 [json_name="larg"];
+ Node rarg = 4 [json_name="rarg"];
+ repeated Node col_types = 5 [json_name="colTypes"];
+ repeated Node col_typmods = 6 [json_name="colTypmods"];
+ repeated Node col_collations = 7 [json_name="colCollations"];
+ repeated Node group_clauses = 8 [json_name="groupClauses"];
+}
+
+message GrantStmt
+{
+ bool is_grant = 1 [json_name="is_grant"];
+ GrantTargetType targtype = 2 [json_name="targtype"];
+ ObjectType objtype = 3 [json_name="objtype"];
+ repeated Node objects = 4 [json_name="objects"];
+ repeated Node privileges = 5 [json_name="privileges"];
+ repeated Node grantees = 6 [json_name="grantees"];
+ bool grant_option = 7 [json_name="grant_option"];
+ DropBehavior behavior = 8 [json_name="behavior"];
+}
+
+message GrantRoleStmt
+{
+ repeated Node granted_roles = 1 [json_name="granted_roles"];
+ repeated Node grantee_roles = 2 [json_name="grantee_roles"];
+ bool is_grant = 3 [json_name="is_grant"];
+ bool admin_opt = 4 [json_name="admin_opt"];
+ RoleSpec grantor = 5 [json_name="grantor"];
+ DropBehavior behavior = 6 [json_name="behavior"];
+}
+
+message AlterDefaultPrivilegesStmt
+{
+ repeated Node options = 1 [json_name="options"];
+ GrantStmt action = 2 [json_name="action"];
+}
+
+message ClosePortalStmt
+{
+ string portalname = 1 [json_name="portalname"];
+}
+
+message ClusterStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ string indexname = 2 [json_name="indexname"];
+ int32 options = 3 [json_name="options"];
+}
+
+message CopyStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ Node query = 2 [json_name="query"];
+ repeated Node attlist = 3 [json_name="attlist"];
+ bool is_from = 4 [json_name="is_from"];
+ bool is_program = 5 [json_name="is_program"];
+ string filename = 6 [json_name="filename"];
+ repeated Node options = 7 [json_name="options"];
+ Node where_clause = 8 [json_name="whereClause"];
+}
+
+message CreateStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ repeated Node table_elts = 2 [json_name="tableElts"];
+ repeated Node inh_relations = 3 [json_name="inhRelations"];
+ PartitionBoundSpec partbound = 4 [json_name="partbound"];
+ PartitionSpec partspec = 5 [json_name="partspec"];
+ TypeName of_typename = 6 [json_name="ofTypename"];
+ repeated Node constraints = 7 [json_name="constraints"];
+ repeated Node options = 8 [json_name="options"];
+ OnCommitAction oncommit = 9 [json_name="oncommit"];
+ string tablespacename = 10 [json_name="tablespacename"];
+ string access_method = 11 [json_name="accessMethod"];
+ bool if_not_exists = 12 [json_name="if_not_exists"];
+}
+
+message DefineStmt
+{
+ ObjectType kind = 1 [json_name="kind"];
+ bool oldstyle = 2 [json_name="oldstyle"];
+ repeated Node defnames = 3 [json_name="defnames"];
+ repeated Node args = 4 [json_name="args"];
+ repeated Node definition = 5 [json_name="definition"];
+ bool if_not_exists = 6 [json_name="if_not_exists"];
+ bool replace = 7 [json_name="replace"];
+}
+
+message DropStmt
+{
+ repeated Node objects = 1 [json_name="objects"];
+ ObjectType remove_type = 2 [json_name="removeType"];
+ DropBehavior behavior = 3 [json_name="behavior"];
+ bool missing_ok = 4 [json_name="missing_ok"];
+ bool concurrent = 5 [json_name="concurrent"];
+}
+
+message TruncateStmt
+{
+ repeated Node relations = 1 [json_name="relations"];
+ bool restart_seqs = 2 [json_name="restart_seqs"];
+ DropBehavior behavior = 3 [json_name="behavior"];
+}
+
+message CommentStmt
+{
+ ObjectType objtype = 1 [json_name="objtype"];
+ Node object = 2 [json_name="object"];
+ string comment = 3 [json_name="comment"];
+}
+
+message FetchStmt
+{
+ FetchDirection direction = 1 [json_name="direction"];
+ int64 how_many = 2 [json_name="howMany"];
+ string portalname = 3 [json_name="portalname"];
+ bool ismove = 4 [json_name="ismove"];
+}
+
+message IndexStmt
+{
+ string idxname = 1 [json_name="idxname"];
+ RangeVar relation = 2 [json_name="relation"];
+ string access_method = 3 [json_name="accessMethod"];
+ string table_space = 4 [json_name="tableSpace"];
+ repeated Node index_params = 5 [json_name="indexParams"];
+ repeated Node index_including_params = 6 [json_name="indexIncludingParams"];
+ repeated Node options = 7 [json_name="options"];
+ Node where_clause = 8 [json_name="whereClause"];
+ repeated Node exclude_op_names = 9 [json_name="excludeOpNames"];
+ string idxcomment = 10 [json_name="idxcomment"];
+ uint32 index_oid = 11 [json_name="indexOid"];
+ uint32 old_node = 12 [json_name="oldNode"];
+ uint32 old_create_subid = 13 [json_name="oldCreateSubid"];
+ uint32 old_first_relfilenode_subid = 14 [json_name="oldFirstRelfilenodeSubid"];
+ bool unique = 15 [json_name="unique"];
+ bool primary = 16 [json_name="primary"];
+ bool isconstraint = 17 [json_name="isconstraint"];
+ bool deferrable = 18 [json_name="deferrable"];
+ bool initdeferred = 19 [json_name="initdeferred"];
+ bool transformed = 20 [json_name="transformed"];
+ bool concurrent = 21 [json_name="concurrent"];
+ bool if_not_exists = 22 [json_name="if_not_exists"];
+ bool reset_default_tblspc = 23 [json_name="reset_default_tblspc"];
+}
+
+message CreateFunctionStmt
+{
+ bool is_procedure = 1 [json_name="is_procedure"];
+ bool replace = 2 [json_name="replace"];
+ repeated Node funcname = 3 [json_name="funcname"];
+ repeated Node parameters = 4 [json_name="parameters"];
+ TypeName return_type = 5 [json_name="returnType"];
+ repeated Node options = 6 [json_name="options"];
+}
+
+message AlterFunctionStmt
+{
+ ObjectType objtype = 1 [json_name="objtype"];
+ ObjectWithArgs func = 2 [json_name="func"];
+ repeated Node actions = 3 [json_name="actions"];
+}
+
+message DoStmt
+{
+ repeated Node args = 1 [json_name="args"];
+}
+
+message RenameStmt
+{
+ ObjectType rename_type = 1 [json_name="renameType"];
+ ObjectType relation_type = 2 [json_name="relationType"];
+ RangeVar relation = 3 [json_name="relation"];
+ Node object = 4 [json_name="object"];
+ string subname = 5 [json_name="subname"];
+ string newname = 6 [json_name="newname"];
+ DropBehavior behavior = 7 [json_name="behavior"];
+ bool missing_ok = 8 [json_name="missing_ok"];
+}
+
+message RuleStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ string rulename = 2 [json_name="rulename"];
+ Node where_clause = 3 [json_name="whereClause"];
+ CmdType event = 4 [json_name="event"];
+ bool instead = 5 [json_name="instead"];
+ repeated Node actions = 6 [json_name="actions"];
+ bool replace = 7 [json_name="replace"];
+}
+
+message NotifyStmt
+{
+ string conditionname = 1 [json_name="conditionname"];
+ string payload = 2 [json_name="payload"];
+}
+
+message ListenStmt
+{
+ string conditionname = 1 [json_name="conditionname"];
+}
+
+message UnlistenStmt
+{
+ string conditionname = 1 [json_name="conditionname"];
+}
+
+message TransactionStmt
+{
+ TransactionStmtKind kind = 1 [json_name="kind"];
+ repeated Node options = 2 [json_name="options"];
+ string savepoint_name = 3 [json_name="savepoint_name"];
+ string gid = 4 [json_name="gid"];
+ bool chain = 5 [json_name="chain"];
+}
+
+message ViewStmt
+{
+ RangeVar view = 1 [json_name="view"];
+ repeated Node aliases = 2 [json_name="aliases"];
+ Node query = 3 [json_name="query"];
+ bool replace = 4 [json_name="replace"];
+ repeated Node options = 5 [json_name="options"];
+ ViewCheckOption with_check_option = 6 [json_name="withCheckOption"];
+}
+
+message LoadStmt
+{
+ string filename = 1 [json_name="filename"];
+}
+
+message CreateDomainStmt
+{
+ repeated Node domainname = 1 [json_name="domainname"];
+ TypeName type_name = 2 [json_name="typeName"];
+ CollateClause coll_clause = 3 [json_name="collClause"];
+ repeated Node constraints = 4 [json_name="constraints"];
+}
+
+message CreatedbStmt
+{
+ string dbname = 1 [json_name="dbname"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message DropdbStmt
+{
+ string dbname = 1 [json_name="dbname"];
+ bool missing_ok = 2 [json_name="missing_ok"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message VacuumStmt
+{
+ repeated Node options = 1 [json_name="options"];
+ repeated Node rels = 2 [json_name="rels"];
+ bool is_vacuumcmd = 3 [json_name="is_vacuumcmd"];
+}
+
+message ExplainStmt
+{
+ Node query = 1 [json_name="query"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message CreateTableAsStmt
+{
+ Node query = 1 [json_name="query"];
+ IntoClause into = 2 [json_name="into"];
+ ObjectType relkind = 3 [json_name="relkind"];
+ bool is_select_into = 4 [json_name="is_select_into"];
+ bool if_not_exists = 5 [json_name="if_not_exists"];
+}
+
+message CreateSeqStmt
+{
+ RangeVar sequence = 1 [json_name="sequence"];
+ repeated Node options = 2 [json_name="options"];
+ uint32 owner_id = 3 [json_name="ownerId"];
+ bool for_identity = 4 [json_name="for_identity"];
+ bool if_not_exists = 5 [json_name="if_not_exists"];
+}
+
+message AlterSeqStmt
+{
+ RangeVar sequence = 1 [json_name="sequence"];
+ repeated Node options = 2 [json_name="options"];
+ bool for_identity = 3 [json_name="for_identity"];
+ bool missing_ok = 4 [json_name="missing_ok"];
+}
+
+message VariableSetStmt
+{
+ VariableSetKind kind = 1 [json_name="kind"];
+ string name = 2 [json_name="name"];
+ repeated Node args = 3 [json_name="args"];
+ bool is_local = 4 [json_name="is_local"];
+}
+
+message VariableShowStmt
+{
+ string name = 1 [json_name="name"];
+}
+
+message DiscardStmt
+{
+ DiscardMode target = 1 [json_name="target"];
+}
+
+message CreateTrigStmt
+{
+ string trigname = 1 [json_name="trigname"];
+ RangeVar relation = 2 [json_name="relation"];
+ repeated Node funcname = 3 [json_name="funcname"];
+ repeated Node args = 4 [json_name="args"];
+ bool row = 5 [json_name="row"];
+ int32 timing = 6 [json_name="timing"];
+ int32 events = 7 [json_name="events"];
+ repeated Node columns = 8 [json_name="columns"];
+ Node when_clause = 9 [json_name="whenClause"];
+ bool isconstraint = 10 [json_name="isconstraint"];
+ repeated Node transition_rels = 11 [json_name="transitionRels"];
+ bool deferrable = 12 [json_name="deferrable"];
+ bool initdeferred = 13 [json_name="initdeferred"];
+ RangeVar constrrel = 14 [json_name="constrrel"];
+}
+
+message CreatePLangStmt
+{
+ bool replace = 1 [json_name="replace"];
+ string plname = 2 [json_name="plname"];
+ repeated Node plhandler = 3 [json_name="plhandler"];
+ repeated Node plinline = 4 [json_name="plinline"];
+ repeated Node plvalidator = 5 [json_name="plvalidator"];
+ bool pltrusted = 6 [json_name="pltrusted"];
+}
+
+message CreateRoleStmt
+{
+ RoleStmtType stmt_type = 1 [json_name="stmt_type"];
+ string role = 2 [json_name="role"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message AlterRoleStmt
+{
+ RoleSpec role = 1 [json_name="role"];
+ repeated Node options = 2 [json_name="options"];
+ int32 action = 3 [json_name="action"];
+}
+
+message DropRoleStmt
+{
+ repeated Node roles = 1 [json_name="roles"];
+ bool missing_ok = 2 [json_name="missing_ok"];
+}
+
+message LockStmt
+{
+ repeated Node relations = 1 [json_name="relations"];
+ int32 mode = 2 [json_name="mode"];
+ bool nowait = 3 [json_name="nowait"];
+}
+
+message ConstraintsSetStmt
+{
+ repeated Node constraints = 1 [json_name="constraints"];
+ bool deferred = 2 [json_name="deferred"];
+}
+
+message ReindexStmt
+{
+ ReindexObjectType kind = 1 [json_name="kind"];
+ RangeVar relation = 2 [json_name="relation"];
+ string name = 3 [json_name="name"];
+ int32 options = 4 [json_name="options"];
+ bool concurrent = 5 [json_name="concurrent"];
+}
+
+message CheckPointStmt
+{
+}
+
+message CreateSchemaStmt
+{
+ string schemaname = 1 [json_name="schemaname"];
+ RoleSpec authrole = 2 [json_name="authrole"];
+ repeated Node schema_elts = 3 [json_name="schemaElts"];
+ bool if_not_exists = 4 [json_name="if_not_exists"];
+}
+
+message AlterDatabaseStmt
+{
+ string dbname = 1 [json_name="dbname"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message AlterDatabaseSetStmt
+{
+ string dbname = 1 [json_name="dbname"];
+ VariableSetStmt setstmt = 2 [json_name="setstmt"];
+}
+
+message AlterRoleSetStmt
+{
+ RoleSpec role = 1 [json_name="role"];
+ string database = 2 [json_name="database"];
+ VariableSetStmt setstmt = 3 [json_name="setstmt"];
+}
+
+message CreateConversionStmt
+{
+ repeated Node conversion_name = 1 [json_name="conversion_name"];
+ string for_encoding_name = 2 [json_name="for_encoding_name"];
+ string to_encoding_name = 3 [json_name="to_encoding_name"];
+ repeated Node func_name = 4 [json_name="func_name"];
+ bool def = 5 [json_name="def"];
+}
+
+message CreateCastStmt
+{
+ TypeName sourcetype = 1 [json_name="sourcetype"];
+ TypeName targettype = 2 [json_name="targettype"];
+ ObjectWithArgs func = 3 [json_name="func"];
+ CoercionContext context = 4 [json_name="context"];
+ bool inout = 5 [json_name="inout"];
+}
+
+message CreateOpClassStmt
+{
+ repeated Node opclassname = 1 [json_name="opclassname"];
+ repeated Node opfamilyname = 2 [json_name="opfamilyname"];
+ string amname = 3 [json_name="amname"];
+ TypeName datatype = 4 [json_name="datatype"];
+ repeated Node items = 5 [json_name="items"];
+ bool is_default = 6 [json_name="isDefault"];
+}
+
+message CreateOpFamilyStmt
+{
+ repeated Node opfamilyname = 1 [json_name="opfamilyname"];
+ string amname = 2 [json_name="amname"];
+}
+
+message AlterOpFamilyStmt
+{
+ repeated Node opfamilyname = 1 [json_name="opfamilyname"];
+ string amname = 2 [json_name="amname"];
+ bool is_drop = 3 [json_name="isDrop"];
+ repeated Node items = 4 [json_name="items"];
+}
+
+message PrepareStmt
+{
+ string name = 1 [json_name="name"];
+ repeated Node argtypes = 2 [json_name="argtypes"];
+ Node query = 3 [json_name="query"];
+}
+
+message ExecuteStmt
+{
+ string name = 1 [json_name="name"];
+ repeated Node params = 2 [json_name="params"];
+}
+
+message DeallocateStmt
+{
+ string name = 1 [json_name="name"];
+}
+
+message DeclareCursorStmt
+{
+ string portalname = 1 [json_name="portalname"];
+ int32 options = 2 [json_name="options"];
+ Node query = 3 [json_name="query"];
+}
+
+message CreateTableSpaceStmt
+{
+ string tablespacename = 1 [json_name="tablespacename"];
+ RoleSpec owner = 2 [json_name="owner"];
+ string location = 3 [json_name="location"];
+ repeated Node options = 4 [json_name="options"];
+}
+
+message DropTableSpaceStmt
+{
+ string tablespacename = 1 [json_name="tablespacename"];
+ bool missing_ok = 2 [json_name="missing_ok"];
+}
+
+message AlterObjectDependsStmt
+{
+ ObjectType object_type = 1 [json_name="objectType"];
+ RangeVar relation = 2 [json_name="relation"];
+ Node object = 3 [json_name="object"];
+ Node extname = 4 [json_name="extname"];
+ bool remove = 5 [json_name="remove"];
+}
+
+message AlterObjectSchemaStmt
+{
+ ObjectType object_type = 1 [json_name="objectType"];
+ RangeVar relation = 2 [json_name="relation"];
+ Node object = 3 [json_name="object"];
+ string newschema = 4 [json_name="newschema"];
+ bool missing_ok = 5 [json_name="missing_ok"];
+}
+
+message AlterOwnerStmt
+{
+ ObjectType object_type = 1 [json_name="objectType"];
+ RangeVar relation = 2 [json_name="relation"];
+ Node object = 3 [json_name="object"];
+ RoleSpec newowner = 4 [json_name="newowner"];
+}
+
+message AlterOperatorStmt
+{
+ ObjectWithArgs opername = 1 [json_name="opername"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message AlterTypeStmt
+{
+ repeated Node type_name = 1 [json_name="typeName"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message DropOwnedStmt
+{
+ repeated Node roles = 1 [json_name="roles"];
+ DropBehavior behavior = 2 [json_name="behavior"];
+}
+
+message ReassignOwnedStmt
+{
+ repeated Node roles = 1 [json_name="roles"];
+ RoleSpec newrole = 2 [json_name="newrole"];
+}
+
+message CompositeTypeStmt
+{
+ RangeVar typevar = 1 [json_name="typevar"];
+ repeated Node coldeflist = 2 [json_name="coldeflist"];
+}
+
+message CreateEnumStmt
+{
+ repeated Node type_name = 1 [json_name="typeName"];
+ repeated Node vals = 2 [json_name="vals"];
+}
+
+message CreateRangeStmt
+{
+ repeated Node type_name = 1 [json_name="typeName"];
+ repeated Node params = 2 [json_name="params"];
+}
+
+message AlterEnumStmt
+{
+ repeated Node type_name = 1 [json_name="typeName"];
+ string old_val = 2 [json_name="oldVal"];
+ string new_val = 3 [json_name="newVal"];
+ string new_val_neighbor = 4 [json_name="newValNeighbor"];
+ bool new_val_is_after = 5 [json_name="newValIsAfter"];
+ bool skip_if_new_val_exists = 6 [json_name="skipIfNewValExists"];
+}
+
+message AlterTSDictionaryStmt
+{
+ repeated Node dictname = 1 [json_name="dictname"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message AlterTSConfigurationStmt
+{
+ AlterTSConfigType kind = 1 [json_name="kind"];
+ repeated Node cfgname = 2 [json_name="cfgname"];
+ repeated Node tokentype = 3 [json_name="tokentype"];
+ repeated Node dicts = 4 [json_name="dicts"];
+ bool override = 5 [json_name="override"];
+ bool replace = 6 [json_name="replace"];
+ bool missing_ok = 7 [json_name="missing_ok"];
+}
+
+message CreateFdwStmt
+{
+ string fdwname = 1 [json_name="fdwname"];
+ repeated Node func_options = 2 [json_name="func_options"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message AlterFdwStmt
+{
+ string fdwname = 1 [json_name="fdwname"];
+ repeated Node func_options = 2 [json_name="func_options"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message CreateForeignServerStmt
+{
+ string servername = 1 [json_name="servername"];
+ string servertype = 2 [json_name="servertype"];
+ string version = 3 [json_name="version"];
+ string fdwname = 4 [json_name="fdwname"];
+ bool if_not_exists = 5 [json_name="if_not_exists"];
+ repeated Node options = 6 [json_name="options"];
+}
+
+message AlterForeignServerStmt
+{
+ string servername = 1 [json_name="servername"];
+ string version = 2 [json_name="version"];
+ repeated Node options = 3 [json_name="options"];
+ bool has_version = 4 [json_name="has_version"];
+}
+
+message CreateUserMappingStmt
+{
+ RoleSpec user = 1 [json_name="user"];
+ string servername = 2 [json_name="servername"];
+ bool if_not_exists = 3 [json_name="if_not_exists"];
+ repeated Node options = 4 [json_name="options"];
+}
+
+message AlterUserMappingStmt
+{
+ RoleSpec user = 1 [json_name="user"];
+ string servername = 2 [json_name="servername"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message DropUserMappingStmt
+{
+ RoleSpec user = 1 [json_name="user"];
+ string servername = 2 [json_name="servername"];
+ bool missing_ok = 3 [json_name="missing_ok"];
+}
+
+message AlterTableSpaceOptionsStmt
+{
+ string tablespacename = 1 [json_name="tablespacename"];
+ repeated Node options = 2 [json_name="options"];
+ bool is_reset = 3 [json_name="isReset"];
+}
+
+message AlterTableMoveAllStmt
+{
+ string orig_tablespacename = 1 [json_name="orig_tablespacename"];
+ ObjectType objtype = 2 [json_name="objtype"];
+ repeated Node roles = 3 [json_name="roles"];
+ string new_tablespacename = 4 [json_name="new_tablespacename"];
+ bool nowait = 5 [json_name="nowait"];
+}
+
+message SecLabelStmt
+{
+ ObjectType objtype = 1 [json_name="objtype"];
+ Node object = 2 [json_name="object"];
+ string provider = 3 [json_name="provider"];
+ string label = 4 [json_name="label"];
+}
+
+message CreateForeignTableStmt
+{
+ CreateStmt base_stmt = 1 [json_name="base"];
+ string servername = 2 [json_name="servername"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message ImportForeignSchemaStmt
+{
+ string server_name = 1 [json_name="server_name"];
+ string remote_schema = 2 [json_name="remote_schema"];
+ string local_schema = 3 [json_name="local_schema"];
+ ImportForeignSchemaType list_type = 4 [json_name="list_type"];
+ repeated Node table_list = 5 [json_name="table_list"];
+ repeated Node options = 6 [json_name="options"];
+}
+
+message CreateExtensionStmt
+{
+ string extname = 1 [json_name="extname"];
+ bool if_not_exists = 2 [json_name="if_not_exists"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message AlterExtensionStmt
+{
+ string extname = 1 [json_name="extname"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message AlterExtensionContentsStmt
+{
+ string extname = 1 [json_name="extname"];
+ int32 action = 2 [json_name="action"];
+ ObjectType objtype = 3 [json_name="objtype"];
+ Node object = 4 [json_name="object"];
+}
+
+message CreateEventTrigStmt
+{
+ string trigname = 1 [json_name="trigname"];
+ string eventname = 2 [json_name="eventname"];
+ repeated Node whenclause = 3 [json_name="whenclause"];
+ repeated Node funcname = 4 [json_name="funcname"];
+}
+
+message AlterEventTrigStmt
+{
+ string trigname = 1 [json_name="trigname"];
+ string tgenabled = 2 [json_name="tgenabled"];
+}
+
+message RefreshMatViewStmt
+{
+ bool concurrent = 1 [json_name="concurrent"];
+ bool skip_data = 2 [json_name="skipData"];
+ RangeVar relation = 3 [json_name="relation"];
+}
+
+message ReplicaIdentityStmt
+{
+ string identity_type = 1 [json_name="identity_type"];
+ string name = 2 [json_name="name"];
+}
+
+message AlterSystemStmt
+{
+ VariableSetStmt setstmt = 1 [json_name="setstmt"];
+}
+
+message CreatePolicyStmt
+{
+ string policy_name = 1 [json_name="policy_name"];
+ RangeVar table = 2 [json_name="table"];
+ string cmd_name = 3 [json_name="cmd_name"];
+ bool permissive = 4 [json_name="permissive"];
+ repeated Node roles = 5 [json_name="roles"];
+ Node qual = 6 [json_name="qual"];
+ Node with_check = 7 [json_name="with_check"];
+}
+
+message AlterPolicyStmt
+{
+ string policy_name = 1 [json_name="policy_name"];
+ RangeVar table = 2 [json_name="table"];
+ repeated Node roles = 3 [json_name="roles"];
+ Node qual = 4 [json_name="qual"];
+ Node with_check = 5 [json_name="with_check"];
+}
+
+message CreateTransformStmt
+{
+ bool replace = 1 [json_name="replace"];
+ TypeName type_name = 2 [json_name="type_name"];
+ string lang = 3 [json_name="lang"];
+ ObjectWithArgs fromsql = 4 [json_name="fromsql"];
+ ObjectWithArgs tosql = 5 [json_name="tosql"];
+}
+
+message CreateAmStmt
+{
+ string amname = 1 [json_name="amname"];
+ repeated Node handler_name = 2 [json_name="handler_name"];
+ string amtype = 3 [json_name="amtype"];
+}
+
+message CreatePublicationStmt
+{
+ string pubname = 1 [json_name="pubname"];
+ repeated Node options = 2 [json_name="options"];
+ repeated Node tables = 3 [json_name="tables"];
+ bool for_all_tables = 4 [json_name="for_all_tables"];
+}
+
+message AlterPublicationStmt
+{
+ string pubname = 1 [json_name="pubname"];
+ repeated Node options = 2 [json_name="options"];
+ repeated Node tables = 3 [json_name="tables"];
+ bool for_all_tables = 4 [json_name="for_all_tables"];
+ DefElemAction table_action = 5 [json_name="tableAction"];
+}
+
+message CreateSubscriptionStmt
+{
+ string subname = 1 [json_name="subname"];
+ string conninfo = 2 [json_name="conninfo"];
+ repeated Node publication = 3 [json_name="publication"];
+ repeated Node options = 4 [json_name="options"];
+}
+
+message AlterSubscriptionStmt
+{
+ AlterSubscriptionType kind = 1 [json_name="kind"];
+ string subname = 2 [json_name="subname"];
+ string conninfo = 3 [json_name="conninfo"];
+ repeated Node publication = 4 [json_name="publication"];
+ repeated Node options = 5 [json_name="options"];
+}
+
+message DropSubscriptionStmt
+{
+ string subname = 1 [json_name="subname"];
+ bool missing_ok = 2 [json_name="missing_ok"];
+ DropBehavior behavior = 3 [json_name="behavior"];
+}
+
+message CreateStatsStmt
+{
+ repeated Node defnames = 1 [json_name="defnames"];
+ repeated Node stat_types = 2 [json_name="stat_types"];
+ repeated Node exprs = 3 [json_name="exprs"];
+ repeated Node relations = 4 [json_name="relations"];
+ string stxcomment = 5 [json_name="stxcomment"];
+ bool if_not_exists = 6 [json_name="if_not_exists"];
+}
+
+message AlterCollationStmt
+{
+ repeated Node collname = 1 [json_name="collname"];
+}
+
+message CallStmt
+{
+ FuncCall funccall = 1 [json_name="funccall"];
+ FuncExpr funcexpr = 2 [json_name="funcexpr"];
+}
+
+message AlterStatsStmt
+{
+ repeated Node defnames = 1 [json_name="defnames"];
+ int32 stxstattarget = 2 [json_name="stxstattarget"];
+ bool missing_ok = 3 [json_name="missing_ok"];
+}
+
+message A_Expr
+{
+ A_Expr_Kind kind = 1 [json_name="kind"];
+ repeated Node name = 2 [json_name="name"];
+ Node lexpr = 3 [json_name="lexpr"];
+ Node rexpr = 4 [json_name="rexpr"];
+ int32 location = 5 [json_name="location"];
+}
+
+message ColumnRef
+{
+ repeated Node fields = 1 [json_name="fields"];
+ int32 location = 2 [json_name="location"];
+}
+
+message ParamRef
+{
+ int32 number = 1 [json_name="number"];
+ int32 location = 2 [json_name="location"];
+}
+
+message A_Const
+{
+ Node val = 1 [json_name="val"];
+ int32 location = 2 [json_name="location"];
+}
+
+message FuncCall
+{
+ repeated Node funcname = 1 [json_name="funcname"];
+ repeated Node args = 2 [json_name="args"];
+ repeated Node agg_order = 3 [json_name="agg_order"];
+ Node agg_filter = 4 [json_name="agg_filter"];
+ bool agg_within_group = 5 [json_name="agg_within_group"];
+ bool agg_star = 6 [json_name="agg_star"];
+ bool agg_distinct = 7 [json_name="agg_distinct"];
+ bool func_variadic = 8 [json_name="func_variadic"];
+ WindowDef over = 9 [json_name="over"];
+ int32 location = 10 [json_name="location"];
+}
+
+message A_Star
+{
+}
+
+message A_Indices
+{
+ bool is_slice = 1 [json_name="is_slice"];
+ Node lidx = 2 [json_name="lidx"];
+ Node uidx = 3 [json_name="uidx"];
+}
+
+message A_Indirection
+{
+ Node arg = 1 [json_name="arg"];
+ repeated Node indirection = 2 [json_name="indirection"];
+}
+
+message A_ArrayExpr
+{
+ repeated Node elements = 1 [json_name="elements"];
+ int32 location = 2 [json_name="location"];
+}
+
+message ResTarget
+{
+ string name = 1 [json_name="name"];
+ repeated Node indirection = 2 [json_name="indirection"];
+ Node val = 3 [json_name="val"];
+ int32 location = 4 [json_name="location"];
+}
+
+message MultiAssignRef
+{
+ Node source = 1 [json_name="source"];
+ int32 colno = 2 [json_name="colno"];
+ int32 ncolumns = 3 [json_name="ncolumns"];
+}
+
+message TypeCast
+{
+ Node arg = 1 [json_name="arg"];
+ TypeName type_name = 2 [json_name="typeName"];
+ int32 location = 3 [json_name="location"];
+}
+
+message CollateClause
+{
+ Node arg = 1 [json_name="arg"];
+ repeated Node collname = 2 [json_name="collname"];
+ int32 location = 3 [json_name="location"];
+}
+
+message SortBy
+{
+ Node node = 1 [json_name="node"];
+ SortByDir sortby_dir = 2 [json_name="sortby_dir"];
+ SortByNulls sortby_nulls = 3 [json_name="sortby_nulls"];
+ repeated Node use_op = 4 [json_name="useOp"];
+ int32 location = 5 [json_name="location"];
+}
+
+message WindowDef
+{
+ string name = 1 [json_name="name"];
+ string refname = 2 [json_name="refname"];
+ repeated Node partition_clause = 3 [json_name="partitionClause"];
+ repeated Node order_clause = 4 [json_name="orderClause"];
+ int32 frame_options = 5 [json_name="frameOptions"];
+ Node start_offset = 6 [json_name="startOffset"];
+ Node end_offset = 7 [json_name="endOffset"];
+ int32 location = 8 [json_name="location"];
+}
+
+message RangeSubselect
+{
+ bool lateral = 1 [json_name="lateral"];
+ Node subquery = 2 [json_name="subquery"];
+ Alias alias = 3 [json_name="alias"];
+}
+
+message RangeFunction
+{
+ bool lateral = 1 [json_name="lateral"];
+ bool ordinality = 2 [json_name="ordinality"];
+ bool is_rowsfrom = 3 [json_name="is_rowsfrom"];
+ repeated Node functions = 4 [json_name="functions"];
+ Alias alias = 5 [json_name="alias"];
+ repeated Node coldeflist = 6 [json_name="coldeflist"];
+}
+
+message RangeTableSample
+{
+ Node relation = 1 [json_name="relation"];
+ repeated Node method = 2 [json_name="method"];
+ repeated Node args = 3 [json_name="args"];
+ Node repeatable = 4 [json_name="repeatable"];
+ int32 location = 5 [json_name="location"];
+}
+
+message RangeTableFunc
+{
+ bool lateral = 1 [json_name="lateral"];
+ Node docexpr = 2 [json_name="docexpr"];
+ Node rowexpr = 3 [json_name="rowexpr"];
+ repeated Node namespaces = 4 [json_name="namespaces"];
+ repeated Node columns = 5 [json_name="columns"];
+ Alias alias = 6 [json_name="alias"];
+ int32 location = 7 [json_name="location"];
+}
+
+message RangeTableFuncCol
+{
+ string colname = 1 [json_name="colname"];
+ TypeName type_name = 2 [json_name="typeName"];
+ bool for_ordinality = 3 [json_name="for_ordinality"];
+ bool is_not_null = 4 [json_name="is_not_null"];
+ Node colexpr = 5 [json_name="colexpr"];
+ Node coldefexpr = 6 [json_name="coldefexpr"];
+ int32 location = 7 [json_name="location"];
+}
+
+message TypeName
+{
+ repeated Node names = 1 [json_name="names"];
+ uint32 type_oid = 2 [json_name="typeOid"];
+ bool setof = 3 [json_name="setof"];
+ bool pct_type = 4 [json_name="pct_type"];
+ repeated Node typmods = 5 [json_name="typmods"];
+ int32 typemod = 6 [json_name="typemod"];
+ repeated Node array_bounds = 7 [json_name="arrayBounds"];
+ int32 location = 8 [json_name="location"];
+}
+
+message ColumnDef
+{
+ string colname = 1 [json_name="colname"];
+ TypeName type_name = 2 [json_name="typeName"];
+ int32 inhcount = 3 [json_name="inhcount"];
+ bool is_local = 4 [json_name="is_local"];
+ bool is_not_null = 5 [json_name="is_not_null"];
+ bool is_from_type = 6 [json_name="is_from_type"];
+ string storage = 7 [json_name="storage"];
+ Node raw_default = 8 [json_name="raw_default"];
+ Node cooked_default = 9 [json_name="cooked_default"];
+ string identity = 10 [json_name="identity"];
+ RangeVar identity_sequence = 11 [json_name="identitySequence"];
+ string generated = 12 [json_name="generated"];
+ CollateClause coll_clause = 13 [json_name="collClause"];
+ uint32 coll_oid = 14 [json_name="collOid"];
+ repeated Node constraints = 15 [json_name="constraints"];
+ repeated Node fdwoptions = 16 [json_name="fdwoptions"];
+ int32 location = 17 [json_name="location"];
+}
+
+message IndexElem
+{
+ string name = 1 [json_name="name"];
+ Node expr = 2 [json_name="expr"];
+ string indexcolname = 3 [json_name="indexcolname"];
+ repeated Node collation = 4 [json_name="collation"];
+ repeated Node opclass = 5 [json_name="opclass"];
+ repeated Node opclassopts = 6 [json_name="opclassopts"];
+ SortByDir ordering = 7 [json_name="ordering"];
+ SortByNulls nulls_ordering = 8 [json_name="nulls_ordering"];
+}
+
+message Constraint
+{
+ ConstrType contype = 1 [json_name="contype"];
+ string conname = 2 [json_name="conname"];
+ bool deferrable = 3 [json_name="deferrable"];
+ bool initdeferred = 4 [json_name="initdeferred"];
+ int32 location = 5 [json_name="location"];
+ bool is_no_inherit = 6 [json_name="is_no_inherit"];
+ Node raw_expr = 7 [json_name="raw_expr"];
+ string cooked_expr = 8 [json_name="cooked_expr"];
+ string generated_when = 9 [json_name="generated_when"];
+ repeated Node keys = 10 [json_name="keys"];
+ repeated Node including = 11 [json_name="including"];
+ repeated Node exclusions = 12 [json_name="exclusions"];
+ repeated Node options = 13 [json_name="options"];
+ string indexname = 14 [json_name="indexname"];
+ string indexspace = 15 [json_name="indexspace"];
+ bool reset_default_tblspc = 16 [json_name="reset_default_tblspc"];
+ string access_method = 17 [json_name="access_method"];
+ Node where_clause = 18 [json_name="where_clause"];
+ RangeVar pktable = 19 [json_name="pktable"];
+ repeated Node fk_attrs = 20 [json_name="fk_attrs"];
+ repeated Node pk_attrs = 21 [json_name="pk_attrs"];
+ string fk_matchtype = 22 [json_name="fk_matchtype"];
+ string fk_upd_action = 23 [json_name="fk_upd_action"];
+ string fk_del_action = 24 [json_name="fk_del_action"];
+ repeated Node old_conpfeqop = 25 [json_name="old_conpfeqop"];
+ uint32 old_pktable_oid = 26 [json_name="old_pktable_oid"];
+ bool skip_validation = 27 [json_name="skip_validation"];
+ bool initially_valid = 28 [json_name="initially_valid"];
+}
+
+message DefElem
+{
+ string defnamespace = 1 [json_name="defnamespace"];
+ string defname = 2 [json_name="defname"];
+ Node arg = 3 [json_name="arg"];
+ DefElemAction defaction = 4 [json_name="defaction"];
+ int32 location = 5 [json_name="location"];
+}
+
+message RangeTblEntry
+{
+ RTEKind rtekind = 1 [json_name="rtekind"];
+ uint32 relid = 2 [json_name="relid"];
+ string relkind = 3 [json_name="relkind"];
+ int32 rellockmode = 4 [json_name="rellockmode"];
+ TableSampleClause tablesample = 5 [json_name="tablesample"];
+ Query subquery = 6 [json_name="subquery"];
+ bool security_barrier = 7 [json_name="security_barrier"];
+ JoinType jointype = 8 [json_name="jointype"];
+ int32 joinmergedcols = 9 [json_name="joinmergedcols"];
+ repeated Node joinaliasvars = 10 [json_name="joinaliasvars"];
+ repeated Node joinleftcols = 11 [json_name="joinleftcols"];
+ repeated Node joinrightcols = 12 [json_name="joinrightcols"];
+ repeated Node functions = 13 [json_name="functions"];
+ bool funcordinality = 14 [json_name="funcordinality"];
+ TableFunc tablefunc = 15 [json_name="tablefunc"];
+ repeated Node values_lists = 16 [json_name="values_lists"];
+ string ctename = 17 [json_name="ctename"];
+ uint32 ctelevelsup = 18 [json_name="ctelevelsup"];
+ bool self_reference = 19 [json_name="self_reference"];
+ repeated Node coltypes = 20 [json_name="coltypes"];
+ repeated Node coltypmods = 21 [json_name="coltypmods"];
+ repeated Node colcollations = 22 [json_name="colcollations"];
+ string enrname = 23 [json_name="enrname"];
+ double enrtuples = 24 [json_name="enrtuples"];
+ Alias alias = 25 [json_name="alias"];
+ Alias eref = 26 [json_name="eref"];
+ bool lateral = 27 [json_name="lateral"];
+ bool inh = 28 [json_name="inh"];
+ bool in_from_cl = 29 [json_name="inFromCl"];
+ uint32 required_perms = 30 [json_name="requiredPerms"];
+ uint32 check_as_user = 31 [json_name="checkAsUser"];
+ repeated uint64 selected_cols = 32 [json_name="selectedCols"];
+ repeated uint64 inserted_cols = 33 [json_name="insertedCols"];
+ repeated uint64 updated_cols = 34 [json_name="updatedCols"];
+ repeated uint64 extra_updated_cols = 35 [json_name="extraUpdatedCols"];
+ repeated Node security_quals = 36 [json_name="securityQuals"];
+}
+
+message RangeTblFunction
+{
+ Node funcexpr = 1 [json_name="funcexpr"];
+ int32 funccolcount = 2 [json_name="funccolcount"];
+ repeated Node funccolnames = 3 [json_name="funccolnames"];
+ repeated Node funccoltypes = 4 [json_name="funccoltypes"];
+ repeated Node funccoltypmods = 5 [json_name="funccoltypmods"];
+ repeated Node funccolcollations = 6 [json_name="funccolcollations"];
+ repeated uint64 funcparams = 7 [json_name="funcparams"];
+}
+
+message TableSampleClause
+{
+ uint32 tsmhandler = 1 [json_name="tsmhandler"];
+ repeated Node args = 2 [json_name="args"];
+ Node repeatable = 3 [json_name="repeatable"];
+}
+
+message WithCheckOption
+{
+ WCOKind kind = 1 [json_name="kind"];
+ string relname = 2 [json_name="relname"];
+ string polname = 3 [json_name="polname"];
+ Node qual = 4 [json_name="qual"];
+ bool cascaded = 5 [json_name="cascaded"];
+}
+
+message SortGroupClause
+{
+ uint32 tle_sort_group_ref = 1 [json_name="tleSortGroupRef"];
+ uint32 eqop = 2 [json_name="eqop"];
+ uint32 sortop = 3 [json_name="sortop"];
+ bool nulls_first = 4 [json_name="nulls_first"];
+ bool hashable = 5 [json_name="hashable"];
+}
+
+message GroupingSet
+{
+ GroupingSetKind kind = 1 [json_name="kind"];
+ repeated Node content = 2 [json_name="content"];
+ int32 location = 3 [json_name="location"];
+}
+
+message WindowClause
+{
+ string name = 1 [json_name="name"];
+ string refname = 2 [json_name="refname"];
+ repeated Node partition_clause = 3 [json_name="partitionClause"];
+ repeated Node order_clause = 4 [json_name="orderClause"];
+ int32 frame_options = 5 [json_name="frameOptions"];
+ Node start_offset = 6 [json_name="startOffset"];
+ Node end_offset = 7 [json_name="endOffset"];
+ uint32 start_in_range_func = 8 [json_name="startInRangeFunc"];
+ uint32 end_in_range_func = 9 [json_name="endInRangeFunc"];
+ uint32 in_range_coll = 10 [json_name="inRangeColl"];
+ bool in_range_asc = 11 [json_name="inRangeAsc"];
+ bool in_range_nulls_first = 12 [json_name="inRangeNullsFirst"];
+ uint32 winref = 13 [json_name="winref"];
+ bool copied_order = 14 [json_name="copiedOrder"];
+}
+
+message ObjectWithArgs
+{
+ repeated Node objname = 1 [json_name="objname"];
+ repeated Node objargs = 2 [json_name="objargs"];
+ bool args_unspecified = 3 [json_name="args_unspecified"];
+}
+
+message AccessPriv
+{
+ string priv_name = 1 [json_name="priv_name"];
+ repeated Node cols = 2 [json_name="cols"];
+}
+
+message CreateOpClassItem
+{
+ int32 itemtype = 1 [json_name="itemtype"];
+ ObjectWithArgs name = 2 [json_name="name"];
+ int32 number = 3 [json_name="number"];
+ repeated Node order_family = 4 [json_name="order_family"];
+ repeated Node class_args = 5 [json_name="class_args"];
+ TypeName storedtype = 6 [json_name="storedtype"];
+}
+
+message TableLikeClause
+{
+ RangeVar relation = 1 [json_name="relation"];
+ uint32 options = 2 [json_name="options"];
+ uint32 relation_oid = 3 [json_name="relationOid"];
+}
+
+message FunctionParameter
+{
+ string name = 1 [json_name="name"];
+ TypeName arg_type = 2 [json_name="argType"];
+ FunctionParameterMode mode = 3 [json_name="mode"];
+ Node defexpr = 4 [json_name="defexpr"];
+}
+
+message LockingClause
+{
+ repeated Node locked_rels = 1 [json_name="lockedRels"];
+ LockClauseStrength strength = 2 [json_name="strength"];
+ LockWaitPolicy wait_policy = 3 [json_name="waitPolicy"];
+}
+
+message RowMarkClause
+{
+ uint32 rti = 1 [json_name="rti"];
+ LockClauseStrength strength = 2 [json_name="strength"];
+ LockWaitPolicy wait_policy = 3 [json_name="waitPolicy"];
+ bool pushed_down = 4 [json_name="pushedDown"];
+}
+
+message XmlSerialize
+{
+ XmlOptionType xmloption = 1 [json_name="xmloption"];
+ Node expr = 2 [json_name="expr"];
+ TypeName type_name = 3 [json_name="typeName"];
+ int32 location = 4 [json_name="location"];
+}
+
+message WithClause
+{
+ repeated Node ctes = 1 [json_name="ctes"];
+ bool recursive = 2 [json_name="recursive"];
+ int32 location = 3 [json_name="location"];
+}
+
+message InferClause
+{
+ repeated Node index_elems = 1 [json_name="indexElems"];
+ Node where_clause = 2 [json_name="whereClause"];
+ string conname = 3 [json_name="conname"];
+ int32 location = 4 [json_name="location"];
+}
+
+message OnConflictClause
+{
+ OnConflictAction action = 1 [json_name="action"];
+ InferClause infer = 2 [json_name="infer"];
+ repeated Node target_list = 3 [json_name="targetList"];
+ Node where_clause = 4 [json_name="whereClause"];
+ int32 location = 5 [json_name="location"];
+}
+
+message CommonTableExpr
+{
+ string ctename = 1 [json_name="ctename"];
+ repeated Node aliascolnames = 2 [json_name="aliascolnames"];
+ CTEMaterialize ctematerialized = 3 [json_name="ctematerialized"];
+ Node ctequery = 4 [json_name="ctequery"];
+ int32 location = 5 [json_name="location"];
+ bool cterecursive = 6 [json_name="cterecursive"];
+ int32 cterefcount = 7 [json_name="cterefcount"];
+ repeated Node ctecolnames = 8 [json_name="ctecolnames"];
+ repeated Node ctecoltypes = 9 [json_name="ctecoltypes"];
+ repeated Node ctecoltypmods = 10 [json_name="ctecoltypmods"];
+ repeated Node ctecolcollations = 11 [json_name="ctecolcollations"];
+}
+
+message RoleSpec
+{
+ RoleSpecType roletype = 1 [json_name="roletype"];
+ string rolename = 2 [json_name="rolename"];
+ int32 location = 3 [json_name="location"];
+}
+
+message TriggerTransition
+{
+ string name = 1 [json_name="name"];
+ bool is_new = 2 [json_name="isNew"];
+ bool is_table = 3 [json_name="isTable"];
+}
+
+message PartitionElem
+{
+ string name = 1 [json_name="name"];
+ Node expr = 2 [json_name="expr"];
+ repeated Node collation = 3 [json_name="collation"];
+ repeated Node opclass = 4 [json_name="opclass"];
+ int32 location = 5 [json_name="location"];
+}
+
+message PartitionSpec
+{
+ string strategy = 1 [json_name="strategy"];
+ repeated Node part_params = 2 [json_name="partParams"];
+ int32 location = 3 [json_name="location"];
+}
+
+message PartitionBoundSpec
+{
+ string strategy = 1 [json_name="strategy"];
+ bool is_default = 2 [json_name="is_default"];
+ int32 modulus = 3 [json_name="modulus"];
+ int32 remainder = 4 [json_name="remainder"];
+ repeated Node listdatums = 5 [json_name="listdatums"];
+ repeated Node lowerdatums = 6 [json_name="lowerdatums"];
+ repeated Node upperdatums = 7 [json_name="upperdatums"];
+ int32 location = 8 [json_name="location"];
+}
+
+message PartitionRangeDatum
+{
+ PartitionRangeDatumKind kind = 1 [json_name="kind"];
+ Node value = 2 [json_name="value"];
+ int32 location = 3 [json_name="location"];
+}
+
+message PartitionCmd
+{
+ RangeVar name = 1 [json_name="name"];
+ PartitionBoundSpec bound = 2 [json_name="bound"];
+}
+
+message VacuumRelation
+{
+ RangeVar relation = 1 [json_name="relation"];
+ uint32 oid = 2 [json_name="oid"];
+ repeated Node va_cols = 3 [json_name="va_cols"];
+}
+
+message InlineCodeBlock
+{
+ string source_text = 1 [json_name="source_text"];
+ uint32 lang_oid = 2 [json_name="langOid"];
+ bool lang_is_trusted = 3 [json_name="langIsTrusted"];
+ bool atomic = 4 [json_name="atomic"];
+}
+
+message CallContext
+{
+ bool atomic = 1 [json_name="atomic"];
+}
+
+enum OverridingKind
+{
+ OVERRIDING_KIND_UNDEFINED = 0;
+ OVERRIDING_NOT_SET = 1;
+ OVERRIDING_USER_VALUE = 2;
+ OVERRIDING_SYSTEM_VALUE = 3;
+}
+
+enum QuerySource
+{
+ QUERY_SOURCE_UNDEFINED = 0;
+ QSRC_ORIGINAL = 1;
+ QSRC_PARSER = 2;
+ QSRC_INSTEAD_RULE = 3;
+ QSRC_QUAL_INSTEAD_RULE = 4;
+ QSRC_NON_INSTEAD_RULE = 5;
+}
+
+enum SortByDir
+{
+ SORT_BY_DIR_UNDEFINED = 0;
+ SORTBY_DEFAULT = 1;
+ SORTBY_ASC = 2;
+ SORTBY_DESC = 3;
+ SORTBY_USING = 4;
+}
+
+enum SortByNulls
+{
+ SORT_BY_NULLS_UNDEFINED = 0;
+ SORTBY_NULLS_DEFAULT = 1;
+ SORTBY_NULLS_FIRST = 2;
+ SORTBY_NULLS_LAST = 3;
+}
+
+enum A_Expr_Kind
+{
+ A_EXPR_KIND_UNDEFINED = 0;
+ AEXPR_OP = 1;
+ AEXPR_OP_ANY = 2;
+ AEXPR_OP_ALL = 3;
+ AEXPR_DISTINCT = 4;
+ AEXPR_NOT_DISTINCT = 5;
+ AEXPR_NULLIF = 6;
+ AEXPR_OF = 7;
+ AEXPR_IN = 8;
+ AEXPR_LIKE = 9;
+ AEXPR_ILIKE = 10;
+ AEXPR_SIMILAR = 11;
+ AEXPR_BETWEEN = 12;
+ AEXPR_NOT_BETWEEN = 13;
+ AEXPR_BETWEEN_SYM = 14;
+ AEXPR_NOT_BETWEEN_SYM = 15;
+ AEXPR_PAREN = 16;
+}
+
+enum RoleSpecType
+{
+ ROLE_SPEC_TYPE_UNDEFINED = 0;
+ ROLESPEC_CSTRING = 1;
+ ROLESPEC_CURRENT_USER = 2;
+ ROLESPEC_SESSION_USER = 3;
+ ROLESPEC_PUBLIC = 4;
+}
+
+enum TableLikeOption
+{
+ TABLE_LIKE_OPTION_UNDEFINED = 0;
+ CREATE_TABLE_LIKE_COMMENTS = 1;
+ CREATE_TABLE_LIKE_CONSTRAINTS = 2;
+ CREATE_TABLE_LIKE_DEFAULTS = 3;
+ CREATE_TABLE_LIKE_GENERATED = 4;
+ CREATE_TABLE_LIKE_IDENTITY = 5;
+ CREATE_TABLE_LIKE_INDEXES = 6;
+ CREATE_TABLE_LIKE_STATISTICS = 7;
+ CREATE_TABLE_LIKE_STORAGE = 8;
+ CREATE_TABLE_LIKE_ALL = 9;
+}
+
+enum DefElemAction
+{
+ DEF_ELEM_ACTION_UNDEFINED = 0;
+ DEFELEM_UNSPEC = 1;
+ DEFELEM_SET = 2;
+ DEFELEM_ADD = 3;
+ DEFELEM_DROP = 4;
+}
+
+enum PartitionRangeDatumKind
+{
+ PARTITION_RANGE_DATUM_KIND_UNDEFINED = 0;
+ PARTITION_RANGE_DATUM_MINVALUE = 1;
+ PARTITION_RANGE_DATUM_VALUE = 2;
+ PARTITION_RANGE_DATUM_MAXVALUE = 3;
+}
+
+enum RTEKind
+{
+ RTEKIND_UNDEFINED = 0;
+ RTE_RELATION = 1;
+ RTE_SUBQUERY = 2;
+ RTE_JOIN = 3;
+ RTE_FUNCTION = 4;
+ RTE_TABLEFUNC = 5;
+ RTE_VALUES = 6;
+ RTE_CTE = 7;
+ RTE_NAMEDTUPLESTORE = 8;
+ RTE_RESULT = 9;
+}
+
+enum WCOKind
+{
+ WCOKIND_UNDEFINED = 0;
+ WCO_VIEW_CHECK = 1;
+ WCO_RLS_INSERT_CHECK = 2;
+ WCO_RLS_UPDATE_CHECK = 3;
+ WCO_RLS_CONFLICT_CHECK = 4;
+}
+
+enum GroupingSetKind
+{
+ GROUPING_SET_KIND_UNDEFINED = 0;
+ GROUPING_SET_EMPTY = 1;
+ GROUPING_SET_SIMPLE = 2;
+ GROUPING_SET_ROLLUP = 3;
+ GROUPING_SET_CUBE = 4;
+ GROUPING_SET_SETS = 5;
+}
+
+enum CTEMaterialize
+{
+ CTEMATERIALIZE_UNDEFINED = 0;
+ CTEMaterializeDefault = 1;
+ CTEMaterializeAlways = 2;
+ CTEMaterializeNever = 3;
+}
+
+enum SetOperation
+{
+ SET_OPERATION_UNDEFINED = 0;
+ SETOP_NONE = 1;
+ SETOP_UNION = 2;
+ SETOP_INTERSECT = 3;
+ SETOP_EXCEPT = 4;
+}
+
+enum ObjectType
+{
+ OBJECT_TYPE_UNDEFINED = 0;
+ OBJECT_ACCESS_METHOD = 1;
+ OBJECT_AGGREGATE = 2;
+ OBJECT_AMOP = 3;
+ OBJECT_AMPROC = 4;
+ OBJECT_ATTRIBUTE = 5;
+ OBJECT_CAST = 6;
+ OBJECT_COLUMN = 7;
+ OBJECT_COLLATION = 8;
+ OBJECT_CONVERSION = 9;
+ OBJECT_DATABASE = 10;
+ OBJECT_DEFAULT = 11;
+ OBJECT_DEFACL = 12;
+ OBJECT_DOMAIN = 13;
+ OBJECT_DOMCONSTRAINT = 14;
+ OBJECT_EVENT_TRIGGER = 15;
+ OBJECT_EXTENSION = 16;
+ OBJECT_FDW = 17;
+ OBJECT_FOREIGN_SERVER = 18;
+ OBJECT_FOREIGN_TABLE = 19;
+ OBJECT_FUNCTION = 20;
+ OBJECT_INDEX = 21;
+ OBJECT_LANGUAGE = 22;
+ OBJECT_LARGEOBJECT = 23;
+ OBJECT_MATVIEW = 24;
+ OBJECT_OPCLASS = 25;
+ OBJECT_OPERATOR = 26;
+ OBJECT_OPFAMILY = 27;
+ OBJECT_POLICY = 28;
+ OBJECT_PROCEDURE = 29;
+ OBJECT_PUBLICATION = 30;
+ OBJECT_PUBLICATION_REL = 31;
+ OBJECT_ROLE = 32;
+ OBJECT_ROUTINE = 33;
+ OBJECT_RULE = 34;
+ OBJECT_SCHEMA = 35;
+ OBJECT_SEQUENCE = 36;
+ OBJECT_SUBSCRIPTION = 37;
+ OBJECT_STATISTIC_EXT = 38;
+ OBJECT_TABCONSTRAINT = 39;
+ OBJECT_TABLE = 40;
+ OBJECT_TABLESPACE = 41;
+ OBJECT_TRANSFORM = 42;
+ OBJECT_TRIGGER = 43;
+ OBJECT_TSCONFIGURATION = 44;
+ OBJECT_TSDICTIONARY = 45;
+ OBJECT_TSPARSER = 46;
+ OBJECT_TSTEMPLATE = 47;
+ OBJECT_TYPE = 48;
+ OBJECT_USER_MAPPING = 49;
+ OBJECT_VIEW = 50;
+}
+
+enum DropBehavior
+{
+ DROP_BEHAVIOR_UNDEFINED = 0;
+ DROP_RESTRICT = 1;
+ DROP_CASCADE = 2;
+}
+
+enum AlterTableType
+{
+ ALTER_TABLE_TYPE_UNDEFINED = 0;
+ AT_AddColumn = 1;
+ AT_AddColumnRecurse = 2;
+ AT_AddColumnToView = 3;
+ AT_ColumnDefault = 4;
+ AT_CookedColumnDefault = 5;
+ AT_DropNotNull = 6;
+ AT_SetNotNull = 7;
+ AT_DropExpression = 8;
+ AT_CheckNotNull = 9;
+ AT_SetStatistics = 10;
+ AT_SetOptions = 11;
+ AT_ResetOptions = 12;
+ AT_SetStorage = 13;
+ AT_DropColumn = 14;
+ AT_DropColumnRecurse = 15;
+ AT_AddIndex = 16;
+ AT_ReAddIndex = 17;
+ AT_AddConstraint = 18;
+ AT_AddConstraintRecurse = 19;
+ AT_ReAddConstraint = 20;
+ AT_ReAddDomainConstraint = 21;
+ AT_AlterConstraint = 22;
+ AT_ValidateConstraint = 23;
+ AT_ValidateConstraintRecurse = 24;
+ AT_AddIndexConstraint = 25;
+ AT_DropConstraint = 26;
+ AT_DropConstraintRecurse = 27;
+ AT_ReAddComment = 28;
+ AT_AlterColumnType = 29;
+ AT_AlterColumnGenericOptions = 30;
+ AT_ChangeOwner = 31;
+ AT_ClusterOn = 32;
+ AT_DropCluster = 33;
+ AT_SetLogged = 34;
+ AT_SetUnLogged = 35;
+ AT_DropOids = 36;
+ AT_SetTableSpace = 37;
+ AT_SetRelOptions = 38;
+ AT_ResetRelOptions = 39;
+ AT_ReplaceRelOptions = 40;
+ AT_EnableTrig = 41;
+ AT_EnableAlwaysTrig = 42;
+ AT_EnableReplicaTrig = 43;
+ AT_DisableTrig = 44;
+ AT_EnableTrigAll = 45;
+ AT_DisableTrigAll = 46;
+ AT_EnableTrigUser = 47;
+ AT_DisableTrigUser = 48;
+ AT_EnableRule = 49;
+ AT_EnableAlwaysRule = 50;
+ AT_EnableReplicaRule = 51;
+ AT_DisableRule = 52;
+ AT_AddInherit = 53;
+ AT_DropInherit = 54;
+ AT_AddOf = 55;
+ AT_DropOf = 56;
+ AT_ReplicaIdentity = 57;
+ AT_EnableRowSecurity = 58;
+ AT_DisableRowSecurity = 59;
+ AT_ForceRowSecurity = 60;
+ AT_NoForceRowSecurity = 61;
+ AT_GenericOptions = 62;
+ AT_AttachPartition = 63;
+ AT_DetachPartition = 64;
+ AT_AddIdentity = 65;
+ AT_SetIdentity = 66;
+ AT_DropIdentity = 67;
+}
+
+enum GrantTargetType
+{
+ GRANT_TARGET_TYPE_UNDEFINED = 0;
+ ACL_TARGET_OBJECT = 1;
+ ACL_TARGET_ALL_IN_SCHEMA = 2;
+ ACL_TARGET_DEFAULTS = 3;
+}
+
+enum VariableSetKind
+{
+ VARIABLE_SET_KIND_UNDEFINED = 0;
+ VAR_SET_VALUE = 1;
+ VAR_SET_DEFAULT = 2;
+ VAR_SET_CURRENT = 3;
+ VAR_SET_MULTI = 4;
+ VAR_RESET = 5;
+ VAR_RESET_ALL = 6;
+}
+
+enum ConstrType
+{
+ CONSTR_TYPE_UNDEFINED = 0;
+ CONSTR_NULL = 1;
+ CONSTR_NOTNULL = 2;
+ CONSTR_DEFAULT = 3;
+ CONSTR_IDENTITY = 4;
+ CONSTR_GENERATED = 5;
+ CONSTR_CHECK = 6;
+ CONSTR_PRIMARY = 7;
+ CONSTR_UNIQUE = 8;
+ CONSTR_EXCLUSION = 9;
+ CONSTR_FOREIGN = 10;
+ CONSTR_ATTR_DEFERRABLE = 11;
+ CONSTR_ATTR_NOT_DEFERRABLE = 12;
+ CONSTR_ATTR_DEFERRED = 13;
+ CONSTR_ATTR_IMMEDIATE = 14;
+}
+
+enum ImportForeignSchemaType
+{
+ IMPORT_FOREIGN_SCHEMA_TYPE_UNDEFINED = 0;
+ FDW_IMPORT_SCHEMA_ALL = 1;
+ FDW_IMPORT_SCHEMA_LIMIT_TO = 2;
+ FDW_IMPORT_SCHEMA_EXCEPT = 3;
+}
+
+enum RoleStmtType
+{
+ ROLE_STMT_TYPE_UNDEFINED = 0;
+ ROLESTMT_ROLE = 1;
+ ROLESTMT_USER = 2;
+ ROLESTMT_GROUP = 3;
+}
+
+enum FetchDirection
+{
+ FETCH_DIRECTION_UNDEFINED = 0;
+ FETCH_FORWARD = 1;
+ FETCH_BACKWARD = 2;
+ FETCH_ABSOLUTE = 3;
+ FETCH_RELATIVE = 4;
+}
+
+enum FunctionParameterMode
+{
+ FUNCTION_PARAMETER_MODE_UNDEFINED = 0;
+ FUNC_PARAM_IN = 1;
+ FUNC_PARAM_OUT = 2;
+ FUNC_PARAM_INOUT = 3;
+ FUNC_PARAM_VARIADIC = 4;
+ FUNC_PARAM_TABLE = 5;
+}
+
+enum TransactionStmtKind
+{
+ TRANSACTION_STMT_KIND_UNDEFINED = 0;
+ TRANS_STMT_BEGIN = 1;
+ TRANS_STMT_START = 2;
+ TRANS_STMT_COMMIT = 3;
+ TRANS_STMT_ROLLBACK = 4;
+ TRANS_STMT_SAVEPOINT = 5;
+ TRANS_STMT_RELEASE = 6;
+ TRANS_STMT_ROLLBACK_TO = 7;
+ TRANS_STMT_PREPARE = 8;
+ TRANS_STMT_COMMIT_PREPARED = 9;
+ TRANS_STMT_ROLLBACK_PREPARED = 10;
+}
+
+enum ViewCheckOption
+{
+ VIEW_CHECK_OPTION_UNDEFINED = 0;
+ NO_CHECK_OPTION = 1;
+ LOCAL_CHECK_OPTION = 2;
+ CASCADED_CHECK_OPTION = 3;
+}
+
+enum ClusterOption
+{
+ CLUSTER_OPTION_UNDEFINED = 0;
+ CLUOPT_RECHECK = 1;
+ CLUOPT_VERBOSE = 2;
+}
+
+enum DiscardMode
+{
+ DISCARD_MODE_UNDEFINED = 0;
+ DISCARD_ALL = 1;
+ DISCARD_PLANS = 2;
+ DISCARD_SEQUENCES = 3;
+ DISCARD_TEMP = 4;
+}
+
+enum ReindexObjectType
+{
+ REINDEX_OBJECT_TYPE_UNDEFINED = 0;
+ REINDEX_OBJECT_INDEX = 1;
+ REINDEX_OBJECT_TABLE = 2;
+ REINDEX_OBJECT_SCHEMA = 3;
+ REINDEX_OBJECT_SYSTEM = 4;
+ REINDEX_OBJECT_DATABASE = 5;
+}
+
+enum AlterTSConfigType
+{
+ ALTER_TSCONFIG_TYPE_UNDEFINED = 0;
+ ALTER_TSCONFIG_ADD_MAPPING = 1;
+ ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN = 2;
+ ALTER_TSCONFIG_REPLACE_DICT = 3;
+ ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN = 4;
+ ALTER_TSCONFIG_DROP_MAPPING = 5;
+}
+
+enum AlterSubscriptionType
+{
+ ALTER_SUBSCRIPTION_TYPE_UNDEFINED = 0;
+ ALTER_SUBSCRIPTION_OPTIONS = 1;
+ ALTER_SUBSCRIPTION_CONNECTION = 2;
+ ALTER_SUBSCRIPTION_PUBLICATION = 3;
+ ALTER_SUBSCRIPTION_REFRESH = 4;
+ ALTER_SUBSCRIPTION_ENABLED = 5;
+}
+
+enum OnCommitAction
+{
+ ON_COMMIT_ACTION_UNDEFINED = 0;
+ ONCOMMIT_NOOP = 1;
+ ONCOMMIT_PRESERVE_ROWS = 2;
+ ONCOMMIT_DELETE_ROWS = 3;
+ ONCOMMIT_DROP = 4;
+}
+
+enum ParamKind
+{
+ PARAM_KIND_UNDEFINED = 0;
+ PARAM_EXTERN = 1;
+ PARAM_EXEC = 2;
+ PARAM_SUBLINK = 3;
+ PARAM_MULTIEXPR = 4;
+}
+
+enum CoercionContext
+{
+ COERCION_CONTEXT_UNDEFINED = 0;
+ COERCION_IMPLICIT = 1;
+ COERCION_ASSIGNMENT = 2;
+ COERCION_EXPLICIT = 3;
+}
+
+enum CoercionForm
+{
+ COERCION_FORM_UNDEFINED = 0;
+ COERCE_EXPLICIT_CALL = 1;
+ COERCE_EXPLICIT_CAST = 2;
+ COERCE_IMPLICIT_CAST = 3;
+}
+
+enum BoolExprType
+{
+ BOOL_EXPR_TYPE_UNDEFINED = 0;
+ AND_EXPR = 1;
+ OR_EXPR = 2;
+ NOT_EXPR = 3;
+}
+
+enum SubLinkType
+{
+ SUB_LINK_TYPE_UNDEFINED = 0;
+ EXISTS_SUBLINK = 1;
+ ALL_SUBLINK = 2;
+ ANY_SUBLINK = 3;
+ ROWCOMPARE_SUBLINK = 4;
+ EXPR_SUBLINK = 5;
+ MULTIEXPR_SUBLINK = 6;
+ ARRAY_SUBLINK = 7;
+ CTE_SUBLINK = 8;
+}
+
+enum RowCompareType
+{
+ ROW_COMPARE_TYPE_UNDEFINED = 0;
+ ROWCOMPARE_LT = 1;
+ ROWCOMPARE_LE = 2;
+ ROWCOMPARE_EQ = 3;
+ ROWCOMPARE_GE = 4;
+ ROWCOMPARE_GT = 5;
+ ROWCOMPARE_NE = 6;
+}
+
+enum MinMaxOp
+{
+ MIN_MAX_OP_UNDEFINED = 0;
+ IS_GREATEST = 1;
+ IS_LEAST = 2;
+}
+
+enum SQLValueFunctionOp
+{
+ SQLVALUE_FUNCTION_OP_UNDEFINED = 0;
+ SVFOP_CURRENT_DATE = 1;
+ SVFOP_CURRENT_TIME = 2;
+ SVFOP_CURRENT_TIME_N = 3;
+ SVFOP_CURRENT_TIMESTAMP = 4;
+ SVFOP_CURRENT_TIMESTAMP_N = 5;
+ SVFOP_LOCALTIME = 6;
+ SVFOP_LOCALTIME_N = 7;
+ SVFOP_LOCALTIMESTAMP = 8;
+ SVFOP_LOCALTIMESTAMP_N = 9;
+ SVFOP_CURRENT_ROLE = 10;
+ SVFOP_CURRENT_USER = 11;
+ SVFOP_USER = 12;
+ SVFOP_SESSION_USER = 13;
+ SVFOP_CURRENT_CATALOG = 14;
+ SVFOP_CURRENT_SCHEMA = 15;
+}
+
+enum XmlExprOp
+{
+ XML_EXPR_OP_UNDEFINED = 0;
+ IS_XMLCONCAT = 1;
+ IS_XMLELEMENT = 2;
+ IS_XMLFOREST = 3;
+ IS_XMLPARSE = 4;
+ IS_XMLPI = 5;
+ IS_XMLROOT = 6;
+ IS_XMLSERIALIZE = 7;
+ IS_DOCUMENT = 8;
+}
+
+enum XmlOptionType
+{
+ XML_OPTION_TYPE_UNDEFINED = 0;
+ XMLOPTION_DOCUMENT = 1;
+ XMLOPTION_CONTENT = 2;
+}
+
+enum NullTestType
+{
+ NULL_TEST_TYPE_UNDEFINED = 0;
+ IS_NULL = 1;
+ IS_NOT_NULL = 2;
+}
+
+enum BoolTestType
+{
+ BOOL_TEST_TYPE_UNDEFINED = 0;
+ IS_TRUE = 1;
+ IS_NOT_TRUE = 2;
+ IS_FALSE = 3;
+ IS_NOT_FALSE = 4;
+ IS_UNKNOWN = 5;
+ IS_NOT_UNKNOWN = 6;
+}
+
+enum CmdType
+{
+ CMD_TYPE_UNDEFINED = 0;
+ CMD_UNKNOWN = 1;
+ CMD_SELECT = 2;
+ CMD_UPDATE = 3;
+ CMD_INSERT = 4;
+ CMD_DELETE = 5;
+ CMD_UTILITY = 6;
+ CMD_NOTHING = 7;
+}
+
+enum JoinType
+{
+ JOIN_TYPE_UNDEFINED = 0;
+ JOIN_INNER = 1;
+ JOIN_LEFT = 2;
+ JOIN_FULL = 3;
+ JOIN_RIGHT = 4;
+ JOIN_SEMI = 5;
+ JOIN_ANTI = 6;
+ JOIN_UNIQUE_OUTER = 7;
+ JOIN_UNIQUE_INNER = 8;
+}
+
+enum AggStrategy
+{
+ AGG_STRATEGY_UNDEFINED = 0;
+ AGG_PLAIN = 1;
+ AGG_SORTED = 2;
+ AGG_HASHED = 3;
+ AGG_MIXED = 4;
+}
+
+enum AggSplit
+{
+ AGG_SPLIT_UNDEFINED = 0;
+ AGGSPLIT_SIMPLE = 1;
+ AGGSPLIT_INITIAL_SERIAL = 2;
+ AGGSPLIT_FINAL_DESERIAL = 3;
+}
+
+enum SetOpCmd
+{
+ SET_OP_CMD_UNDEFINED = 0;
+ SETOPCMD_INTERSECT = 1;
+ SETOPCMD_INTERSECT_ALL = 2;
+ SETOPCMD_EXCEPT = 3;
+ SETOPCMD_EXCEPT_ALL = 4;
+}
+
+enum SetOpStrategy
+{
+ SET_OP_STRATEGY_UNDEFINED = 0;
+ SETOP_SORTED = 1;
+ SETOP_HASHED = 2;
+}
+
+enum OnConflictAction
+{
+ ON_CONFLICT_ACTION_UNDEFINED = 0;
+ ONCONFLICT_NONE = 1;
+ ONCONFLICT_NOTHING = 2;
+ ONCONFLICT_UPDATE = 3;
+}
+
+enum LimitOption
+{
+ LIMIT_OPTION_UNDEFINED = 0;
+ LIMIT_OPTION_DEFAULT = 1;
+ LIMIT_OPTION_COUNT = 2;
+ LIMIT_OPTION_WITH_TIES = 3;
+}
+
+enum LockClauseStrength
+{
+ LOCK_CLAUSE_STRENGTH_UNDEFINED = 0;
+ LCS_NONE = 1;
+ LCS_FORKEYSHARE = 2;
+ LCS_FORSHARE = 3;
+ LCS_FORNOKEYUPDATE = 4;
+ LCS_FORUPDATE = 5;
+}
+
+enum LockWaitPolicy
+{
+ LOCK_WAIT_POLICY_UNDEFINED = 0;
+ LockWaitBlock = 1;
+ LockWaitSkip = 2;
+ LockWaitError = 3;
+}
+
+enum LockTupleMode
+{
+ LOCK_TUPLE_MODE_UNDEFINED = 0;
+ LockTupleKeyShare = 1;
+ LockTupleShare = 2;
+ LockTupleNoKeyExclusive = 3;
+ LockTupleExclusive = 4;
+}
+
+message ScanToken {
+ int32 start = 1;
+ int32 end = 2;
+ Token token = 4;
+ KeywordKind keyword_kind = 5;
+}
+
+enum KeywordKind {
+ NO_KEYWORD = 0;
+ UNRESERVED_KEYWORD = 1;
+ COL_NAME_KEYWORD = 2;
+ TYPE_FUNC_NAME_KEYWORD = 3;
+ RESERVED_KEYWORD = 4;
+}
+
+enum Token {
+ NUL = 0;
+ // Single-character tokens that are returned 1:1 (identical with "self" list in scan.l)
+ // Either supporting syntax, or single-character operators (some can be both)
+ // Also see https://www.postgresql.org/docs/12/sql-syntax-lexical.html#SQL-SYNTAX-SPECIAL-CHARS
+ ASCII_37 = 37; // "%"
+ ASCII_40 = 40; // "("
+ ASCII_41 = 41; // ")"
+ ASCII_42 = 42; // "*"
+ ASCII_43 = 43; // "+"
+ ASCII_44 = 44; // ","
+ ASCII_45 = 45; // "-"
+ ASCII_46 = 46; // "."
+ ASCII_47 = 47; // "/"
+ ASCII_58 = 58; // ":"
+ ASCII_59 = 59; // ";"
+ ASCII_60 = 60; // "<"
+ ASCII_61 = 61; // "="
+ ASCII_62 = 62; // ">"
+ ASCII_63 = 63; // "?"
+ ASCII_91 = 91; // "["
+ ASCII_92 = 92; // "\"
+ ASCII_93 = 93; // "]"
+ ASCII_94 = 94; // "^"
+ // Named tokens in scan.l
+ IDENT = 258;
+ UIDENT = 259;
+ FCONST = 260;
+ SCONST = 261;
+ USCONST = 262;
+ BCONST = 263;
+ XCONST = 264;
+ Op = 265;
+ ICONST = 266;
+ PARAM = 267;
+ TYPECAST = 268;
+ DOT_DOT = 269;
+ COLON_EQUALS = 270;
+ EQUALS_GREATER = 271;
+ LESS_EQUALS = 272;
+ GREATER_EQUALS = 273;
+ NOT_EQUALS = 274;
+ SQL_COMMENT = 275;
+ C_COMMENT = 276;
+ ABORT_P = 277;
+ ABSOLUTE_P = 278;
+ ACCESS = 279;
+ ACTION = 280;
+ ADD_P = 281;
+ ADMIN = 282;
+ AFTER = 283;
+ AGGREGATE = 284;
+ ALL = 285;
+ ALSO = 286;
+ ALTER = 287;
+ ALWAYS = 288;
+ ANALYSE = 289;
+ ANALYZE = 290;
+ AND = 291;
+ ANY = 292;
+ ARRAY = 293;
+ AS = 294;
+ ASC = 295;
+ ASSERTION = 296;
+ ASSIGNMENT = 297;
+ ASYMMETRIC = 298;
+ AT = 299;
+ ATTACH = 300;
+ ATTRIBUTE = 301;
+ AUTHORIZATION = 302;
+ BACKWARD = 303;
+ BEFORE = 304;
+ BEGIN_P = 305;
+ BETWEEN = 306;
+ BIGINT = 307;
+ BINARY = 308;
+ BIT = 309;
+ BOOLEAN_P = 310;
+ BOTH = 311;
+ BY = 312;
+ CACHE = 313;
+ CALL = 314;
+ CALLED = 315;
+ CASCADE = 316;
+ CASCADED = 317;
+ CASE = 318;
+ CAST = 319;
+ CATALOG_P = 320;
+ CHAIN = 321;
+ CHAR_P = 322;
+ CHARACTER = 323;
+ CHARACTERISTICS = 324;
+ CHECK = 325;
+ CHECKPOINT = 326;
+ CLASS = 327;
+ CLOSE = 328;
+ CLUSTER = 329;
+ COALESCE = 330;
+ COLLATE = 331;
+ COLLATION = 332;
+ COLUMN = 333;
+ COLUMNS = 334;
+ COMMENT = 335;
+ COMMENTS = 336;
+ COMMIT = 337;
+ COMMITTED = 338;
+ CONCURRENTLY = 339;
+ CONFIGURATION = 340;
+ CONFLICT = 341;
+ CONNECTION = 342;
+ CONSTRAINT = 343;
+ CONSTRAINTS = 344;
+ CONTENT_P = 345;
+ CONTINUE_P = 346;
+ CONVERSION_P = 347;
+ COPY = 348;
+ COST = 349;
+ CREATE = 350;
+ CROSS = 351;
+ CSV = 352;
+ CUBE = 353;
+ CURRENT_P = 354;
+ CURRENT_CATALOG = 355;
+ CURRENT_DATE = 356;
+ CURRENT_ROLE = 357;
+ CURRENT_SCHEMA = 358;
+ CURRENT_TIME = 359;
+ CURRENT_TIMESTAMP = 360;
+ CURRENT_USER = 361;
+ CURSOR = 362;
+ CYCLE = 363;
+ DATA_P = 364;
+ DATABASE = 365;
+ DAY_P = 366;
+ DEALLOCATE = 367;
+ DEC = 368;
+ DECIMAL_P = 369;
+ DECLARE = 370;
+ DEFAULT = 371;
+ DEFAULTS = 372;
+ DEFERRABLE = 373;
+ DEFERRED = 374;
+ DEFINER = 375;
+ DELETE_P = 376;
+ DELIMITER = 377;
+ DELIMITERS = 378;
+ DEPENDS = 379;
+ DESC = 380;
+ DETACH = 381;
+ DICTIONARY = 382;
+ DISABLE_P = 383;
+ DISCARD = 384;
+ DISTINCT = 385;
+ DO = 386;
+ DOCUMENT_P = 387;
+ DOMAIN_P = 388;
+ DOUBLE_P = 389;
+ DROP = 390;
+ EACH = 391;
+ ELSE = 392;
+ ENABLE_P = 393;
+ ENCODING = 394;
+ ENCRYPTED = 395;
+ END_P = 396;
+ ENUM_P = 397;
+ ESCAPE = 398;
+ EVENT = 399;
+ EXCEPT = 400;
+ EXCLUDE = 401;
+ EXCLUDING = 402;
+ EXCLUSIVE = 403;
+ EXECUTE = 404;
+ EXISTS = 405;
+ EXPLAIN = 406;
+ EXPRESSION = 407;
+ EXTENSION = 408;
+ EXTERNAL = 409;
+ EXTRACT = 410;
+ FALSE_P = 411;
+ FAMILY = 412;
+ FETCH = 413;
+ FILTER = 414;
+ FIRST_P = 415;
+ FLOAT_P = 416;
+ FOLLOWING = 417;
+ FOR = 418;
+ FORCE = 419;
+ FOREIGN = 420;
+ FORWARD = 421;
+ FREEZE = 422;
+ FROM = 423;
+ FULL = 424;
+ FUNCTION = 425;
+ FUNCTIONS = 426;
+ GENERATED = 427;
+ GLOBAL = 428;
+ GRANT = 429;
+ GRANTED = 430;
+ GREATEST = 431;
+ GROUP_P = 432;
+ GROUPING = 433;
+ GROUPS = 434;
+ HANDLER = 435;
+ HAVING = 436;
+ HEADER_P = 437;
+ HOLD = 438;
+ HOUR_P = 439;
+ IDENTITY_P = 440;
+ IF_P = 441;
+ ILIKE = 442;
+ IMMEDIATE = 443;
+ IMMUTABLE = 444;
+ IMPLICIT_P = 445;
+ IMPORT_P = 446;
+ IN_P = 447;
+ INCLUDE = 448;
+ INCLUDING = 449;
+ INCREMENT = 450;
+ INDEX = 451;
+ INDEXES = 452;
+ INHERIT = 453;
+ INHERITS = 454;
+ INITIALLY = 455;
+ INLINE_P = 456;
+ INNER_P = 457;
+ INOUT = 458;
+ INPUT_P = 459;
+ INSENSITIVE = 460;
+ INSERT = 461;
+ INSTEAD = 462;
+ INT_P = 463;
+ INTEGER = 464;
+ INTERSECT = 465;
+ INTERVAL = 466;
+ INTO = 467;
+ INVOKER = 468;
+ IS = 469;
+ ISNULL = 470;
+ ISOLATION = 471;
+ JOIN = 472;
+ KEY = 473;
+ LABEL = 474;
+ LANGUAGE = 475;
+ LARGE_P = 476;
+ LAST_P = 477;
+ LATERAL_P = 478;
+ LEADING = 479;
+ LEAKPROOF = 480;
+ LEAST = 481;
+ LEFT = 482;
+ LEVEL = 483;
+ LIKE = 484;
+ LIMIT = 485;
+ LISTEN = 486;
+ LOAD = 487;
+ LOCAL = 488;
+ LOCALTIME = 489;
+ LOCALTIMESTAMP = 490;
+ LOCATION = 491;
+ LOCK_P = 492;
+ LOCKED = 493;
+ LOGGED = 494;
+ MAPPING = 495;
+ MATCH = 496;
+ MATERIALIZED = 497;
+ MAXVALUE = 498;
+ METHOD = 499;
+ MINUTE_P = 500;
+ MINVALUE = 501;
+ MODE = 502;
+ MONTH_P = 503;
+ MOVE = 504;
+ NAME_P = 505;
+ NAMES = 506;
+ NATIONAL = 507;
+ NATURAL = 508;
+ NCHAR = 509;
+ NEW = 510;
+ NEXT = 511;
+ NFC = 512;
+ NFD = 513;
+ NFKC = 514;
+ NFKD = 515;
+ NO = 516;
+ NONE = 517;
+ NORMALIZE = 518;
+ NORMALIZED = 519;
+ NOT = 520;
+ NOTHING = 521;
+ NOTIFY = 522;
+ NOTNULL = 523;
+ NOWAIT = 524;
+ NULL_P = 525;
+ NULLIF = 526;
+ NULLS_P = 527;
+ NUMERIC = 528;
+ OBJECT_P = 529;
+ OF = 530;
+ OFF = 531;
+ OFFSET = 532;
+ OIDS = 533;
+ OLD = 534;
+ ON = 535;
+ ONLY = 536;
+ OPERATOR = 537;
+ OPTION = 538;
+ OPTIONS = 539;
+ OR = 540;
+ ORDER = 541;
+ ORDINALITY = 542;
+ OTHERS = 543;
+ OUT_P = 544;
+ OUTER_P = 545;
+ OVER = 546;
+ OVERLAPS = 547;
+ OVERLAY = 548;
+ OVERRIDING = 549;
+ OWNED = 550;
+ OWNER = 551;
+ PARALLEL = 552;
+ PARSER = 553;
+ PARTIAL = 554;
+ PARTITION = 555;
+ PASSING = 556;
+ PASSWORD = 557;
+ PLACING = 558;
+ PLANS = 559;
+ POLICY = 560;
+ POSITION = 561;
+ PRECEDING = 562;
+ PRECISION = 563;
+ PRESERVE = 564;
+ PREPARE = 565;
+ PREPARED = 566;
+ PRIMARY = 567;
+ PRIOR = 568;
+ PRIVILEGES = 569;
+ PROCEDURAL = 570;
+ PROCEDURE = 571;
+ PROCEDURES = 572;
+ PROGRAM = 573;
+ PUBLICATION = 574;
+ QUOTE = 575;
+ RANGE = 576;
+ READ = 577;
+ REAL = 578;
+ REASSIGN = 579;
+ RECHECK = 580;
+ RECURSIVE = 581;
+ REF_P = 582;
+ REFERENCES = 583;
+ REFERENCING = 584;
+ REFRESH = 585;
+ REINDEX = 586;
+ RELATIVE_P = 587;
+ RELEASE = 588;
+ RENAME = 589;
+ REPEATABLE = 590;
+ REPLACE = 591;
+ REPLICA = 592;
+ RESET = 593;
+ RESTART = 594;
+ RESTRICT = 595;
+ RETURNING = 596;
+ RETURNS = 597;
+ REVOKE = 598;
+ RIGHT = 599;
+ ROLE = 600;
+ ROLLBACK = 601;
+ ROLLUP = 602;
+ ROUTINE = 603;
+ ROUTINES = 604;
+ ROW = 605;
+ ROWS = 606;
+ RULE = 607;
+ SAVEPOINT = 608;
+ SCHEMA = 609;
+ SCHEMAS = 610;
+ SCROLL = 611;
+ SEARCH = 612;
+ SECOND_P = 613;
+ SECURITY = 614;
+ SELECT = 615;
+ SEQUENCE = 616;
+ SEQUENCES = 617;
+ SERIALIZABLE = 618;
+ SERVER = 619;
+ SESSION = 620;
+ SESSION_USER = 621;
+ SET = 622;
+ SETS = 623;
+ SETOF = 624;
+ SHARE = 625;
+ SHOW = 626;
+ SIMILAR = 627;
+ SIMPLE = 628;
+ SKIP = 629;
+ SMALLINT = 630;
+ SNAPSHOT = 631;
+ SOME = 632;
+ SQL_P = 633;
+ STABLE = 634;
+ STANDALONE_P = 635;
+ START = 636;
+ STATEMENT = 637;
+ STATISTICS = 638;
+ STDIN = 639;
+ STDOUT = 640;
+ STORAGE = 641;
+ STORED = 642;
+ STRICT_P = 643;
+ STRIP_P = 644;
+ SUBSCRIPTION = 645;
+ SUBSTRING = 646;
+ SUPPORT = 647;
+ SYMMETRIC = 648;
+ SYSID = 649;
+ SYSTEM_P = 650;
+ TABLE = 651;
+ TABLES = 652;
+ TABLESAMPLE = 653;
+ TABLESPACE = 654;
+ TEMP = 655;
+ TEMPLATE = 656;
+ TEMPORARY = 657;
+ TEXT_P = 658;
+ THEN = 659;
+ TIES = 660;
+ TIME = 661;
+ TIMESTAMP = 662;
+ TO = 663;
+ TRAILING = 664;
+ TRANSACTION = 665;
+ TRANSFORM = 666;
+ TREAT = 667;
+ TRIGGER = 668;
+ TRIM = 669;
+ TRUE_P = 670;
+ TRUNCATE = 671;
+ TRUSTED = 672;
+ TYPE_P = 673;
+ TYPES_P = 674;
+ UESCAPE = 675;
+ UNBOUNDED = 676;
+ UNCOMMITTED = 677;
+ UNENCRYPTED = 678;
+ UNION = 679;
+ UNIQUE = 680;
+ UNKNOWN = 681;
+ UNLISTEN = 682;
+ UNLOGGED = 683;
+ UNTIL = 684;
+ UPDATE = 685;
+ USER = 686;
+ USING = 687;
+ VACUUM = 688;
+ VALID = 689;
+ VALIDATE = 690;
+ VALIDATOR = 691;
+ VALUE_P = 692;
+ VALUES = 693;
+ VARCHAR = 694;
+ VARIADIC = 695;
+ VARYING = 696;
+ VERBOSE = 697;
+ VERSION_P = 698;
+ VIEW = 699;
+ VIEWS = 700;
+ VOLATILE = 701;
+ WHEN = 702;
+ WHERE = 703;
+ WHITESPACE_P = 704;
+ WINDOW = 705;
+ WITH = 706;
+ WITHIN = 707;
+ WITHOUT = 708;
+ WORK = 709;
+ WRAPPER = 710;
+ WRITE = 711;
+ XML_P = 712;
+ XMLATTRIBUTES = 713;
+ XMLCONCAT = 714;
+ XMLELEMENT = 715;
+ XMLEXISTS = 716;
+ XMLFOREST = 717;
+ XMLNAMESPACES = 718;
+ XMLPARSE = 719;
+ XMLPI = 720;
+ XMLROOT = 721;
+ XMLSERIALIZE = 722;
+ XMLTABLE = 723;
+ YEAR_P = 724;
+ YES_P = 725;
+ ZONE = 726;
+ NOT_LA = 727;
+ NULLS_LA = 728;
+ WITH_LA = 729;
+ POSTFIXOP = 730;
+ UMINUS = 731;
+}
diff --git a/protos/14/pg_query.proto b/protos/14/pg_query.proto
new file mode 100644
index 00000000..3ae87fef
--- /dev/null
+++ b/protos/14/pg_query.proto
@@ -0,0 +1,3581 @@
+// This file is autogenerated by ./scripts/generate_protobuf_and_funcs.rb
+
+syntax = "proto3";
+
+package pg_query;
+
+message ParseResult {
+ int32 version = 1;
+ repeated RawStmt stmts = 2;
+}
+
+message ScanResult {
+ int32 version = 1;
+ repeated ScanToken tokens = 2;
+}
+
+message Node {
+ oneof node {
+ Alias alias = 1 [json_name="Alias"];
+ RangeVar range_var = 2 [json_name="RangeVar"];
+ TableFunc table_func = 3 [json_name="TableFunc"];
+ Expr expr = 4 [json_name="Expr"];
+ Var var = 5 [json_name="Var"];
+ Param param = 6 [json_name="Param"];
+ Aggref aggref = 7 [json_name="Aggref"];
+ GroupingFunc grouping_func = 8 [json_name="GroupingFunc"];
+ WindowFunc window_func = 9 [json_name="WindowFunc"];
+ SubscriptingRef subscripting_ref = 10 [json_name="SubscriptingRef"];
+ FuncExpr func_expr = 11 [json_name="FuncExpr"];
+ NamedArgExpr named_arg_expr = 12 [json_name="NamedArgExpr"];
+ OpExpr op_expr = 13 [json_name="OpExpr"];
+ DistinctExpr distinct_expr = 14 [json_name="DistinctExpr"];
+ NullIfExpr null_if_expr = 15 [json_name="NullIfExpr"];
+ ScalarArrayOpExpr scalar_array_op_expr = 16 [json_name="ScalarArrayOpExpr"];
+ BoolExpr bool_expr = 17 [json_name="BoolExpr"];
+ SubLink sub_link = 18 [json_name="SubLink"];
+ SubPlan sub_plan = 19 [json_name="SubPlan"];
+ AlternativeSubPlan alternative_sub_plan = 20 [json_name="AlternativeSubPlan"];
+ FieldSelect field_select = 21 [json_name="FieldSelect"];
+ FieldStore field_store = 22 [json_name="FieldStore"];
+ RelabelType relabel_type = 23 [json_name="RelabelType"];
+ CoerceViaIO coerce_via_io = 24 [json_name="CoerceViaIO"];
+ ArrayCoerceExpr array_coerce_expr = 25 [json_name="ArrayCoerceExpr"];
+ ConvertRowtypeExpr convert_rowtype_expr = 26 [json_name="ConvertRowtypeExpr"];
+ CollateExpr collate_expr = 27 [json_name="CollateExpr"];
+ CaseExpr case_expr = 28 [json_name="CaseExpr"];
+ CaseWhen case_when = 29 [json_name="CaseWhen"];
+ CaseTestExpr case_test_expr = 30 [json_name="CaseTestExpr"];
+ ArrayExpr array_expr = 31 [json_name="ArrayExpr"];
+ RowExpr row_expr = 32 [json_name="RowExpr"];
+ RowCompareExpr row_compare_expr = 33 [json_name="RowCompareExpr"];
+ CoalesceExpr coalesce_expr = 34 [json_name="CoalesceExpr"];
+ MinMaxExpr min_max_expr = 35 [json_name="MinMaxExpr"];
+ SQLValueFunction sqlvalue_function = 36 [json_name="SQLValueFunction"];
+ XmlExpr xml_expr = 37 [json_name="XmlExpr"];
+ NullTest null_test = 38 [json_name="NullTest"];
+ BooleanTest boolean_test = 39 [json_name="BooleanTest"];
+ CoerceToDomain coerce_to_domain = 40 [json_name="CoerceToDomain"];
+ CoerceToDomainValue coerce_to_domain_value = 41 [json_name="CoerceToDomainValue"];
+ SetToDefault set_to_default = 42 [json_name="SetToDefault"];
+ CurrentOfExpr current_of_expr = 43 [json_name="CurrentOfExpr"];
+ NextValueExpr next_value_expr = 44 [json_name="NextValueExpr"];
+ InferenceElem inference_elem = 45 [json_name="InferenceElem"];
+ TargetEntry target_entry = 46 [json_name="TargetEntry"];
+ RangeTblRef range_tbl_ref = 47 [json_name="RangeTblRef"];
+ JoinExpr join_expr = 48 [json_name="JoinExpr"];
+ FromExpr from_expr = 49 [json_name="FromExpr"];
+ OnConflictExpr on_conflict_expr = 50 [json_name="OnConflictExpr"];
+ IntoClause into_clause = 51 [json_name="IntoClause"];
+ RawStmt raw_stmt = 52 [json_name="RawStmt"];
+ Query query = 53 [json_name="Query"];
+ InsertStmt insert_stmt = 54 [json_name="InsertStmt"];
+ DeleteStmt delete_stmt = 55 [json_name="DeleteStmt"];
+ UpdateStmt update_stmt = 56 [json_name="UpdateStmt"];
+ SelectStmt select_stmt = 57 [json_name="SelectStmt"];
+ ReturnStmt return_stmt = 58 [json_name="ReturnStmt"];
+ PLAssignStmt plassign_stmt = 59 [json_name="PLAssignStmt"];
+ AlterTableStmt alter_table_stmt = 60 [json_name="AlterTableStmt"];
+ AlterTableCmd alter_table_cmd = 61 [json_name="AlterTableCmd"];
+ AlterDomainStmt alter_domain_stmt = 62 [json_name="AlterDomainStmt"];
+ SetOperationStmt set_operation_stmt = 63 [json_name="SetOperationStmt"];
+ GrantStmt grant_stmt = 64 [json_name="GrantStmt"];
+ GrantRoleStmt grant_role_stmt = 65 [json_name="GrantRoleStmt"];
+ AlterDefaultPrivilegesStmt alter_default_privileges_stmt = 66 [json_name="AlterDefaultPrivilegesStmt"];
+ ClosePortalStmt close_portal_stmt = 67 [json_name="ClosePortalStmt"];
+ ClusterStmt cluster_stmt = 68 [json_name="ClusterStmt"];
+ CopyStmt copy_stmt = 69 [json_name="CopyStmt"];
+ CreateStmt create_stmt = 70 [json_name="CreateStmt"];
+ DefineStmt define_stmt = 71 [json_name="DefineStmt"];
+ DropStmt drop_stmt = 72 [json_name="DropStmt"];
+ TruncateStmt truncate_stmt = 73 [json_name="TruncateStmt"];
+ CommentStmt comment_stmt = 74 [json_name="CommentStmt"];
+ FetchStmt fetch_stmt = 75 [json_name="FetchStmt"];
+ IndexStmt index_stmt = 76 [json_name="IndexStmt"];
+ CreateFunctionStmt create_function_stmt = 77 [json_name="CreateFunctionStmt"];
+ AlterFunctionStmt alter_function_stmt = 78 [json_name="AlterFunctionStmt"];
+ DoStmt do_stmt = 79 [json_name="DoStmt"];
+ RenameStmt rename_stmt = 80 [json_name="RenameStmt"];
+ RuleStmt rule_stmt = 81 [json_name="RuleStmt"];
+ NotifyStmt notify_stmt = 82 [json_name="NotifyStmt"];
+ ListenStmt listen_stmt = 83 [json_name="ListenStmt"];
+ UnlistenStmt unlisten_stmt = 84 [json_name="UnlistenStmt"];
+ TransactionStmt transaction_stmt = 85 [json_name="TransactionStmt"];
+ ViewStmt view_stmt = 86 [json_name="ViewStmt"];
+ LoadStmt load_stmt = 87 [json_name="LoadStmt"];
+ CreateDomainStmt create_domain_stmt = 88 [json_name="CreateDomainStmt"];
+ CreatedbStmt createdb_stmt = 89 [json_name="CreatedbStmt"];
+ DropdbStmt dropdb_stmt = 90 [json_name="DropdbStmt"];
+ VacuumStmt vacuum_stmt = 91 [json_name="VacuumStmt"];
+ ExplainStmt explain_stmt = 92 [json_name="ExplainStmt"];
+ CreateTableAsStmt create_table_as_stmt = 93 [json_name="CreateTableAsStmt"];
+ CreateSeqStmt create_seq_stmt = 94 [json_name="CreateSeqStmt"];
+ AlterSeqStmt alter_seq_stmt = 95 [json_name="AlterSeqStmt"];
+ VariableSetStmt variable_set_stmt = 96 [json_name="VariableSetStmt"];
+ VariableShowStmt variable_show_stmt = 97 [json_name="VariableShowStmt"];
+ DiscardStmt discard_stmt = 98 [json_name="DiscardStmt"];
+ CreateTrigStmt create_trig_stmt = 99 [json_name="CreateTrigStmt"];
+ CreatePLangStmt create_plang_stmt = 100 [json_name="CreatePLangStmt"];
+ CreateRoleStmt create_role_stmt = 101 [json_name="CreateRoleStmt"];
+ AlterRoleStmt alter_role_stmt = 102 [json_name="AlterRoleStmt"];
+ DropRoleStmt drop_role_stmt = 103 [json_name="DropRoleStmt"];
+ LockStmt lock_stmt = 104 [json_name="LockStmt"];
+ ConstraintsSetStmt constraints_set_stmt = 105 [json_name="ConstraintsSetStmt"];
+ ReindexStmt reindex_stmt = 106 [json_name="ReindexStmt"];
+ CheckPointStmt check_point_stmt = 107 [json_name="CheckPointStmt"];
+ CreateSchemaStmt create_schema_stmt = 108 [json_name="CreateSchemaStmt"];
+ AlterDatabaseStmt alter_database_stmt = 109 [json_name="AlterDatabaseStmt"];
+ AlterDatabaseSetStmt alter_database_set_stmt = 110 [json_name="AlterDatabaseSetStmt"];
+ AlterRoleSetStmt alter_role_set_stmt = 111 [json_name="AlterRoleSetStmt"];
+ CreateConversionStmt create_conversion_stmt = 112 [json_name="CreateConversionStmt"];
+ CreateCastStmt create_cast_stmt = 113 [json_name="CreateCastStmt"];
+ CreateOpClassStmt create_op_class_stmt = 114 [json_name="CreateOpClassStmt"];
+ CreateOpFamilyStmt create_op_family_stmt = 115 [json_name="CreateOpFamilyStmt"];
+ AlterOpFamilyStmt alter_op_family_stmt = 116 [json_name="AlterOpFamilyStmt"];
+ PrepareStmt prepare_stmt = 117 [json_name="PrepareStmt"];
+ ExecuteStmt execute_stmt = 118 [json_name="ExecuteStmt"];
+ DeallocateStmt deallocate_stmt = 119 [json_name="DeallocateStmt"];
+ DeclareCursorStmt declare_cursor_stmt = 120 [json_name="DeclareCursorStmt"];
+ CreateTableSpaceStmt create_table_space_stmt = 121 [json_name="CreateTableSpaceStmt"];
+ DropTableSpaceStmt drop_table_space_stmt = 122 [json_name="DropTableSpaceStmt"];
+ AlterObjectDependsStmt alter_object_depends_stmt = 123 [json_name="AlterObjectDependsStmt"];
+ AlterObjectSchemaStmt alter_object_schema_stmt = 124 [json_name="AlterObjectSchemaStmt"];
+ AlterOwnerStmt alter_owner_stmt = 125 [json_name="AlterOwnerStmt"];
+ AlterOperatorStmt alter_operator_stmt = 126 [json_name="AlterOperatorStmt"];
+ AlterTypeStmt alter_type_stmt = 127 [json_name="AlterTypeStmt"];
+ DropOwnedStmt drop_owned_stmt = 128 [json_name="DropOwnedStmt"];
+ ReassignOwnedStmt reassign_owned_stmt = 129 [json_name="ReassignOwnedStmt"];
+ CompositeTypeStmt composite_type_stmt = 130 [json_name="CompositeTypeStmt"];
+ CreateEnumStmt create_enum_stmt = 131 [json_name="CreateEnumStmt"];
+ CreateRangeStmt create_range_stmt = 132 [json_name="CreateRangeStmt"];
+ AlterEnumStmt alter_enum_stmt = 133 [json_name="AlterEnumStmt"];
+ AlterTSDictionaryStmt alter_tsdictionary_stmt = 134 [json_name="AlterTSDictionaryStmt"];
+ AlterTSConfigurationStmt alter_tsconfiguration_stmt = 135 [json_name="AlterTSConfigurationStmt"];
+ CreateFdwStmt create_fdw_stmt = 136 [json_name="CreateFdwStmt"];
+ AlterFdwStmt alter_fdw_stmt = 137 [json_name="AlterFdwStmt"];
+ CreateForeignServerStmt create_foreign_server_stmt = 138 [json_name="CreateForeignServerStmt"];
+ AlterForeignServerStmt alter_foreign_server_stmt = 139 [json_name="AlterForeignServerStmt"];
+ CreateUserMappingStmt create_user_mapping_stmt = 140 [json_name="CreateUserMappingStmt"];
+ AlterUserMappingStmt alter_user_mapping_stmt = 141 [json_name="AlterUserMappingStmt"];
+ DropUserMappingStmt drop_user_mapping_stmt = 142 [json_name="DropUserMappingStmt"];
+ AlterTableSpaceOptionsStmt alter_table_space_options_stmt = 143 [json_name="AlterTableSpaceOptionsStmt"];
+ AlterTableMoveAllStmt alter_table_move_all_stmt = 144 [json_name="AlterTableMoveAllStmt"];
+ SecLabelStmt sec_label_stmt = 145 [json_name="SecLabelStmt"];
+ CreateForeignTableStmt create_foreign_table_stmt = 146 [json_name="CreateForeignTableStmt"];
+ ImportForeignSchemaStmt import_foreign_schema_stmt = 147 [json_name="ImportForeignSchemaStmt"];
+ CreateExtensionStmt create_extension_stmt = 148 [json_name="CreateExtensionStmt"];
+ AlterExtensionStmt alter_extension_stmt = 149 [json_name="AlterExtensionStmt"];
+ AlterExtensionContentsStmt alter_extension_contents_stmt = 150 [json_name="AlterExtensionContentsStmt"];
+ CreateEventTrigStmt create_event_trig_stmt = 151 [json_name="CreateEventTrigStmt"];
+ AlterEventTrigStmt alter_event_trig_stmt = 152 [json_name="AlterEventTrigStmt"];
+ RefreshMatViewStmt refresh_mat_view_stmt = 153 [json_name="RefreshMatViewStmt"];
+ ReplicaIdentityStmt replica_identity_stmt = 154 [json_name="ReplicaIdentityStmt"];
+ AlterSystemStmt alter_system_stmt = 155 [json_name="AlterSystemStmt"];
+ CreatePolicyStmt create_policy_stmt = 156 [json_name="CreatePolicyStmt"];
+ AlterPolicyStmt alter_policy_stmt = 157 [json_name="AlterPolicyStmt"];
+ CreateTransformStmt create_transform_stmt = 158 [json_name="CreateTransformStmt"];
+ CreateAmStmt create_am_stmt = 159 [json_name="CreateAmStmt"];
+ CreatePublicationStmt create_publication_stmt = 160 [json_name="CreatePublicationStmt"];
+ AlterPublicationStmt alter_publication_stmt = 161 [json_name="AlterPublicationStmt"];
+ CreateSubscriptionStmt create_subscription_stmt = 162 [json_name="CreateSubscriptionStmt"];
+ AlterSubscriptionStmt alter_subscription_stmt = 163 [json_name="AlterSubscriptionStmt"];
+ DropSubscriptionStmt drop_subscription_stmt = 164 [json_name="DropSubscriptionStmt"];
+ CreateStatsStmt create_stats_stmt = 165 [json_name="CreateStatsStmt"];
+ AlterCollationStmt alter_collation_stmt = 166 [json_name="AlterCollationStmt"];
+ CallStmt call_stmt = 167 [json_name="CallStmt"];
+ AlterStatsStmt alter_stats_stmt = 168 [json_name="AlterStatsStmt"];
+ A_Expr a_expr = 169 [json_name="A_Expr"];
+ ColumnRef column_ref = 170 [json_name="ColumnRef"];
+ ParamRef param_ref = 171 [json_name="ParamRef"];
+ A_Const a_const = 172 [json_name="A_Const"];
+ FuncCall func_call = 173 [json_name="FuncCall"];
+ A_Star a_star = 174 [json_name="A_Star"];
+ A_Indices a_indices = 175 [json_name="A_Indices"];
+ A_Indirection a_indirection = 176 [json_name="A_Indirection"];
+ A_ArrayExpr a_array_expr = 177 [json_name="A_ArrayExpr"];
+ ResTarget res_target = 178 [json_name="ResTarget"];
+ MultiAssignRef multi_assign_ref = 179 [json_name="MultiAssignRef"];
+ TypeCast type_cast = 180 [json_name="TypeCast"];
+ CollateClause collate_clause = 181 [json_name="CollateClause"];
+ SortBy sort_by = 182 [json_name="SortBy"];
+ WindowDef window_def = 183 [json_name="WindowDef"];
+ RangeSubselect range_subselect = 184 [json_name="RangeSubselect"];
+ RangeFunction range_function = 185 [json_name="RangeFunction"];
+ RangeTableSample range_table_sample = 186 [json_name="RangeTableSample"];
+ RangeTableFunc range_table_func = 187 [json_name="RangeTableFunc"];
+ RangeTableFuncCol range_table_func_col = 188 [json_name="RangeTableFuncCol"];
+ TypeName type_name = 189 [json_name="TypeName"];
+ ColumnDef column_def = 190 [json_name="ColumnDef"];
+ IndexElem index_elem = 191 [json_name="IndexElem"];
+ StatsElem stats_elem = 192 [json_name="StatsElem"];
+ Constraint constraint = 193 [json_name="Constraint"];
+ DefElem def_elem = 194 [json_name="DefElem"];
+ RangeTblEntry range_tbl_entry = 195 [json_name="RangeTblEntry"];
+ RangeTblFunction range_tbl_function = 196 [json_name="RangeTblFunction"];
+ TableSampleClause table_sample_clause = 197 [json_name="TableSampleClause"];
+ WithCheckOption with_check_option = 198 [json_name="WithCheckOption"];
+ SortGroupClause sort_group_clause = 199 [json_name="SortGroupClause"];
+ GroupingSet grouping_set = 200 [json_name="GroupingSet"];
+ WindowClause window_clause = 201 [json_name="WindowClause"];
+ ObjectWithArgs object_with_args = 202 [json_name="ObjectWithArgs"];
+ AccessPriv access_priv = 203 [json_name="AccessPriv"];
+ CreateOpClassItem create_op_class_item = 204 [json_name="CreateOpClassItem"];
+ TableLikeClause table_like_clause = 205 [json_name="TableLikeClause"];
+ FunctionParameter function_parameter = 206 [json_name="FunctionParameter"];
+ LockingClause locking_clause = 207 [json_name="LockingClause"];
+ RowMarkClause row_mark_clause = 208 [json_name="RowMarkClause"];
+ XmlSerialize xml_serialize = 209 [json_name="XmlSerialize"];
+ WithClause with_clause = 210 [json_name="WithClause"];
+ InferClause infer_clause = 211 [json_name="InferClause"];
+ OnConflictClause on_conflict_clause = 212 [json_name="OnConflictClause"];
+ CTESearchClause ctesearch_clause = 213 [json_name="CTESearchClause"];
+ CTECycleClause ctecycle_clause = 214 [json_name="CTECycleClause"];
+ CommonTableExpr common_table_expr = 215 [json_name="CommonTableExpr"];
+ RoleSpec role_spec = 216 [json_name="RoleSpec"];
+ TriggerTransition trigger_transition = 217 [json_name="TriggerTransition"];
+ PartitionElem partition_elem = 218 [json_name="PartitionElem"];
+ PartitionSpec partition_spec = 219 [json_name="PartitionSpec"];
+ PartitionBoundSpec partition_bound_spec = 220 [json_name="PartitionBoundSpec"];
+ PartitionRangeDatum partition_range_datum = 221 [json_name="PartitionRangeDatum"];
+ PartitionCmd partition_cmd = 222 [json_name="PartitionCmd"];
+ VacuumRelation vacuum_relation = 223 [json_name="VacuumRelation"];
+ InlineCodeBlock inline_code_block = 224 [json_name="InlineCodeBlock"];
+ CallContext call_context = 225 [json_name="CallContext"];
+ Integer integer = 226 [json_name="Integer"];
+ Float float = 227 [json_name="Float"];
+ String string = 228 [json_name="String"];
+ BitString bit_string = 229 [json_name="BitString"];
+ Null null = 230 [json_name="Null"];
+ List list = 231 [json_name="List"];
+ IntList int_list = 232 [json_name="IntList"];
+ OidList oid_list = 233 [json_name="OidList"];
+ }
+}
+
+message Integer
+{
+ int32 ival = 1; /* machine integer */
+}
+
+message Float
+{
+ string str = 1; /* string */
+}
+
+message String
+{
+ string str = 1; /* string */
+}
+
+message BitString
+{
+ string str = 1; /* string */
+}
+
+message Null
+{
+ // intentionally empty
+}
+
+message List
+{
+ repeated Node items = 1;
+}
+
+message OidList
+{
+ repeated Node items = 1;
+}
+
+message IntList
+{
+ repeated Node items = 1;
+}
+
+message Alias
+{
+ string aliasname = 1 [json_name="aliasname"];
+ repeated Node colnames = 2 [json_name="colnames"];
+}
+
+message RangeVar
+{
+ string catalogname = 1 [json_name="catalogname"];
+ string schemaname = 2 [json_name="schemaname"];
+ string relname = 3 [json_name="relname"];
+ bool inh = 4 [json_name="inh"];
+ string relpersistence = 5 [json_name="relpersistence"];
+ Alias alias = 6 [json_name="alias"];
+ int32 location = 7 [json_name="location"];
+}
+
+message TableFunc
+{
+ repeated Node ns_uris = 1 [json_name="ns_uris"];
+ repeated Node ns_names = 2 [json_name="ns_names"];
+ Node docexpr = 3 [json_name="docexpr"];
+ Node rowexpr = 4 [json_name="rowexpr"];
+ repeated Node colnames = 5 [json_name="colnames"];
+ repeated Node coltypes = 6 [json_name="coltypes"];
+ repeated Node coltypmods = 7 [json_name="coltypmods"];
+ repeated Node colcollations = 8 [json_name="colcollations"];
+ repeated Node colexprs = 9 [json_name="colexprs"];
+ repeated Node coldefexprs = 10 [json_name="coldefexprs"];
+ repeated uint64 notnulls = 11 [json_name="notnulls"];
+ int32 ordinalitycol = 12 [json_name="ordinalitycol"];
+ int32 location = 13 [json_name="location"];
+}
+
+message Expr
+{
+}
+
+message Var
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 varno = 2 [json_name="varno"];
+ int32 varattno = 3 [json_name="varattno"];
+ uint32 vartype = 4 [json_name="vartype"];
+ int32 vartypmod = 5 [json_name="vartypmod"];
+ uint32 varcollid = 6 [json_name="varcollid"];
+ uint32 varlevelsup = 7 [json_name="varlevelsup"];
+ uint32 varnosyn = 8 [json_name="varnosyn"];
+ int32 varattnosyn = 9 [json_name="varattnosyn"];
+ int32 location = 10 [json_name="location"];
+}
+
+message Param
+{
+ Node xpr = 1 [json_name="xpr"];
+ ParamKind paramkind = 2 [json_name="paramkind"];
+ int32 paramid = 3 [json_name="paramid"];
+ uint32 paramtype = 4 [json_name="paramtype"];
+ int32 paramtypmod = 5 [json_name="paramtypmod"];
+ uint32 paramcollid = 6 [json_name="paramcollid"];
+ int32 location = 7 [json_name="location"];
+}
+
+message Aggref
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 aggfnoid = 2 [json_name="aggfnoid"];
+ uint32 aggtype = 3 [json_name="aggtype"];
+ uint32 aggcollid = 4 [json_name="aggcollid"];
+ uint32 inputcollid = 5 [json_name="inputcollid"];
+ uint32 aggtranstype = 6 [json_name="aggtranstype"];
+ repeated Node aggargtypes = 7 [json_name="aggargtypes"];
+ repeated Node aggdirectargs = 8 [json_name="aggdirectargs"];
+ repeated Node args = 9 [json_name="args"];
+ repeated Node aggorder = 10 [json_name="aggorder"];
+ repeated Node aggdistinct = 11 [json_name="aggdistinct"];
+ Node aggfilter = 12 [json_name="aggfilter"];
+ bool aggstar = 13 [json_name="aggstar"];
+ bool aggvariadic = 14 [json_name="aggvariadic"];
+ string aggkind = 15 [json_name="aggkind"];
+ uint32 agglevelsup = 16 [json_name="agglevelsup"];
+ AggSplit aggsplit = 17 [json_name="aggsplit"];
+ int32 aggno = 18 [json_name="aggno"];
+ int32 aggtransno = 19 [json_name="aggtransno"];
+ int32 location = 20 [json_name="location"];
+}
+
+message GroupingFunc
+{
+ Node xpr = 1 [json_name="xpr"];
+ repeated Node args = 2 [json_name="args"];
+ repeated Node refs = 3 [json_name="refs"];
+ repeated Node cols = 4 [json_name="cols"];
+ uint32 agglevelsup = 5 [json_name="agglevelsup"];
+ int32 location = 6 [json_name="location"];
+}
+
+message WindowFunc
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 winfnoid = 2 [json_name="winfnoid"];
+ uint32 wintype = 3 [json_name="wintype"];
+ uint32 wincollid = 4 [json_name="wincollid"];
+ uint32 inputcollid = 5 [json_name="inputcollid"];
+ repeated Node args = 6 [json_name="args"];
+ Node aggfilter = 7 [json_name="aggfilter"];
+ uint32 winref = 8 [json_name="winref"];
+ bool winstar = 9 [json_name="winstar"];
+ bool winagg = 10 [json_name="winagg"];
+ int32 location = 11 [json_name="location"];
+}
+
+message SubscriptingRef
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 refcontainertype = 2 [json_name="refcontainertype"];
+ uint32 refelemtype = 3 [json_name="refelemtype"];
+ uint32 refrestype = 4 [json_name="refrestype"];
+ int32 reftypmod = 5 [json_name="reftypmod"];
+ uint32 refcollid = 6 [json_name="refcollid"];
+ repeated Node refupperindexpr = 7 [json_name="refupperindexpr"];
+ repeated Node reflowerindexpr = 8 [json_name="reflowerindexpr"];
+ Node refexpr = 9 [json_name="refexpr"];
+ Node refassgnexpr = 10 [json_name="refassgnexpr"];
+}
+
+message FuncExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 funcid = 2 [json_name="funcid"];
+ uint32 funcresulttype = 3 [json_name="funcresulttype"];
+ bool funcretset = 4 [json_name="funcretset"];
+ bool funcvariadic = 5 [json_name="funcvariadic"];
+ CoercionForm funcformat = 6 [json_name="funcformat"];
+ uint32 funccollid = 7 [json_name="funccollid"];
+ uint32 inputcollid = 8 [json_name="inputcollid"];
+ repeated Node args = 9 [json_name="args"];
+ int32 location = 10 [json_name="location"];
+}
+
+message NamedArgExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ string name = 3 [json_name="name"];
+ int32 argnumber = 4 [json_name="argnumber"];
+ int32 location = 5 [json_name="location"];
+}
+
+message OpExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 opno = 2 [json_name="opno"];
+ uint32 opfuncid = 3 [json_name="opfuncid"];
+ uint32 opresulttype = 4 [json_name="opresulttype"];
+ bool opretset = 5 [json_name="opretset"];
+ uint32 opcollid = 6 [json_name="opcollid"];
+ uint32 inputcollid = 7 [json_name="inputcollid"];
+ repeated Node args = 8 [json_name="args"];
+ int32 location = 9 [json_name="location"];
+}
+
+message DistinctExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 opno = 2 [json_name="opno"];
+ uint32 opfuncid = 3 [json_name="opfuncid"];
+ uint32 opresulttype = 4 [json_name="opresulttype"];
+ bool opretset = 5 [json_name="opretset"];
+ uint32 opcollid = 6 [json_name="opcollid"];
+ uint32 inputcollid = 7 [json_name="inputcollid"];
+ repeated Node args = 8 [json_name="args"];
+ int32 location = 9 [json_name="location"];
+}
+
+message NullIfExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 opno = 2 [json_name="opno"];
+ uint32 opfuncid = 3 [json_name="opfuncid"];
+ uint32 opresulttype = 4 [json_name="opresulttype"];
+ bool opretset = 5 [json_name="opretset"];
+ uint32 opcollid = 6 [json_name="opcollid"];
+ uint32 inputcollid = 7 [json_name="inputcollid"];
+ repeated Node args = 8 [json_name="args"];
+ int32 location = 9 [json_name="location"];
+}
+
+message ScalarArrayOpExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 opno = 2 [json_name="opno"];
+ uint32 opfuncid = 3 [json_name="opfuncid"];
+ uint32 hashfuncid = 4 [json_name="hashfuncid"];
+ bool use_or = 5 [json_name="useOr"];
+ uint32 inputcollid = 6 [json_name="inputcollid"];
+ repeated Node args = 7 [json_name="args"];
+ int32 location = 8 [json_name="location"];
+}
+
+message BoolExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ BoolExprType boolop = 2 [json_name="boolop"];
+ repeated Node args = 3 [json_name="args"];
+ int32 location = 4 [json_name="location"];
+}
+
+message SubLink
+{
+ Node xpr = 1 [json_name="xpr"];
+ SubLinkType sub_link_type = 2 [json_name="subLinkType"];
+ int32 sub_link_id = 3 [json_name="subLinkId"];
+ Node testexpr = 4 [json_name="testexpr"];
+ repeated Node oper_name = 5 [json_name="operName"];
+ Node subselect = 6 [json_name="subselect"];
+ int32 location = 7 [json_name="location"];
+}
+
+message SubPlan
+{
+ Node xpr = 1 [json_name="xpr"];
+ SubLinkType sub_link_type = 2 [json_name="subLinkType"];
+ Node testexpr = 3 [json_name="testexpr"];
+ repeated Node param_ids = 4 [json_name="paramIds"];
+ int32 plan_id = 5 [json_name="plan_id"];
+ string plan_name = 6 [json_name="plan_name"];
+ uint32 first_col_type = 7 [json_name="firstColType"];
+ int32 first_col_typmod = 8 [json_name="firstColTypmod"];
+ uint32 first_col_collation = 9 [json_name="firstColCollation"];
+ bool use_hash_table = 10 [json_name="useHashTable"];
+ bool unknown_eq_false = 11 [json_name="unknownEqFalse"];
+ bool parallel_safe = 12 [json_name="parallel_safe"];
+ repeated Node set_param = 13 [json_name="setParam"];
+ repeated Node par_param = 14 [json_name="parParam"];
+ repeated Node args = 15 [json_name="args"];
+ double startup_cost = 16 [json_name="startup_cost"];
+ double per_call_cost = 17 [json_name="per_call_cost"];
+}
+
+message AlternativeSubPlan
+{
+ Node xpr = 1 [json_name="xpr"];
+ repeated Node subplans = 2 [json_name="subplans"];
+}
+
+message FieldSelect
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ int32 fieldnum = 3 [json_name="fieldnum"];
+ uint32 resulttype = 4 [json_name="resulttype"];
+ int32 resulttypmod = 5 [json_name="resulttypmod"];
+ uint32 resultcollid = 6 [json_name="resultcollid"];
+}
+
+message FieldStore
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ repeated Node newvals = 3 [json_name="newvals"];
+ repeated Node fieldnums = 4 [json_name="fieldnums"];
+ uint32 resulttype = 5 [json_name="resulttype"];
+}
+
+message RelabelType
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ uint32 resulttype = 3 [json_name="resulttype"];
+ int32 resulttypmod = 4 [json_name="resulttypmod"];
+ uint32 resultcollid = 5 [json_name="resultcollid"];
+ CoercionForm relabelformat = 6 [json_name="relabelformat"];
+ int32 location = 7 [json_name="location"];
+}
+
+message CoerceViaIO
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ uint32 resulttype = 3 [json_name="resulttype"];
+ uint32 resultcollid = 4 [json_name="resultcollid"];
+ CoercionForm coerceformat = 5 [json_name="coerceformat"];
+ int32 location = 6 [json_name="location"];
+}
+
+message ArrayCoerceExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ Node elemexpr = 3 [json_name="elemexpr"];
+ uint32 resulttype = 4 [json_name="resulttype"];
+ int32 resulttypmod = 5 [json_name="resulttypmod"];
+ uint32 resultcollid = 6 [json_name="resultcollid"];
+ CoercionForm coerceformat = 7 [json_name="coerceformat"];
+ int32 location = 8 [json_name="location"];
+}
+
+message ConvertRowtypeExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ uint32 resulttype = 3 [json_name="resulttype"];
+ CoercionForm convertformat = 4 [json_name="convertformat"];
+ int32 location = 5 [json_name="location"];
+}
+
+message CollateExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ uint32 coll_oid = 3 [json_name="collOid"];
+ int32 location = 4 [json_name="location"];
+}
+
+message CaseExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 casetype = 2 [json_name="casetype"];
+ uint32 casecollid = 3 [json_name="casecollid"];
+ Node arg = 4 [json_name="arg"];
+ repeated Node args = 5 [json_name="args"];
+ Node defresult = 6 [json_name="defresult"];
+ int32 location = 7 [json_name="location"];
+}
+
+message CaseWhen
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node expr = 2 [json_name="expr"];
+ Node result = 3 [json_name="result"];
+ int32 location = 4 [json_name="location"];
+}
+
+message CaseTestExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 type_id = 2 [json_name="typeId"];
+ int32 type_mod = 3 [json_name="typeMod"];
+ uint32 collation = 4 [json_name="collation"];
+}
+
+message ArrayExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 array_typeid = 2 [json_name="array_typeid"];
+ uint32 array_collid = 3 [json_name="array_collid"];
+ uint32 element_typeid = 4 [json_name="element_typeid"];
+ repeated Node elements = 5 [json_name="elements"];
+ bool multidims = 6 [json_name="multidims"];
+ int32 location = 7 [json_name="location"];
+}
+
+message RowExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ repeated Node args = 2 [json_name="args"];
+ uint32 row_typeid = 3 [json_name="row_typeid"];
+ CoercionForm row_format = 4 [json_name="row_format"];
+ repeated Node colnames = 5 [json_name="colnames"];
+ int32 location = 6 [json_name="location"];
+}
+
+message RowCompareExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ RowCompareType rctype = 2 [json_name="rctype"];
+ repeated Node opnos = 3 [json_name="opnos"];
+ repeated Node opfamilies = 4 [json_name="opfamilies"];
+ repeated Node inputcollids = 5 [json_name="inputcollids"];
+ repeated Node largs = 6 [json_name="largs"];
+ repeated Node rargs = 7 [json_name="rargs"];
+}
+
+message CoalesceExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 coalescetype = 2 [json_name="coalescetype"];
+ uint32 coalescecollid = 3 [json_name="coalescecollid"];
+ repeated Node args = 4 [json_name="args"];
+ int32 location = 5 [json_name="location"];
+}
+
+message MinMaxExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 minmaxtype = 2 [json_name="minmaxtype"];
+ uint32 minmaxcollid = 3 [json_name="minmaxcollid"];
+ uint32 inputcollid = 4 [json_name="inputcollid"];
+ MinMaxOp op = 5 [json_name="op"];
+ repeated Node args = 6 [json_name="args"];
+ int32 location = 7 [json_name="location"];
+}
+
+message SQLValueFunction
+{
+ Node xpr = 1 [json_name="xpr"];
+ SQLValueFunctionOp op = 2 [json_name="op"];
+ uint32 type = 3 [json_name="type"];
+ int32 typmod = 4 [json_name="typmod"];
+ int32 location = 5 [json_name="location"];
+}
+
+message XmlExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ XmlExprOp op = 2 [json_name="op"];
+ string name = 3 [json_name="name"];
+ repeated Node named_args = 4 [json_name="named_args"];
+ repeated Node arg_names = 5 [json_name="arg_names"];
+ repeated Node args = 6 [json_name="args"];
+ XmlOptionType xmloption = 7 [json_name="xmloption"];
+ uint32 type = 8 [json_name="type"];
+ int32 typmod = 9 [json_name="typmod"];
+ int32 location = 10 [json_name="location"];
+}
+
+message NullTest
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ NullTestType nulltesttype = 3 [json_name="nulltesttype"];
+ bool argisrow = 4 [json_name="argisrow"];
+ int32 location = 5 [json_name="location"];
+}
+
+message BooleanTest
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ BoolTestType booltesttype = 3 [json_name="booltesttype"];
+ int32 location = 4 [json_name="location"];
+}
+
+message CoerceToDomain
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ uint32 resulttype = 3 [json_name="resulttype"];
+ int32 resulttypmod = 4 [json_name="resulttypmod"];
+ uint32 resultcollid = 5 [json_name="resultcollid"];
+ CoercionForm coercionformat = 6 [json_name="coercionformat"];
+ int32 location = 7 [json_name="location"];
+}
+
+message CoerceToDomainValue
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 type_id = 2 [json_name="typeId"];
+ int32 type_mod = 3 [json_name="typeMod"];
+ uint32 collation = 4 [json_name="collation"];
+ int32 location = 5 [json_name="location"];
+}
+
+message SetToDefault
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 type_id = 2 [json_name="typeId"];
+ int32 type_mod = 3 [json_name="typeMod"];
+ uint32 collation = 4 [json_name="collation"];
+ int32 location = 5 [json_name="location"];
+}
+
+message CurrentOfExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 cvarno = 2 [json_name="cvarno"];
+ string cursor_name = 3 [json_name="cursor_name"];
+ int32 cursor_param = 4 [json_name="cursor_param"];
+}
+
+message NextValueExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 seqid = 2 [json_name="seqid"];
+ uint32 type_id = 3 [json_name="typeId"];
+}
+
+message InferenceElem
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node expr = 2 [json_name="expr"];
+ uint32 infercollid = 3 [json_name="infercollid"];
+ uint32 inferopclass = 4 [json_name="inferopclass"];
+}
+
+message TargetEntry
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node expr = 2 [json_name="expr"];
+ int32 resno = 3 [json_name="resno"];
+ string resname = 4 [json_name="resname"];
+ uint32 ressortgroupref = 5 [json_name="ressortgroupref"];
+ uint32 resorigtbl = 6 [json_name="resorigtbl"];
+ int32 resorigcol = 7 [json_name="resorigcol"];
+ bool resjunk = 8 [json_name="resjunk"];
+}
+
+message RangeTblRef
+{
+ int32 rtindex = 1 [json_name="rtindex"];
+}
+
+message JoinExpr
+{
+ JoinType jointype = 1 [json_name="jointype"];
+ bool is_natural = 2 [json_name="isNatural"];
+ Node larg = 3 [json_name="larg"];
+ Node rarg = 4 [json_name="rarg"];
+ repeated Node using_clause = 5 [json_name="usingClause"];
+ Alias join_using_alias = 6 [json_name="join_using_alias"];
+ Node quals = 7 [json_name="quals"];
+ Alias alias = 8 [json_name="alias"];
+ int32 rtindex = 9 [json_name="rtindex"];
+}
+
+message FromExpr
+{
+ repeated Node fromlist = 1 [json_name="fromlist"];
+ Node quals = 2 [json_name="quals"];
+}
+
+message OnConflictExpr
+{
+ OnConflictAction action = 1 [json_name="action"];
+ repeated Node arbiter_elems = 2 [json_name="arbiterElems"];
+ Node arbiter_where = 3 [json_name="arbiterWhere"];
+ uint32 constraint = 4 [json_name="constraint"];
+ repeated Node on_conflict_set = 5 [json_name="onConflictSet"];
+ Node on_conflict_where = 6 [json_name="onConflictWhere"];
+ int32 excl_rel_index = 7 [json_name="exclRelIndex"];
+ repeated Node excl_rel_tlist = 8 [json_name="exclRelTlist"];
+}
+
+message IntoClause
+{
+ RangeVar rel = 1 [json_name="rel"];
+ repeated Node col_names = 2 [json_name="colNames"];
+ string access_method = 3 [json_name="accessMethod"];
+ repeated Node options = 4 [json_name="options"];
+ OnCommitAction on_commit = 5 [json_name="onCommit"];
+ string table_space_name = 6 [json_name="tableSpaceName"];
+ Node view_query = 7 [json_name="viewQuery"];
+ bool skip_data = 8 [json_name="skipData"];
+}
+
+message RawStmt
+{
+ Node stmt = 1 [json_name="stmt"];
+ int32 stmt_location = 2 [json_name="stmt_location"];
+ int32 stmt_len = 3 [json_name="stmt_len"];
+}
+
+message Query
+{
+ CmdType command_type = 1 [json_name="commandType"];
+ QuerySource query_source = 2 [json_name="querySource"];
+ bool can_set_tag = 3 [json_name="canSetTag"];
+ Node utility_stmt = 4 [json_name="utilityStmt"];
+ int32 result_relation = 5 [json_name="resultRelation"];
+ bool has_aggs = 6 [json_name="hasAggs"];
+ bool has_window_funcs = 7 [json_name="hasWindowFuncs"];
+ bool has_target_srfs = 8 [json_name="hasTargetSRFs"];
+ bool has_sub_links = 9 [json_name="hasSubLinks"];
+ bool has_distinct_on = 10 [json_name="hasDistinctOn"];
+ bool has_recursive = 11 [json_name="hasRecursive"];
+ bool has_modifying_cte = 12 [json_name="hasModifyingCTE"];
+ bool has_for_update = 13 [json_name="hasForUpdate"];
+ bool has_row_security = 14 [json_name="hasRowSecurity"];
+ bool is_return = 15 [json_name="isReturn"];
+ repeated Node cte_list = 16 [json_name="cteList"];
+ repeated Node rtable = 17 [json_name="rtable"];
+ FromExpr jointree = 18 [json_name="jointree"];
+ repeated Node target_list = 19 [json_name="targetList"];
+ OverridingKind override = 20 [json_name="override"];
+ OnConflictExpr on_conflict = 21 [json_name="onConflict"];
+ repeated Node returning_list = 22 [json_name="returningList"];
+ repeated Node group_clause = 23 [json_name="groupClause"];
+ bool group_distinct = 24 [json_name="groupDistinct"];
+ repeated Node grouping_sets = 25 [json_name="groupingSets"];
+ Node having_qual = 26 [json_name="havingQual"];
+ repeated Node window_clause = 27 [json_name="windowClause"];
+ repeated Node distinct_clause = 28 [json_name="distinctClause"];
+ repeated Node sort_clause = 29 [json_name="sortClause"];
+ Node limit_offset = 30 [json_name="limitOffset"];
+ Node limit_count = 31 [json_name="limitCount"];
+ LimitOption limit_option = 32 [json_name="limitOption"];
+ repeated Node row_marks = 33 [json_name="rowMarks"];
+ Node set_operations = 34 [json_name="setOperations"];
+ repeated Node constraint_deps = 35 [json_name="constraintDeps"];
+ repeated Node with_check_options = 36 [json_name="withCheckOptions"];
+ int32 stmt_location = 37 [json_name="stmt_location"];
+ int32 stmt_len = 38 [json_name="stmt_len"];
+}
+
+message InsertStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ repeated Node cols = 2 [json_name="cols"];
+ Node select_stmt = 3 [json_name="selectStmt"];
+ OnConflictClause on_conflict_clause = 4 [json_name="onConflictClause"];
+ repeated Node returning_list = 5 [json_name="returningList"];
+ WithClause with_clause = 6 [json_name="withClause"];
+ OverridingKind override = 7 [json_name="override"];
+}
+
+message DeleteStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ repeated Node using_clause = 2 [json_name="usingClause"];
+ Node where_clause = 3 [json_name="whereClause"];
+ repeated Node returning_list = 4 [json_name="returningList"];
+ WithClause with_clause = 5 [json_name="withClause"];
+}
+
+message UpdateStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ repeated Node target_list = 2 [json_name="targetList"];
+ Node where_clause = 3 [json_name="whereClause"];
+ repeated Node from_clause = 4 [json_name="fromClause"];
+ repeated Node returning_list = 5 [json_name="returningList"];
+ WithClause with_clause = 6 [json_name="withClause"];
+}
+
+message SelectStmt
+{
+ repeated Node distinct_clause = 1 [json_name="distinctClause"];
+ IntoClause into_clause = 2 [json_name="intoClause"];
+ repeated Node target_list = 3 [json_name="targetList"];
+ repeated Node from_clause = 4 [json_name="fromClause"];
+ Node where_clause = 5 [json_name="whereClause"];
+ repeated Node group_clause = 6 [json_name="groupClause"];
+ bool group_distinct = 7 [json_name="groupDistinct"];
+ Node having_clause = 8 [json_name="havingClause"];
+ repeated Node window_clause = 9 [json_name="windowClause"];
+ repeated Node values_lists = 10 [json_name="valuesLists"];
+ repeated Node sort_clause = 11 [json_name="sortClause"];
+ Node limit_offset = 12 [json_name="limitOffset"];
+ Node limit_count = 13 [json_name="limitCount"];
+ LimitOption limit_option = 14 [json_name="limitOption"];
+ repeated Node locking_clause = 15 [json_name="lockingClause"];
+ WithClause with_clause = 16 [json_name="withClause"];
+ SetOperation op = 17 [json_name="op"];
+ bool all = 18 [json_name="all"];
+ SelectStmt larg = 19 [json_name="larg"];
+ SelectStmt rarg = 20 [json_name="rarg"];
+}
+
+message ReturnStmt
+{
+ Node returnval = 1 [json_name="returnval"];
+}
+
+message PLAssignStmt
+{
+ string name = 1 [json_name="name"];
+ repeated Node indirection = 2 [json_name="indirection"];
+ int32 nnames = 3 [json_name="nnames"];
+ SelectStmt val = 4 [json_name="val"];
+ int32 location = 5 [json_name="location"];
+}
+
+message AlterTableStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ repeated Node cmds = 2 [json_name="cmds"];
+ ObjectType objtype = 3 [json_name="objtype"];
+ bool missing_ok = 4 [json_name="missing_ok"];
+}
+
+message AlterTableCmd
+{
+ AlterTableType subtype = 1 [json_name="subtype"];
+ string name = 2 [json_name="name"];
+ int32 num = 3 [json_name="num"];
+ RoleSpec newowner = 4 [json_name="newowner"];
+ Node def = 5 [json_name="def"];
+ DropBehavior behavior = 6 [json_name="behavior"];
+ bool missing_ok = 7 [json_name="missing_ok"];
+ bool recurse = 8 [json_name="recurse"];
+}
+
+message AlterDomainStmt
+{
+ string subtype = 1 [json_name="subtype"];
+ repeated Node type_name = 2 [json_name="typeName"];
+ string name = 3 [json_name="name"];
+ Node def = 4 [json_name="def"];
+ DropBehavior behavior = 5 [json_name="behavior"];
+ bool missing_ok = 6 [json_name="missing_ok"];
+}
+
+message SetOperationStmt
+{
+ SetOperation op = 1 [json_name="op"];
+ bool all = 2 [json_name="all"];
+ Node larg = 3 [json_name="larg"];
+ Node rarg = 4 [json_name="rarg"];
+ repeated Node col_types = 5 [json_name="colTypes"];
+ repeated Node col_typmods = 6 [json_name="colTypmods"];
+ repeated Node col_collations = 7 [json_name="colCollations"];
+ repeated Node group_clauses = 8 [json_name="groupClauses"];
+}
+
+message GrantStmt
+{
+ bool is_grant = 1 [json_name="is_grant"];
+ GrantTargetType targtype = 2 [json_name="targtype"];
+ ObjectType objtype = 3 [json_name="objtype"];
+ repeated Node objects = 4 [json_name="objects"];
+ repeated Node privileges = 5 [json_name="privileges"];
+ repeated Node grantees = 6 [json_name="grantees"];
+ bool grant_option = 7 [json_name="grant_option"];
+ RoleSpec grantor = 8 [json_name="grantor"];
+ DropBehavior behavior = 9 [json_name="behavior"];
+}
+
+message GrantRoleStmt
+{
+ repeated Node granted_roles = 1 [json_name="granted_roles"];
+ repeated Node grantee_roles = 2 [json_name="grantee_roles"];
+ bool is_grant = 3 [json_name="is_grant"];
+ bool admin_opt = 4 [json_name="admin_opt"];
+ RoleSpec grantor = 5 [json_name="grantor"];
+ DropBehavior behavior = 6 [json_name="behavior"];
+}
+
+message AlterDefaultPrivilegesStmt
+{
+ repeated Node options = 1 [json_name="options"];
+ GrantStmt action = 2 [json_name="action"];
+}
+
+message ClosePortalStmt
+{
+ string portalname = 1 [json_name="portalname"];
+}
+
+message ClusterStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ string indexname = 2 [json_name="indexname"];
+ repeated Node params = 3 [json_name="params"];
+}
+
+message CopyStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ Node query = 2 [json_name="query"];
+ repeated Node attlist = 3 [json_name="attlist"];
+ bool is_from = 4 [json_name="is_from"];
+ bool is_program = 5 [json_name="is_program"];
+ string filename = 6 [json_name="filename"];
+ repeated Node options = 7 [json_name="options"];
+ Node where_clause = 8 [json_name="whereClause"];
+}
+
+message CreateStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ repeated Node table_elts = 2 [json_name="tableElts"];
+ repeated Node inh_relations = 3 [json_name="inhRelations"];
+ PartitionBoundSpec partbound = 4 [json_name="partbound"];
+ PartitionSpec partspec = 5 [json_name="partspec"];
+ TypeName of_typename = 6 [json_name="ofTypename"];
+ repeated Node constraints = 7 [json_name="constraints"];
+ repeated Node options = 8 [json_name="options"];
+ OnCommitAction oncommit = 9 [json_name="oncommit"];
+ string tablespacename = 10 [json_name="tablespacename"];
+ string access_method = 11 [json_name="accessMethod"];
+ bool if_not_exists = 12 [json_name="if_not_exists"];
+}
+
+message DefineStmt
+{
+ ObjectType kind = 1 [json_name="kind"];
+ bool oldstyle = 2 [json_name="oldstyle"];
+ repeated Node defnames = 3 [json_name="defnames"];
+ repeated Node args = 4 [json_name="args"];
+ repeated Node definition = 5 [json_name="definition"];
+ bool if_not_exists = 6 [json_name="if_not_exists"];
+ bool replace = 7 [json_name="replace"];
+}
+
+message DropStmt
+{
+ repeated Node objects = 1 [json_name="objects"];
+ ObjectType remove_type = 2 [json_name="removeType"];
+ DropBehavior behavior = 3 [json_name="behavior"];
+ bool missing_ok = 4 [json_name="missing_ok"];
+ bool concurrent = 5 [json_name="concurrent"];
+}
+
+message TruncateStmt
+{
+ repeated Node relations = 1 [json_name="relations"];
+ bool restart_seqs = 2 [json_name="restart_seqs"];
+ DropBehavior behavior = 3 [json_name="behavior"];
+}
+
+message CommentStmt
+{
+ ObjectType objtype = 1 [json_name="objtype"];
+ Node object = 2 [json_name="object"];
+ string comment = 3 [json_name="comment"];
+}
+
+message FetchStmt
+{
+ FetchDirection direction = 1 [json_name="direction"];
+ int64 how_many = 2 [json_name="howMany"];
+ string portalname = 3 [json_name="portalname"];
+ bool ismove = 4 [json_name="ismove"];
+}
+
+message IndexStmt
+{
+ string idxname = 1 [json_name="idxname"];
+ RangeVar relation = 2 [json_name="relation"];
+ string access_method = 3 [json_name="accessMethod"];
+ string table_space = 4 [json_name="tableSpace"];
+ repeated Node index_params = 5 [json_name="indexParams"];
+ repeated Node index_including_params = 6 [json_name="indexIncludingParams"];
+ repeated Node options = 7 [json_name="options"];
+ Node where_clause = 8 [json_name="whereClause"];
+ repeated Node exclude_op_names = 9 [json_name="excludeOpNames"];
+ string idxcomment = 10 [json_name="idxcomment"];
+ uint32 index_oid = 11 [json_name="indexOid"];
+ uint32 old_node = 12 [json_name="oldNode"];
+ uint32 old_create_subid = 13 [json_name="oldCreateSubid"];
+ uint32 old_first_relfilenode_subid = 14 [json_name="oldFirstRelfilenodeSubid"];
+ bool unique = 15 [json_name="unique"];
+ bool primary = 16 [json_name="primary"];
+ bool isconstraint = 17 [json_name="isconstraint"];
+ bool deferrable = 18 [json_name="deferrable"];
+ bool initdeferred = 19 [json_name="initdeferred"];
+ bool transformed = 20 [json_name="transformed"];
+ bool concurrent = 21 [json_name="concurrent"];
+ bool if_not_exists = 22 [json_name="if_not_exists"];
+ bool reset_default_tblspc = 23 [json_name="reset_default_tblspc"];
+}
+
+message CreateFunctionStmt
+{
+ bool is_procedure = 1 [json_name="is_procedure"];
+ bool replace = 2 [json_name="replace"];
+ repeated Node funcname = 3 [json_name="funcname"];
+ repeated Node parameters = 4 [json_name="parameters"];
+ TypeName return_type = 5 [json_name="returnType"];
+ repeated Node options = 6 [json_name="options"];
+ Node sql_body = 7 [json_name="sql_body"];
+}
+
+message AlterFunctionStmt
+{
+ ObjectType objtype = 1 [json_name="objtype"];
+ ObjectWithArgs func = 2 [json_name="func"];
+ repeated Node actions = 3 [json_name="actions"];
+}
+
+message DoStmt
+{
+ repeated Node args = 1 [json_name="args"];
+}
+
+message RenameStmt
+{
+ ObjectType rename_type = 1 [json_name="renameType"];
+ ObjectType relation_type = 2 [json_name="relationType"];
+ RangeVar relation = 3 [json_name="relation"];
+ Node object = 4 [json_name="object"];
+ string subname = 5 [json_name="subname"];
+ string newname = 6 [json_name="newname"];
+ DropBehavior behavior = 7 [json_name="behavior"];
+ bool missing_ok = 8 [json_name="missing_ok"];
+}
+
+message RuleStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ string rulename = 2 [json_name="rulename"];
+ Node where_clause = 3 [json_name="whereClause"];
+ CmdType event = 4 [json_name="event"];
+ bool instead = 5 [json_name="instead"];
+ repeated Node actions = 6 [json_name="actions"];
+ bool replace = 7 [json_name="replace"];
+}
+
+message NotifyStmt
+{
+ string conditionname = 1 [json_name="conditionname"];
+ string payload = 2 [json_name="payload"];
+}
+
+message ListenStmt
+{
+ string conditionname = 1 [json_name="conditionname"];
+}
+
+message UnlistenStmt
+{
+ string conditionname = 1 [json_name="conditionname"];
+}
+
+message TransactionStmt
+{
+ TransactionStmtKind kind = 1 [json_name="kind"];
+ repeated Node options = 2 [json_name="options"];
+ string savepoint_name = 3 [json_name="savepoint_name"];
+ string gid = 4 [json_name="gid"];
+ bool chain = 5 [json_name="chain"];
+}
+
+message ViewStmt
+{
+ RangeVar view = 1 [json_name="view"];
+ repeated Node aliases = 2 [json_name="aliases"];
+ Node query = 3 [json_name="query"];
+ bool replace = 4 [json_name="replace"];
+ repeated Node options = 5 [json_name="options"];
+ ViewCheckOption with_check_option = 6 [json_name="withCheckOption"];
+}
+
+message LoadStmt
+{
+ string filename = 1 [json_name="filename"];
+}
+
+message CreateDomainStmt
+{
+ repeated Node domainname = 1 [json_name="domainname"];
+ TypeName type_name = 2 [json_name="typeName"];
+ CollateClause coll_clause = 3 [json_name="collClause"];
+ repeated Node constraints = 4 [json_name="constraints"];
+}
+
+message CreatedbStmt
+{
+ string dbname = 1 [json_name="dbname"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message DropdbStmt
+{
+ string dbname = 1 [json_name="dbname"];
+ bool missing_ok = 2 [json_name="missing_ok"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message VacuumStmt
+{
+ repeated Node options = 1 [json_name="options"];
+ repeated Node rels = 2 [json_name="rels"];
+ bool is_vacuumcmd = 3 [json_name="is_vacuumcmd"];
+}
+
+message ExplainStmt
+{
+ Node query = 1 [json_name="query"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message CreateTableAsStmt
+{
+ Node query = 1 [json_name="query"];
+ IntoClause into = 2 [json_name="into"];
+ ObjectType objtype = 3 [json_name="objtype"];
+ bool is_select_into = 4 [json_name="is_select_into"];
+ bool if_not_exists = 5 [json_name="if_not_exists"];
+}
+
+message CreateSeqStmt
+{
+ RangeVar sequence = 1 [json_name="sequence"];
+ repeated Node options = 2 [json_name="options"];
+ uint32 owner_id = 3 [json_name="ownerId"];
+ bool for_identity = 4 [json_name="for_identity"];
+ bool if_not_exists = 5 [json_name="if_not_exists"];
+}
+
+message AlterSeqStmt
+{
+ RangeVar sequence = 1 [json_name="sequence"];
+ repeated Node options = 2 [json_name="options"];
+ bool for_identity = 3 [json_name="for_identity"];
+ bool missing_ok = 4 [json_name="missing_ok"];
+}
+
+message VariableSetStmt
+{
+ VariableSetKind kind = 1 [json_name="kind"];
+ string name = 2 [json_name="name"];
+ repeated Node args = 3 [json_name="args"];
+ bool is_local = 4 [json_name="is_local"];
+}
+
+message VariableShowStmt
+{
+ string name = 1 [json_name="name"];
+}
+
+message DiscardStmt
+{
+ DiscardMode target = 1 [json_name="target"];
+}
+
+message CreateTrigStmt
+{
+ bool replace = 1 [json_name="replace"];
+ bool isconstraint = 2 [json_name="isconstraint"];
+ string trigname = 3 [json_name="trigname"];
+ RangeVar relation = 4 [json_name="relation"];
+ repeated Node funcname = 5 [json_name="funcname"];
+ repeated Node args = 6 [json_name="args"];
+ bool row = 7 [json_name="row"];
+ int32 timing = 8 [json_name="timing"];
+ int32 events = 9 [json_name="events"];
+ repeated Node columns = 10 [json_name="columns"];
+ Node when_clause = 11 [json_name="whenClause"];
+ repeated Node transition_rels = 12 [json_name="transitionRels"];
+ bool deferrable = 13 [json_name="deferrable"];
+ bool initdeferred = 14 [json_name="initdeferred"];
+ RangeVar constrrel = 15 [json_name="constrrel"];
+}
+
+message CreatePLangStmt
+{
+ bool replace = 1 [json_name="replace"];
+ string plname = 2 [json_name="plname"];
+ repeated Node plhandler = 3 [json_name="plhandler"];
+ repeated Node plinline = 4 [json_name="plinline"];
+ repeated Node plvalidator = 5 [json_name="plvalidator"];
+ bool pltrusted = 6 [json_name="pltrusted"];
+}
+
+message CreateRoleStmt
+{
+ RoleStmtType stmt_type = 1 [json_name="stmt_type"];
+ string role = 2 [json_name="role"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message AlterRoleStmt
+{
+ RoleSpec role = 1 [json_name="role"];
+ repeated Node options = 2 [json_name="options"];
+ int32 action = 3 [json_name="action"];
+}
+
+message DropRoleStmt
+{
+ repeated Node roles = 1 [json_name="roles"];
+ bool missing_ok = 2 [json_name="missing_ok"];
+}
+
+message LockStmt
+{
+ repeated Node relations = 1 [json_name="relations"];
+ int32 mode = 2 [json_name="mode"];
+ bool nowait = 3 [json_name="nowait"];
+}
+
+message ConstraintsSetStmt
+{
+ repeated Node constraints = 1 [json_name="constraints"];
+ bool deferred = 2 [json_name="deferred"];
+}
+
+message ReindexStmt
+{
+ ReindexObjectType kind = 1 [json_name="kind"];
+ RangeVar relation = 2 [json_name="relation"];
+ string name = 3 [json_name="name"];
+ repeated Node params = 4 [json_name="params"];
+}
+
+message CheckPointStmt
+{
+}
+
+message CreateSchemaStmt
+{
+ string schemaname = 1 [json_name="schemaname"];
+ RoleSpec authrole = 2 [json_name="authrole"];
+ repeated Node schema_elts = 3 [json_name="schemaElts"];
+ bool if_not_exists = 4 [json_name="if_not_exists"];
+}
+
+message AlterDatabaseStmt
+{
+ string dbname = 1 [json_name="dbname"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message AlterDatabaseSetStmt
+{
+ string dbname = 1 [json_name="dbname"];
+ VariableSetStmt setstmt = 2 [json_name="setstmt"];
+}
+
+message AlterRoleSetStmt
+{
+ RoleSpec role = 1 [json_name="role"];
+ string database = 2 [json_name="database"];
+ VariableSetStmt setstmt = 3 [json_name="setstmt"];
+}
+
+message CreateConversionStmt
+{
+ repeated Node conversion_name = 1 [json_name="conversion_name"];
+ string for_encoding_name = 2 [json_name="for_encoding_name"];
+ string to_encoding_name = 3 [json_name="to_encoding_name"];
+ repeated Node func_name = 4 [json_name="func_name"];
+ bool def = 5 [json_name="def"];
+}
+
+message CreateCastStmt
+{
+ TypeName sourcetype = 1 [json_name="sourcetype"];
+ TypeName targettype = 2 [json_name="targettype"];
+ ObjectWithArgs func = 3 [json_name="func"];
+ CoercionContext context = 4 [json_name="context"];
+ bool inout = 5 [json_name="inout"];
+}
+
+message CreateOpClassStmt
+{
+ repeated Node opclassname = 1 [json_name="opclassname"];
+ repeated Node opfamilyname = 2 [json_name="opfamilyname"];
+ string amname = 3 [json_name="amname"];
+ TypeName datatype = 4 [json_name="datatype"];
+ repeated Node items = 5 [json_name="items"];
+ bool is_default = 6 [json_name="isDefault"];
+}
+
+message CreateOpFamilyStmt
+{
+ repeated Node opfamilyname = 1 [json_name="opfamilyname"];
+ string amname = 2 [json_name="amname"];
+}
+
+message AlterOpFamilyStmt
+{
+ repeated Node opfamilyname = 1 [json_name="opfamilyname"];
+ string amname = 2 [json_name="amname"];
+ bool is_drop = 3 [json_name="isDrop"];
+ repeated Node items = 4 [json_name="items"];
+}
+
+message PrepareStmt
+{
+ string name = 1 [json_name="name"];
+ repeated Node argtypes = 2 [json_name="argtypes"];
+ Node query = 3 [json_name="query"];
+}
+
+message ExecuteStmt
+{
+ string name = 1 [json_name="name"];
+ repeated Node params = 2 [json_name="params"];
+}
+
+message DeallocateStmt
+{
+ string name = 1 [json_name="name"];
+}
+
+message DeclareCursorStmt
+{
+ string portalname = 1 [json_name="portalname"];
+ int32 options = 2 [json_name="options"];
+ Node query = 3 [json_name="query"];
+}
+
+message CreateTableSpaceStmt
+{
+ string tablespacename = 1 [json_name="tablespacename"];
+ RoleSpec owner = 2 [json_name="owner"];
+ string location = 3 [json_name="location"];
+ repeated Node options = 4 [json_name="options"];
+}
+
+message DropTableSpaceStmt
+{
+ string tablespacename = 1 [json_name="tablespacename"];
+ bool missing_ok = 2 [json_name="missing_ok"];
+}
+
+message AlterObjectDependsStmt
+{
+ ObjectType object_type = 1 [json_name="objectType"];
+ RangeVar relation = 2 [json_name="relation"];
+ Node object = 3 [json_name="object"];
+ Node extname = 4 [json_name="extname"];
+ bool remove = 5 [json_name="remove"];
+}
+
+message AlterObjectSchemaStmt
+{
+ ObjectType object_type = 1 [json_name="objectType"];
+ RangeVar relation = 2 [json_name="relation"];
+ Node object = 3 [json_name="object"];
+ string newschema = 4 [json_name="newschema"];
+ bool missing_ok = 5 [json_name="missing_ok"];
+}
+
+message AlterOwnerStmt
+{
+ ObjectType object_type = 1 [json_name="objectType"];
+ RangeVar relation = 2 [json_name="relation"];
+ Node object = 3 [json_name="object"];
+ RoleSpec newowner = 4 [json_name="newowner"];
+}
+
+message AlterOperatorStmt
+{
+ ObjectWithArgs opername = 1 [json_name="opername"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message AlterTypeStmt
+{
+ repeated Node type_name = 1 [json_name="typeName"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message DropOwnedStmt
+{
+ repeated Node roles = 1 [json_name="roles"];
+ DropBehavior behavior = 2 [json_name="behavior"];
+}
+
+message ReassignOwnedStmt
+{
+ repeated Node roles = 1 [json_name="roles"];
+ RoleSpec newrole = 2 [json_name="newrole"];
+}
+
+message CompositeTypeStmt
+{
+ RangeVar typevar = 1 [json_name="typevar"];
+ repeated Node coldeflist = 2 [json_name="coldeflist"];
+}
+
+message CreateEnumStmt
+{
+ repeated Node type_name = 1 [json_name="typeName"];
+ repeated Node vals = 2 [json_name="vals"];
+}
+
+message CreateRangeStmt
+{
+ repeated Node type_name = 1 [json_name="typeName"];
+ repeated Node params = 2 [json_name="params"];
+}
+
+message AlterEnumStmt
+{
+ repeated Node type_name = 1 [json_name="typeName"];
+ string old_val = 2 [json_name="oldVal"];
+ string new_val = 3 [json_name="newVal"];
+ string new_val_neighbor = 4 [json_name="newValNeighbor"];
+ bool new_val_is_after = 5 [json_name="newValIsAfter"];
+ bool skip_if_new_val_exists = 6 [json_name="skipIfNewValExists"];
+}
+
+message AlterTSDictionaryStmt
+{
+ repeated Node dictname = 1 [json_name="dictname"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message AlterTSConfigurationStmt
+{
+ AlterTSConfigType kind = 1 [json_name="kind"];
+ repeated Node cfgname = 2 [json_name="cfgname"];
+ repeated Node tokentype = 3 [json_name="tokentype"];
+ repeated Node dicts = 4 [json_name="dicts"];
+ bool override = 5 [json_name="override"];
+ bool replace = 6 [json_name="replace"];
+ bool missing_ok = 7 [json_name="missing_ok"];
+}
+
+message CreateFdwStmt
+{
+ string fdwname = 1 [json_name="fdwname"];
+ repeated Node func_options = 2 [json_name="func_options"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message AlterFdwStmt
+{
+ string fdwname = 1 [json_name="fdwname"];
+ repeated Node func_options = 2 [json_name="func_options"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message CreateForeignServerStmt
+{
+ string servername = 1 [json_name="servername"];
+ string servertype = 2 [json_name="servertype"];
+ string version = 3 [json_name="version"];
+ string fdwname = 4 [json_name="fdwname"];
+ bool if_not_exists = 5 [json_name="if_not_exists"];
+ repeated Node options = 6 [json_name="options"];
+}
+
+message AlterForeignServerStmt
+{
+ string servername = 1 [json_name="servername"];
+ string version = 2 [json_name="version"];
+ repeated Node options = 3 [json_name="options"];
+ bool has_version = 4 [json_name="has_version"];
+}
+
+message CreateUserMappingStmt
+{
+ RoleSpec user = 1 [json_name="user"];
+ string servername = 2 [json_name="servername"];
+ bool if_not_exists = 3 [json_name="if_not_exists"];
+ repeated Node options = 4 [json_name="options"];
+}
+
+message AlterUserMappingStmt
+{
+ RoleSpec user = 1 [json_name="user"];
+ string servername = 2 [json_name="servername"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message DropUserMappingStmt
+{
+ RoleSpec user = 1 [json_name="user"];
+ string servername = 2 [json_name="servername"];
+ bool missing_ok = 3 [json_name="missing_ok"];
+}
+
+message AlterTableSpaceOptionsStmt
+{
+ string tablespacename = 1 [json_name="tablespacename"];
+ repeated Node options = 2 [json_name="options"];
+ bool is_reset = 3 [json_name="isReset"];
+}
+
+message AlterTableMoveAllStmt
+{
+ string orig_tablespacename = 1 [json_name="orig_tablespacename"];
+ ObjectType objtype = 2 [json_name="objtype"];
+ repeated Node roles = 3 [json_name="roles"];
+ string new_tablespacename = 4 [json_name="new_tablespacename"];
+ bool nowait = 5 [json_name="nowait"];
+}
+
+message SecLabelStmt
+{
+ ObjectType objtype = 1 [json_name="objtype"];
+ Node object = 2 [json_name="object"];
+ string provider = 3 [json_name="provider"];
+ string label = 4 [json_name="label"];
+}
+
+message CreateForeignTableStmt
+{
+ CreateStmt base_stmt = 1 [json_name="base"];
+ string servername = 2 [json_name="servername"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message ImportForeignSchemaStmt
+{
+ string server_name = 1 [json_name="server_name"];
+ string remote_schema = 2 [json_name="remote_schema"];
+ string local_schema = 3 [json_name="local_schema"];
+ ImportForeignSchemaType list_type = 4 [json_name="list_type"];
+ repeated Node table_list = 5 [json_name="table_list"];
+ repeated Node options = 6 [json_name="options"];
+}
+
+message CreateExtensionStmt
+{
+ string extname = 1 [json_name="extname"];
+ bool if_not_exists = 2 [json_name="if_not_exists"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message AlterExtensionStmt
+{
+ string extname = 1 [json_name="extname"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message AlterExtensionContentsStmt
+{
+ string extname = 1 [json_name="extname"];
+ int32 action = 2 [json_name="action"];
+ ObjectType objtype = 3 [json_name="objtype"];
+ Node object = 4 [json_name="object"];
+}
+
+message CreateEventTrigStmt
+{
+ string trigname = 1 [json_name="trigname"];
+ string eventname = 2 [json_name="eventname"];
+ repeated Node whenclause = 3 [json_name="whenclause"];
+ repeated Node funcname = 4 [json_name="funcname"];
+}
+
+message AlterEventTrigStmt
+{
+ string trigname = 1 [json_name="trigname"];
+ string tgenabled = 2 [json_name="tgenabled"];
+}
+
+message RefreshMatViewStmt
+{
+ bool concurrent = 1 [json_name="concurrent"];
+ bool skip_data = 2 [json_name="skipData"];
+ RangeVar relation = 3 [json_name="relation"];
+}
+
+message ReplicaIdentityStmt
+{
+ string identity_type = 1 [json_name="identity_type"];
+ string name = 2 [json_name="name"];
+}
+
+message AlterSystemStmt
+{
+ VariableSetStmt setstmt = 1 [json_name="setstmt"];
+}
+
+message CreatePolicyStmt
+{
+ string policy_name = 1 [json_name="policy_name"];
+ RangeVar table = 2 [json_name="table"];
+ string cmd_name = 3 [json_name="cmd_name"];
+ bool permissive = 4 [json_name="permissive"];
+ repeated Node roles = 5 [json_name="roles"];
+ Node qual = 6 [json_name="qual"];
+ Node with_check = 7 [json_name="with_check"];
+}
+
+message AlterPolicyStmt
+{
+ string policy_name = 1 [json_name="policy_name"];
+ RangeVar table = 2 [json_name="table"];
+ repeated Node roles = 3 [json_name="roles"];
+ Node qual = 4 [json_name="qual"];
+ Node with_check = 5 [json_name="with_check"];
+}
+
+message CreateTransformStmt
+{
+ bool replace = 1 [json_name="replace"];
+ TypeName type_name = 2 [json_name="type_name"];
+ string lang = 3 [json_name="lang"];
+ ObjectWithArgs fromsql = 4 [json_name="fromsql"];
+ ObjectWithArgs tosql = 5 [json_name="tosql"];
+}
+
+message CreateAmStmt
+{
+ string amname = 1 [json_name="amname"];
+ repeated Node handler_name = 2 [json_name="handler_name"];
+ string amtype = 3 [json_name="amtype"];
+}
+
+message CreatePublicationStmt
+{
+ string pubname = 1 [json_name="pubname"];
+ repeated Node options = 2 [json_name="options"];
+ repeated Node tables = 3 [json_name="tables"];
+ bool for_all_tables = 4 [json_name="for_all_tables"];
+}
+
+message AlterPublicationStmt
+{
+ string pubname = 1 [json_name="pubname"];
+ repeated Node options = 2 [json_name="options"];
+ repeated Node tables = 3 [json_name="tables"];
+ bool for_all_tables = 4 [json_name="for_all_tables"];
+ DefElemAction table_action = 5 [json_name="tableAction"];
+}
+
+message CreateSubscriptionStmt
+{
+ string subname = 1 [json_name="subname"];
+ string conninfo = 2 [json_name="conninfo"];
+ repeated Node publication = 3 [json_name="publication"];
+ repeated Node options = 4 [json_name="options"];
+}
+
+message AlterSubscriptionStmt
+{
+ AlterSubscriptionType kind = 1 [json_name="kind"];
+ string subname = 2 [json_name="subname"];
+ string conninfo = 3 [json_name="conninfo"];
+ repeated Node publication = 4 [json_name="publication"];
+ repeated Node options = 5 [json_name="options"];
+}
+
+message DropSubscriptionStmt
+{
+ string subname = 1 [json_name="subname"];
+ bool missing_ok = 2 [json_name="missing_ok"];
+ DropBehavior behavior = 3 [json_name="behavior"];
+}
+
+message CreateStatsStmt
+{
+ repeated Node defnames = 1 [json_name="defnames"];
+ repeated Node stat_types = 2 [json_name="stat_types"];
+ repeated Node exprs = 3 [json_name="exprs"];
+ repeated Node relations = 4 [json_name="relations"];
+ string stxcomment = 5 [json_name="stxcomment"];
+ bool transformed = 6 [json_name="transformed"];
+ bool if_not_exists = 7 [json_name="if_not_exists"];
+}
+
+message AlterCollationStmt
+{
+ repeated Node collname = 1 [json_name="collname"];
+}
+
+message CallStmt
+{
+ FuncCall funccall = 1 [json_name="funccall"];
+ FuncExpr funcexpr = 2 [json_name="funcexpr"];
+ repeated Node outargs = 3 [json_name="outargs"];
+}
+
+message AlterStatsStmt
+{
+ repeated Node defnames = 1 [json_name="defnames"];
+ int32 stxstattarget = 2 [json_name="stxstattarget"];
+ bool missing_ok = 3 [json_name="missing_ok"];
+}
+
+message A_Expr
+{
+ A_Expr_Kind kind = 1 [json_name="kind"];
+ repeated Node name = 2 [json_name="name"];
+ Node lexpr = 3 [json_name="lexpr"];
+ Node rexpr = 4 [json_name="rexpr"];
+ int32 location = 5 [json_name="location"];
+}
+
+message ColumnRef
+{
+ repeated Node fields = 1 [json_name="fields"];
+ int32 location = 2 [json_name="location"];
+}
+
+message ParamRef
+{
+ int32 number = 1 [json_name="number"];
+ int32 location = 2 [json_name="location"];
+}
+
+message A_Const
+{
+ Node val = 1 [json_name="val"];
+ int32 location = 2 [json_name="location"];
+}
+
+message FuncCall
+{
+ repeated Node funcname = 1 [json_name="funcname"];
+ repeated Node args = 2 [json_name="args"];
+ repeated Node agg_order = 3 [json_name="agg_order"];
+ Node agg_filter = 4 [json_name="agg_filter"];
+ WindowDef over = 5 [json_name="over"];
+ bool agg_within_group = 6 [json_name="agg_within_group"];
+ bool agg_star = 7 [json_name="agg_star"];
+ bool agg_distinct = 8 [json_name="agg_distinct"];
+ bool func_variadic = 9 [json_name="func_variadic"];
+ CoercionForm funcformat = 10 [json_name="funcformat"];
+ int32 location = 11 [json_name="location"];
+}
+
+message A_Star
+{
+}
+
+message A_Indices
+{
+ bool is_slice = 1 [json_name="is_slice"];
+ Node lidx = 2 [json_name="lidx"];
+ Node uidx = 3 [json_name="uidx"];
+}
+
+message A_Indirection
+{
+ Node arg = 1 [json_name="arg"];
+ repeated Node indirection = 2 [json_name="indirection"];
+}
+
+message A_ArrayExpr
+{
+ repeated Node elements = 1 [json_name="elements"];
+ int32 location = 2 [json_name="location"];
+}
+
+message ResTarget
+{
+ string name = 1 [json_name="name"];
+ repeated Node indirection = 2 [json_name="indirection"];
+ Node val = 3 [json_name="val"];
+ int32 location = 4 [json_name="location"];
+}
+
+message MultiAssignRef
+{
+ Node source = 1 [json_name="source"];
+ int32 colno = 2 [json_name="colno"];
+ int32 ncolumns = 3 [json_name="ncolumns"];
+}
+
+message TypeCast
+{
+ Node arg = 1 [json_name="arg"];
+ TypeName type_name = 2 [json_name="typeName"];
+ int32 location = 3 [json_name="location"];
+}
+
+message CollateClause
+{
+ Node arg = 1 [json_name="arg"];
+ repeated Node collname = 2 [json_name="collname"];
+ int32 location = 3 [json_name="location"];
+}
+
+message SortBy
+{
+ Node node = 1 [json_name="node"];
+ SortByDir sortby_dir = 2 [json_name="sortby_dir"];
+ SortByNulls sortby_nulls = 3 [json_name="sortby_nulls"];
+ repeated Node use_op = 4 [json_name="useOp"];
+ int32 location = 5 [json_name="location"];
+}
+
+message WindowDef
+{
+ string name = 1 [json_name="name"];
+ string refname = 2 [json_name="refname"];
+ repeated Node partition_clause = 3 [json_name="partitionClause"];
+ repeated Node order_clause = 4 [json_name="orderClause"];
+ int32 frame_options = 5 [json_name="frameOptions"];
+ Node start_offset = 6 [json_name="startOffset"];
+ Node end_offset = 7 [json_name="endOffset"];
+ int32 location = 8 [json_name="location"];
+}
+
+message RangeSubselect
+{
+ bool lateral = 1 [json_name="lateral"];
+ Node subquery = 2 [json_name="subquery"];
+ Alias alias = 3 [json_name="alias"];
+}
+
+message RangeFunction
+{
+ bool lateral = 1 [json_name="lateral"];
+ bool ordinality = 2 [json_name="ordinality"];
+ bool is_rowsfrom = 3 [json_name="is_rowsfrom"];
+ repeated Node functions = 4 [json_name="functions"];
+ Alias alias = 5 [json_name="alias"];
+ repeated Node coldeflist = 6 [json_name="coldeflist"];
+}
+
+message RangeTableSample
+{
+ Node relation = 1 [json_name="relation"];
+ repeated Node method = 2 [json_name="method"];
+ repeated Node args = 3 [json_name="args"];
+ Node repeatable = 4 [json_name="repeatable"];
+ int32 location = 5 [json_name="location"];
+}
+
+message RangeTableFunc
+{
+ bool lateral = 1 [json_name="lateral"];
+ Node docexpr = 2 [json_name="docexpr"];
+ Node rowexpr = 3 [json_name="rowexpr"];
+ repeated Node namespaces = 4 [json_name="namespaces"];
+ repeated Node columns = 5 [json_name="columns"];
+ Alias alias = 6 [json_name="alias"];
+ int32 location = 7 [json_name="location"];
+}
+
+message RangeTableFuncCol
+{
+ string colname = 1 [json_name="colname"];
+ TypeName type_name = 2 [json_name="typeName"];
+ bool for_ordinality = 3 [json_name="for_ordinality"];
+ bool is_not_null = 4 [json_name="is_not_null"];
+ Node colexpr = 5 [json_name="colexpr"];
+ Node coldefexpr = 6 [json_name="coldefexpr"];
+ int32 location = 7 [json_name="location"];
+}
+
+message TypeName
+{
+ repeated Node names = 1 [json_name="names"];
+ uint32 type_oid = 2 [json_name="typeOid"];
+ bool setof = 3 [json_name="setof"];
+ bool pct_type = 4 [json_name="pct_type"];
+ repeated Node typmods = 5 [json_name="typmods"];
+ int32 typemod = 6 [json_name="typemod"];
+ repeated Node array_bounds = 7 [json_name="arrayBounds"];
+ int32 location = 8 [json_name="location"];
+}
+
+message ColumnDef
+{
+ string colname = 1 [json_name="colname"];
+ TypeName type_name = 2 [json_name="typeName"];
+ string compression = 3 [json_name="compression"];
+ int32 inhcount = 4 [json_name="inhcount"];
+ bool is_local = 5 [json_name="is_local"];
+ bool is_not_null = 6 [json_name="is_not_null"];
+ bool is_from_type = 7 [json_name="is_from_type"];
+ string storage = 8 [json_name="storage"];
+ Node raw_default = 9 [json_name="raw_default"];
+ Node cooked_default = 10 [json_name="cooked_default"];
+ string identity = 11 [json_name="identity"];
+ RangeVar identity_sequence = 12 [json_name="identitySequence"];
+ string generated = 13 [json_name="generated"];
+ CollateClause coll_clause = 14 [json_name="collClause"];
+ uint32 coll_oid = 15 [json_name="collOid"];
+ repeated Node constraints = 16 [json_name="constraints"];
+ repeated Node fdwoptions = 17 [json_name="fdwoptions"];
+ int32 location = 18 [json_name="location"];
+}
+
+message IndexElem
+{
+ string name = 1 [json_name="name"];
+ Node expr = 2 [json_name="expr"];
+ string indexcolname = 3 [json_name="indexcolname"];
+ repeated Node collation = 4 [json_name="collation"];
+ repeated Node opclass = 5 [json_name="opclass"];
+ repeated Node opclassopts = 6 [json_name="opclassopts"];
+ SortByDir ordering = 7 [json_name="ordering"];
+ SortByNulls nulls_ordering = 8 [json_name="nulls_ordering"];
+}
+
+message StatsElem
+{
+ string name = 1 [json_name="name"];
+ Node expr = 2 [json_name="expr"];
+}
+
+message Constraint
+{
+ ConstrType contype = 1 [json_name="contype"];
+ string conname = 2 [json_name="conname"];
+ bool deferrable = 3 [json_name="deferrable"];
+ bool initdeferred = 4 [json_name="initdeferred"];
+ int32 location = 5 [json_name="location"];
+ bool is_no_inherit = 6 [json_name="is_no_inherit"];
+ Node raw_expr = 7 [json_name="raw_expr"];
+ string cooked_expr = 8 [json_name="cooked_expr"];
+ string generated_when = 9 [json_name="generated_when"];
+ repeated Node keys = 10 [json_name="keys"];
+ repeated Node including = 11 [json_name="including"];
+ repeated Node exclusions = 12 [json_name="exclusions"];
+ repeated Node options = 13 [json_name="options"];
+ string indexname = 14 [json_name="indexname"];
+ string indexspace = 15 [json_name="indexspace"];
+ bool reset_default_tblspc = 16 [json_name="reset_default_tblspc"];
+ string access_method = 17 [json_name="access_method"];
+ Node where_clause = 18 [json_name="where_clause"];
+ RangeVar pktable = 19 [json_name="pktable"];
+ repeated Node fk_attrs = 20 [json_name="fk_attrs"];
+ repeated Node pk_attrs = 21 [json_name="pk_attrs"];
+ string fk_matchtype = 22 [json_name="fk_matchtype"];
+ string fk_upd_action = 23 [json_name="fk_upd_action"];
+ string fk_del_action = 24 [json_name="fk_del_action"];
+ repeated Node old_conpfeqop = 25 [json_name="old_conpfeqop"];
+ uint32 old_pktable_oid = 26 [json_name="old_pktable_oid"];
+ bool skip_validation = 27 [json_name="skip_validation"];
+ bool initially_valid = 28 [json_name="initially_valid"];
+}
+
+message DefElem
+{
+ string defnamespace = 1 [json_name="defnamespace"];
+ string defname = 2 [json_name="defname"];
+ Node arg = 3 [json_name="arg"];
+ DefElemAction defaction = 4 [json_name="defaction"];
+ int32 location = 5 [json_name="location"];
+}
+
+message RangeTblEntry
+{
+ RTEKind rtekind = 1 [json_name="rtekind"];
+ uint32 relid = 2 [json_name="relid"];
+ string relkind = 3 [json_name="relkind"];
+ int32 rellockmode = 4 [json_name="rellockmode"];
+ TableSampleClause tablesample = 5 [json_name="tablesample"];
+ Query subquery = 6 [json_name="subquery"];
+ bool security_barrier = 7 [json_name="security_barrier"];
+ JoinType jointype = 8 [json_name="jointype"];
+ int32 joinmergedcols = 9 [json_name="joinmergedcols"];
+ repeated Node joinaliasvars = 10 [json_name="joinaliasvars"];
+ repeated Node joinleftcols = 11 [json_name="joinleftcols"];
+ repeated Node joinrightcols = 12 [json_name="joinrightcols"];
+ Alias join_using_alias = 13 [json_name="join_using_alias"];
+ repeated Node functions = 14 [json_name="functions"];
+ bool funcordinality = 15 [json_name="funcordinality"];
+ TableFunc tablefunc = 16 [json_name="tablefunc"];
+ repeated Node values_lists = 17 [json_name="values_lists"];
+ string ctename = 18 [json_name="ctename"];
+ uint32 ctelevelsup = 19 [json_name="ctelevelsup"];
+ bool self_reference = 20 [json_name="self_reference"];
+ repeated Node coltypes = 21 [json_name="coltypes"];
+ repeated Node coltypmods = 22 [json_name="coltypmods"];
+ repeated Node colcollations = 23 [json_name="colcollations"];
+ string enrname = 24 [json_name="enrname"];
+ double enrtuples = 25 [json_name="enrtuples"];
+ Alias alias = 26 [json_name="alias"];
+ Alias eref = 27 [json_name="eref"];
+ bool lateral = 28 [json_name="lateral"];
+ bool inh = 29 [json_name="inh"];
+ bool in_from_cl = 30 [json_name="inFromCl"];
+ uint32 required_perms = 31 [json_name="requiredPerms"];
+ uint32 check_as_user = 32 [json_name="checkAsUser"];
+ repeated uint64 selected_cols = 33 [json_name="selectedCols"];
+ repeated uint64 inserted_cols = 34 [json_name="insertedCols"];
+ repeated uint64 updated_cols = 35 [json_name="updatedCols"];
+ repeated uint64 extra_updated_cols = 36 [json_name="extraUpdatedCols"];
+ repeated Node security_quals = 37 [json_name="securityQuals"];
+}
+
+message RangeTblFunction
+{
+ Node funcexpr = 1 [json_name="funcexpr"];
+ int32 funccolcount = 2 [json_name="funccolcount"];
+ repeated Node funccolnames = 3 [json_name="funccolnames"];
+ repeated Node funccoltypes = 4 [json_name="funccoltypes"];
+ repeated Node funccoltypmods = 5 [json_name="funccoltypmods"];
+ repeated Node funccolcollations = 6 [json_name="funccolcollations"];
+ repeated uint64 funcparams = 7 [json_name="funcparams"];
+}
+
+message TableSampleClause
+{
+ uint32 tsmhandler = 1 [json_name="tsmhandler"];
+ repeated Node args = 2 [json_name="args"];
+ Node repeatable = 3 [json_name="repeatable"];
+}
+
+message WithCheckOption
+{
+ WCOKind kind = 1 [json_name="kind"];
+ string relname = 2 [json_name="relname"];
+ string polname = 3 [json_name="polname"];
+ Node qual = 4 [json_name="qual"];
+ bool cascaded = 5 [json_name="cascaded"];
+}
+
+message SortGroupClause
+{
+ uint32 tle_sort_group_ref = 1 [json_name="tleSortGroupRef"];
+ uint32 eqop = 2 [json_name="eqop"];
+ uint32 sortop = 3 [json_name="sortop"];
+ bool nulls_first = 4 [json_name="nulls_first"];
+ bool hashable = 5 [json_name="hashable"];
+}
+
+message GroupingSet
+{
+ GroupingSetKind kind = 1 [json_name="kind"];
+ repeated Node content = 2 [json_name="content"];
+ int32 location = 3 [json_name="location"];
+}
+
+message WindowClause
+{
+ string name = 1 [json_name="name"];
+ string refname = 2 [json_name="refname"];
+ repeated Node partition_clause = 3 [json_name="partitionClause"];
+ repeated Node order_clause = 4 [json_name="orderClause"];
+ int32 frame_options = 5 [json_name="frameOptions"];
+ Node start_offset = 6 [json_name="startOffset"];
+ Node end_offset = 7 [json_name="endOffset"];
+ uint32 start_in_range_func = 8 [json_name="startInRangeFunc"];
+ uint32 end_in_range_func = 9 [json_name="endInRangeFunc"];
+ uint32 in_range_coll = 10 [json_name="inRangeColl"];
+ bool in_range_asc = 11 [json_name="inRangeAsc"];
+ bool in_range_nulls_first = 12 [json_name="inRangeNullsFirst"];
+ uint32 winref = 13 [json_name="winref"];
+ bool copied_order = 14 [json_name="copiedOrder"];
+}
+
+message ObjectWithArgs
+{
+ repeated Node objname = 1 [json_name="objname"];
+ repeated Node objargs = 2 [json_name="objargs"];
+ repeated Node objfuncargs = 3 [json_name="objfuncargs"];
+ bool args_unspecified = 4 [json_name="args_unspecified"];
+}
+
+message AccessPriv
+{
+ string priv_name = 1 [json_name="priv_name"];
+ repeated Node cols = 2 [json_name="cols"];
+}
+
+message CreateOpClassItem
+{
+ int32 itemtype = 1 [json_name="itemtype"];
+ ObjectWithArgs name = 2 [json_name="name"];
+ int32 number = 3 [json_name="number"];
+ repeated Node order_family = 4 [json_name="order_family"];
+ repeated Node class_args = 5 [json_name="class_args"];
+ TypeName storedtype = 6 [json_name="storedtype"];
+}
+
+message TableLikeClause
+{
+ RangeVar relation = 1 [json_name="relation"];
+ uint32 options = 2 [json_name="options"];
+ uint32 relation_oid = 3 [json_name="relationOid"];
+}
+
+message FunctionParameter
+{
+ string name = 1 [json_name="name"];
+ TypeName arg_type = 2 [json_name="argType"];
+ FunctionParameterMode mode = 3 [json_name="mode"];
+ Node defexpr = 4 [json_name="defexpr"];
+}
+
+message LockingClause
+{
+ repeated Node locked_rels = 1 [json_name="lockedRels"];
+ LockClauseStrength strength = 2 [json_name="strength"];
+ LockWaitPolicy wait_policy = 3 [json_name="waitPolicy"];
+}
+
+message RowMarkClause
+{
+ uint32 rti = 1 [json_name="rti"];
+ LockClauseStrength strength = 2 [json_name="strength"];
+ LockWaitPolicy wait_policy = 3 [json_name="waitPolicy"];
+ bool pushed_down = 4 [json_name="pushedDown"];
+}
+
+message XmlSerialize
+{
+ XmlOptionType xmloption = 1 [json_name="xmloption"];
+ Node expr = 2 [json_name="expr"];
+ TypeName type_name = 3 [json_name="typeName"];
+ int32 location = 4 [json_name="location"];
+}
+
+message WithClause
+{
+ repeated Node ctes = 1 [json_name="ctes"];
+ bool recursive = 2 [json_name="recursive"];
+ int32 location = 3 [json_name="location"];
+}
+
+message InferClause
+{
+ repeated Node index_elems = 1 [json_name="indexElems"];
+ Node where_clause = 2 [json_name="whereClause"];
+ string conname = 3 [json_name="conname"];
+ int32 location = 4 [json_name="location"];
+}
+
+message OnConflictClause
+{
+ OnConflictAction action = 1 [json_name="action"];
+ InferClause infer = 2 [json_name="infer"];
+ repeated Node target_list = 3 [json_name="targetList"];
+ Node where_clause = 4 [json_name="whereClause"];
+ int32 location = 5 [json_name="location"];
+}
+
+message CTESearchClause
+{
+ repeated Node search_col_list = 1 [json_name="search_col_list"];
+ bool search_breadth_first = 2 [json_name="search_breadth_first"];
+ string search_seq_column = 3 [json_name="search_seq_column"];
+ int32 location = 4 [json_name="location"];
+}
+
+message CTECycleClause
+{
+ repeated Node cycle_col_list = 1 [json_name="cycle_col_list"];
+ string cycle_mark_column = 2 [json_name="cycle_mark_column"];
+ Node cycle_mark_value = 3 [json_name="cycle_mark_value"];
+ Node cycle_mark_default = 4 [json_name="cycle_mark_default"];
+ string cycle_path_column = 5 [json_name="cycle_path_column"];
+ int32 location = 6 [json_name="location"];
+ uint32 cycle_mark_type = 7 [json_name="cycle_mark_type"];
+ int32 cycle_mark_typmod = 8 [json_name="cycle_mark_typmod"];
+ uint32 cycle_mark_collation = 9 [json_name="cycle_mark_collation"];
+ uint32 cycle_mark_neop = 10 [json_name="cycle_mark_neop"];
+}
+
+message CommonTableExpr
+{
+ string ctename = 1 [json_name="ctename"];
+ repeated Node aliascolnames = 2 [json_name="aliascolnames"];
+ CTEMaterialize ctematerialized = 3 [json_name="ctematerialized"];
+ Node ctequery = 4 [json_name="ctequery"];
+ CTESearchClause search_clause = 5 [json_name="search_clause"];
+ CTECycleClause cycle_clause = 6 [json_name="cycle_clause"];
+ int32 location = 7 [json_name="location"];
+ bool cterecursive = 8 [json_name="cterecursive"];
+ int32 cterefcount = 9 [json_name="cterefcount"];
+ repeated Node ctecolnames = 10 [json_name="ctecolnames"];
+ repeated Node ctecoltypes = 11 [json_name="ctecoltypes"];
+ repeated Node ctecoltypmods = 12 [json_name="ctecoltypmods"];
+ repeated Node ctecolcollations = 13 [json_name="ctecolcollations"];
+}
+
+message RoleSpec
+{
+ RoleSpecType roletype = 1 [json_name="roletype"];
+ string rolename = 2 [json_name="rolename"];
+ int32 location = 3 [json_name="location"];
+}
+
+message TriggerTransition
+{
+ string name = 1 [json_name="name"];
+ bool is_new = 2 [json_name="isNew"];
+ bool is_table = 3 [json_name="isTable"];
+}
+
+message PartitionElem
+{
+ string name = 1 [json_name="name"];
+ Node expr = 2 [json_name="expr"];
+ repeated Node collation = 3 [json_name="collation"];
+ repeated Node opclass = 4 [json_name="opclass"];
+ int32 location = 5 [json_name="location"];
+}
+
+message PartitionSpec
+{
+ string strategy = 1 [json_name="strategy"];
+ repeated Node part_params = 2 [json_name="partParams"];
+ int32 location = 3 [json_name="location"];
+}
+
+message PartitionBoundSpec
+{
+ string strategy = 1 [json_name="strategy"];
+ bool is_default = 2 [json_name="is_default"];
+ int32 modulus = 3 [json_name="modulus"];
+ int32 remainder = 4 [json_name="remainder"];
+ repeated Node listdatums = 5 [json_name="listdatums"];
+ repeated Node lowerdatums = 6 [json_name="lowerdatums"];
+ repeated Node upperdatums = 7 [json_name="upperdatums"];
+ int32 location = 8 [json_name="location"];
+}
+
+message PartitionRangeDatum
+{
+ PartitionRangeDatumKind kind = 1 [json_name="kind"];
+ Node value = 2 [json_name="value"];
+ int32 location = 3 [json_name="location"];
+}
+
+message PartitionCmd
+{
+ RangeVar name = 1 [json_name="name"];
+ PartitionBoundSpec bound = 2 [json_name="bound"];
+ bool concurrent = 3 [json_name="concurrent"];
+}
+
+message VacuumRelation
+{
+ RangeVar relation = 1 [json_name="relation"];
+ uint32 oid = 2 [json_name="oid"];
+ repeated Node va_cols = 3 [json_name="va_cols"];
+}
+
+message InlineCodeBlock
+{
+ string source_text = 1 [json_name="source_text"];
+ uint32 lang_oid = 2 [json_name="langOid"];
+ bool lang_is_trusted = 3 [json_name="langIsTrusted"];
+ bool atomic = 4 [json_name="atomic"];
+}
+
+message CallContext
+{
+ bool atomic = 1 [json_name="atomic"];
+}
+
+enum OverridingKind
+{
+ OVERRIDING_KIND_UNDEFINED = 0;
+ OVERRIDING_NOT_SET = 1;
+ OVERRIDING_USER_VALUE = 2;
+ OVERRIDING_SYSTEM_VALUE = 3;
+}
+
+enum QuerySource
+{
+ QUERY_SOURCE_UNDEFINED = 0;
+ QSRC_ORIGINAL = 1;
+ QSRC_PARSER = 2;
+ QSRC_INSTEAD_RULE = 3;
+ QSRC_QUAL_INSTEAD_RULE = 4;
+ QSRC_NON_INSTEAD_RULE = 5;
+}
+
+enum SortByDir
+{
+ SORT_BY_DIR_UNDEFINED = 0;
+ SORTBY_DEFAULT = 1;
+ SORTBY_ASC = 2;
+ SORTBY_DESC = 3;
+ SORTBY_USING = 4;
+}
+
+enum SortByNulls
+{
+ SORT_BY_NULLS_UNDEFINED = 0;
+ SORTBY_NULLS_DEFAULT = 1;
+ SORTBY_NULLS_FIRST = 2;
+ SORTBY_NULLS_LAST = 3;
+}
+
+enum SetQuantifier
+{
+ SET_QUANTIFIER_UNDEFINED = 0;
+ SET_QUANTIFIER_DEFAULT = 1;
+ SET_QUANTIFIER_ALL = 2;
+ SET_QUANTIFIER_DISTINCT = 3;
+}
+
+enum A_Expr_Kind
+{
+ A_EXPR_KIND_UNDEFINED = 0;
+ AEXPR_OP = 1;
+ AEXPR_OP_ANY = 2;
+ AEXPR_OP_ALL = 3;
+ AEXPR_DISTINCT = 4;
+ AEXPR_NOT_DISTINCT = 5;
+ AEXPR_NULLIF = 6;
+ AEXPR_IN = 7;
+ AEXPR_LIKE = 8;
+ AEXPR_ILIKE = 9;
+ AEXPR_SIMILAR = 10;
+ AEXPR_BETWEEN = 11;
+ AEXPR_NOT_BETWEEN = 12;
+ AEXPR_BETWEEN_SYM = 13;
+ AEXPR_NOT_BETWEEN_SYM = 14;
+}
+
+enum RoleSpecType
+{
+ ROLE_SPEC_TYPE_UNDEFINED = 0;
+ ROLESPEC_CSTRING = 1;
+ ROLESPEC_CURRENT_ROLE = 2;
+ ROLESPEC_CURRENT_USER = 3;
+ ROLESPEC_SESSION_USER = 4;
+ ROLESPEC_PUBLIC = 5;
+}
+
+enum TableLikeOption
+{
+ TABLE_LIKE_OPTION_UNDEFINED = 0;
+ CREATE_TABLE_LIKE_COMMENTS = 1;
+ CREATE_TABLE_LIKE_COMPRESSION = 2;
+ CREATE_TABLE_LIKE_CONSTRAINTS = 3;
+ CREATE_TABLE_LIKE_DEFAULTS = 4;
+ CREATE_TABLE_LIKE_GENERATED = 5;
+ CREATE_TABLE_LIKE_IDENTITY = 6;
+ CREATE_TABLE_LIKE_INDEXES = 7;
+ CREATE_TABLE_LIKE_STATISTICS = 8;
+ CREATE_TABLE_LIKE_STORAGE = 9;
+ CREATE_TABLE_LIKE_ALL = 10;
+}
+
+enum DefElemAction
+{
+ DEF_ELEM_ACTION_UNDEFINED = 0;
+ DEFELEM_UNSPEC = 1;
+ DEFELEM_SET = 2;
+ DEFELEM_ADD = 3;
+ DEFELEM_DROP = 4;
+}
+
+enum PartitionRangeDatumKind
+{
+ PARTITION_RANGE_DATUM_KIND_UNDEFINED = 0;
+ PARTITION_RANGE_DATUM_MINVALUE = 1;
+ PARTITION_RANGE_DATUM_VALUE = 2;
+ PARTITION_RANGE_DATUM_MAXVALUE = 3;
+}
+
+enum RTEKind
+{
+ RTEKIND_UNDEFINED = 0;
+ RTE_RELATION = 1;
+ RTE_SUBQUERY = 2;
+ RTE_JOIN = 3;
+ RTE_FUNCTION = 4;
+ RTE_TABLEFUNC = 5;
+ RTE_VALUES = 6;
+ RTE_CTE = 7;
+ RTE_NAMEDTUPLESTORE = 8;
+ RTE_RESULT = 9;
+}
+
+enum WCOKind
+{
+ WCOKIND_UNDEFINED = 0;
+ WCO_VIEW_CHECK = 1;
+ WCO_RLS_INSERT_CHECK = 2;
+ WCO_RLS_UPDATE_CHECK = 3;
+ WCO_RLS_CONFLICT_CHECK = 4;
+}
+
+enum GroupingSetKind
+{
+ GROUPING_SET_KIND_UNDEFINED = 0;
+ GROUPING_SET_EMPTY = 1;
+ GROUPING_SET_SIMPLE = 2;
+ GROUPING_SET_ROLLUP = 3;
+ GROUPING_SET_CUBE = 4;
+ GROUPING_SET_SETS = 5;
+}
+
+enum CTEMaterialize
+{
+ CTEMATERIALIZE_UNDEFINED = 0;
+ CTEMaterializeDefault = 1;
+ CTEMaterializeAlways = 2;
+ CTEMaterializeNever = 3;
+}
+
+enum SetOperation
+{
+ SET_OPERATION_UNDEFINED = 0;
+ SETOP_NONE = 1;
+ SETOP_UNION = 2;
+ SETOP_INTERSECT = 3;
+ SETOP_EXCEPT = 4;
+}
+
+enum ObjectType
+{
+ OBJECT_TYPE_UNDEFINED = 0;
+ OBJECT_ACCESS_METHOD = 1;
+ OBJECT_AGGREGATE = 2;
+ OBJECT_AMOP = 3;
+ OBJECT_AMPROC = 4;
+ OBJECT_ATTRIBUTE = 5;
+ OBJECT_CAST = 6;
+ OBJECT_COLUMN = 7;
+ OBJECT_COLLATION = 8;
+ OBJECT_CONVERSION = 9;
+ OBJECT_DATABASE = 10;
+ OBJECT_DEFAULT = 11;
+ OBJECT_DEFACL = 12;
+ OBJECT_DOMAIN = 13;
+ OBJECT_DOMCONSTRAINT = 14;
+ OBJECT_EVENT_TRIGGER = 15;
+ OBJECT_EXTENSION = 16;
+ OBJECT_FDW = 17;
+ OBJECT_FOREIGN_SERVER = 18;
+ OBJECT_FOREIGN_TABLE = 19;
+ OBJECT_FUNCTION = 20;
+ OBJECT_INDEX = 21;
+ OBJECT_LANGUAGE = 22;
+ OBJECT_LARGEOBJECT = 23;
+ OBJECT_MATVIEW = 24;
+ OBJECT_OPCLASS = 25;
+ OBJECT_OPERATOR = 26;
+ OBJECT_OPFAMILY = 27;
+ OBJECT_POLICY = 28;
+ OBJECT_PROCEDURE = 29;
+ OBJECT_PUBLICATION = 30;
+ OBJECT_PUBLICATION_REL = 31;
+ OBJECT_ROLE = 32;
+ OBJECT_ROUTINE = 33;
+ OBJECT_RULE = 34;
+ OBJECT_SCHEMA = 35;
+ OBJECT_SEQUENCE = 36;
+ OBJECT_SUBSCRIPTION = 37;
+ OBJECT_STATISTIC_EXT = 38;
+ OBJECT_TABCONSTRAINT = 39;
+ OBJECT_TABLE = 40;
+ OBJECT_TABLESPACE = 41;
+ OBJECT_TRANSFORM = 42;
+ OBJECT_TRIGGER = 43;
+ OBJECT_TSCONFIGURATION = 44;
+ OBJECT_TSDICTIONARY = 45;
+ OBJECT_TSPARSER = 46;
+ OBJECT_TSTEMPLATE = 47;
+ OBJECT_TYPE = 48;
+ OBJECT_USER_MAPPING = 49;
+ OBJECT_VIEW = 50;
+}
+
+enum DropBehavior
+{
+ DROP_BEHAVIOR_UNDEFINED = 0;
+ DROP_RESTRICT = 1;
+ DROP_CASCADE = 2;
+}
+
+enum AlterTableType
+{
+ ALTER_TABLE_TYPE_UNDEFINED = 0;
+ AT_AddColumn = 1;
+ AT_AddColumnRecurse = 2;
+ AT_AddColumnToView = 3;
+ AT_ColumnDefault = 4;
+ AT_CookedColumnDefault = 5;
+ AT_DropNotNull = 6;
+ AT_SetNotNull = 7;
+ AT_DropExpression = 8;
+ AT_CheckNotNull = 9;
+ AT_SetStatistics = 10;
+ AT_SetOptions = 11;
+ AT_ResetOptions = 12;
+ AT_SetStorage = 13;
+ AT_SetCompression = 14;
+ AT_DropColumn = 15;
+ AT_DropColumnRecurse = 16;
+ AT_AddIndex = 17;
+ AT_ReAddIndex = 18;
+ AT_AddConstraint = 19;
+ AT_AddConstraintRecurse = 20;
+ AT_ReAddConstraint = 21;
+ AT_ReAddDomainConstraint = 22;
+ AT_AlterConstraint = 23;
+ AT_ValidateConstraint = 24;
+ AT_ValidateConstraintRecurse = 25;
+ AT_AddIndexConstraint = 26;
+ AT_DropConstraint = 27;
+ AT_DropConstraintRecurse = 28;
+ AT_ReAddComment = 29;
+ AT_AlterColumnType = 30;
+ AT_AlterColumnGenericOptions = 31;
+ AT_ChangeOwner = 32;
+ AT_ClusterOn = 33;
+ AT_DropCluster = 34;
+ AT_SetLogged = 35;
+ AT_SetUnLogged = 36;
+ AT_DropOids = 37;
+ AT_SetTableSpace = 38;
+ AT_SetRelOptions = 39;
+ AT_ResetRelOptions = 40;
+ AT_ReplaceRelOptions = 41;
+ AT_EnableTrig = 42;
+ AT_EnableAlwaysTrig = 43;
+ AT_EnableReplicaTrig = 44;
+ AT_DisableTrig = 45;
+ AT_EnableTrigAll = 46;
+ AT_DisableTrigAll = 47;
+ AT_EnableTrigUser = 48;
+ AT_DisableTrigUser = 49;
+ AT_EnableRule = 50;
+ AT_EnableAlwaysRule = 51;
+ AT_EnableReplicaRule = 52;
+ AT_DisableRule = 53;
+ AT_AddInherit = 54;
+ AT_DropInherit = 55;
+ AT_AddOf = 56;
+ AT_DropOf = 57;
+ AT_ReplicaIdentity = 58;
+ AT_EnableRowSecurity = 59;
+ AT_DisableRowSecurity = 60;
+ AT_ForceRowSecurity = 61;
+ AT_NoForceRowSecurity = 62;
+ AT_GenericOptions = 63;
+ AT_AttachPartition = 64;
+ AT_DetachPartition = 65;
+ AT_DetachPartitionFinalize = 66;
+ AT_AddIdentity = 67;
+ AT_SetIdentity = 68;
+ AT_DropIdentity = 69;
+ AT_ReAddStatistics = 70;
+}
+
+enum GrantTargetType
+{
+ GRANT_TARGET_TYPE_UNDEFINED = 0;
+ ACL_TARGET_OBJECT = 1;
+ ACL_TARGET_ALL_IN_SCHEMA = 2;
+ ACL_TARGET_DEFAULTS = 3;
+}
+
+enum VariableSetKind
+{
+ VARIABLE_SET_KIND_UNDEFINED = 0;
+ VAR_SET_VALUE = 1;
+ VAR_SET_DEFAULT = 2;
+ VAR_SET_CURRENT = 3;
+ VAR_SET_MULTI = 4;
+ VAR_RESET = 5;
+ VAR_RESET_ALL = 6;
+}
+
+enum ConstrType
+{
+ CONSTR_TYPE_UNDEFINED = 0;
+ CONSTR_NULL = 1;
+ CONSTR_NOTNULL = 2;
+ CONSTR_DEFAULT = 3;
+ CONSTR_IDENTITY = 4;
+ CONSTR_GENERATED = 5;
+ CONSTR_CHECK = 6;
+ CONSTR_PRIMARY = 7;
+ CONSTR_UNIQUE = 8;
+ CONSTR_EXCLUSION = 9;
+ CONSTR_FOREIGN = 10;
+ CONSTR_ATTR_DEFERRABLE = 11;
+ CONSTR_ATTR_NOT_DEFERRABLE = 12;
+ CONSTR_ATTR_DEFERRED = 13;
+ CONSTR_ATTR_IMMEDIATE = 14;
+}
+
+enum ImportForeignSchemaType
+{
+ IMPORT_FOREIGN_SCHEMA_TYPE_UNDEFINED = 0;
+ FDW_IMPORT_SCHEMA_ALL = 1;
+ FDW_IMPORT_SCHEMA_LIMIT_TO = 2;
+ FDW_IMPORT_SCHEMA_EXCEPT = 3;
+}
+
+enum RoleStmtType
+{
+ ROLE_STMT_TYPE_UNDEFINED = 0;
+ ROLESTMT_ROLE = 1;
+ ROLESTMT_USER = 2;
+ ROLESTMT_GROUP = 3;
+}
+
+enum FetchDirection
+{
+ FETCH_DIRECTION_UNDEFINED = 0;
+ FETCH_FORWARD = 1;
+ FETCH_BACKWARD = 2;
+ FETCH_ABSOLUTE = 3;
+ FETCH_RELATIVE = 4;
+}
+
+enum FunctionParameterMode
+{
+ FUNCTION_PARAMETER_MODE_UNDEFINED = 0;
+ FUNC_PARAM_IN = 1;
+ FUNC_PARAM_OUT = 2;
+ FUNC_PARAM_INOUT = 3;
+ FUNC_PARAM_VARIADIC = 4;
+ FUNC_PARAM_TABLE = 5;
+ FUNC_PARAM_DEFAULT = 6;
+}
+
+enum TransactionStmtKind
+{
+ TRANSACTION_STMT_KIND_UNDEFINED = 0;
+ TRANS_STMT_BEGIN = 1;
+ TRANS_STMT_START = 2;
+ TRANS_STMT_COMMIT = 3;
+ TRANS_STMT_ROLLBACK = 4;
+ TRANS_STMT_SAVEPOINT = 5;
+ TRANS_STMT_RELEASE = 6;
+ TRANS_STMT_ROLLBACK_TO = 7;
+ TRANS_STMT_PREPARE = 8;
+ TRANS_STMT_COMMIT_PREPARED = 9;
+ TRANS_STMT_ROLLBACK_PREPARED = 10;
+}
+
+enum ViewCheckOption
+{
+ VIEW_CHECK_OPTION_UNDEFINED = 0;
+ NO_CHECK_OPTION = 1;
+ LOCAL_CHECK_OPTION = 2;
+ CASCADED_CHECK_OPTION = 3;
+}
+
+enum DiscardMode
+{
+ DISCARD_MODE_UNDEFINED = 0;
+ DISCARD_ALL = 1;
+ DISCARD_PLANS = 2;
+ DISCARD_SEQUENCES = 3;
+ DISCARD_TEMP = 4;
+}
+
+enum ReindexObjectType
+{
+ REINDEX_OBJECT_TYPE_UNDEFINED = 0;
+ REINDEX_OBJECT_INDEX = 1;
+ REINDEX_OBJECT_TABLE = 2;
+ REINDEX_OBJECT_SCHEMA = 3;
+ REINDEX_OBJECT_SYSTEM = 4;
+ REINDEX_OBJECT_DATABASE = 5;
+}
+
+enum AlterTSConfigType
+{
+ ALTER_TSCONFIG_TYPE_UNDEFINED = 0;
+ ALTER_TSCONFIG_ADD_MAPPING = 1;
+ ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN = 2;
+ ALTER_TSCONFIG_REPLACE_DICT = 3;
+ ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN = 4;
+ ALTER_TSCONFIG_DROP_MAPPING = 5;
+}
+
+enum AlterSubscriptionType
+{
+ ALTER_SUBSCRIPTION_TYPE_UNDEFINED = 0;
+ ALTER_SUBSCRIPTION_OPTIONS = 1;
+ ALTER_SUBSCRIPTION_CONNECTION = 2;
+ ALTER_SUBSCRIPTION_SET_PUBLICATION = 3;
+ ALTER_SUBSCRIPTION_ADD_PUBLICATION = 4;
+ ALTER_SUBSCRIPTION_DROP_PUBLICATION = 5;
+ ALTER_SUBSCRIPTION_REFRESH = 6;
+ ALTER_SUBSCRIPTION_ENABLED = 7;
+}
+
+enum OnCommitAction
+{
+ ON_COMMIT_ACTION_UNDEFINED = 0;
+ ONCOMMIT_NOOP = 1;
+ ONCOMMIT_PRESERVE_ROWS = 2;
+ ONCOMMIT_DELETE_ROWS = 3;
+ ONCOMMIT_DROP = 4;
+}
+
+enum ParamKind
+{
+ PARAM_KIND_UNDEFINED = 0;
+ PARAM_EXTERN = 1;
+ PARAM_EXEC = 2;
+ PARAM_SUBLINK = 3;
+ PARAM_MULTIEXPR = 4;
+}
+
+enum CoercionContext
+{
+ COERCION_CONTEXT_UNDEFINED = 0;
+ COERCION_IMPLICIT = 1;
+ COERCION_ASSIGNMENT = 2;
+ COERCION_PLPGSQL = 3;
+ COERCION_EXPLICIT = 4;
+}
+
+enum CoercionForm
+{
+ COERCION_FORM_UNDEFINED = 0;
+ COERCE_EXPLICIT_CALL = 1;
+ COERCE_EXPLICIT_CAST = 2;
+ COERCE_IMPLICIT_CAST = 3;
+ COERCE_SQL_SYNTAX = 4;
+}
+
+enum BoolExprType
+{
+ BOOL_EXPR_TYPE_UNDEFINED = 0;
+ AND_EXPR = 1;
+ OR_EXPR = 2;
+ NOT_EXPR = 3;
+}
+
+enum SubLinkType
+{
+ SUB_LINK_TYPE_UNDEFINED = 0;
+ EXISTS_SUBLINK = 1;
+ ALL_SUBLINK = 2;
+ ANY_SUBLINK = 3;
+ ROWCOMPARE_SUBLINK = 4;
+ EXPR_SUBLINK = 5;
+ MULTIEXPR_SUBLINK = 6;
+ ARRAY_SUBLINK = 7;
+ CTE_SUBLINK = 8;
+}
+
+enum RowCompareType
+{
+ ROW_COMPARE_TYPE_UNDEFINED = 0;
+ ROWCOMPARE_LT = 1;
+ ROWCOMPARE_LE = 2;
+ ROWCOMPARE_EQ = 3;
+ ROWCOMPARE_GE = 4;
+ ROWCOMPARE_GT = 5;
+ ROWCOMPARE_NE = 6;
+}
+
+enum MinMaxOp
+{
+ MIN_MAX_OP_UNDEFINED = 0;
+ IS_GREATEST = 1;
+ IS_LEAST = 2;
+}
+
+enum SQLValueFunctionOp
+{
+ SQLVALUE_FUNCTION_OP_UNDEFINED = 0;
+ SVFOP_CURRENT_DATE = 1;
+ SVFOP_CURRENT_TIME = 2;
+ SVFOP_CURRENT_TIME_N = 3;
+ SVFOP_CURRENT_TIMESTAMP = 4;
+ SVFOP_CURRENT_TIMESTAMP_N = 5;
+ SVFOP_LOCALTIME = 6;
+ SVFOP_LOCALTIME_N = 7;
+ SVFOP_LOCALTIMESTAMP = 8;
+ SVFOP_LOCALTIMESTAMP_N = 9;
+ SVFOP_CURRENT_ROLE = 10;
+ SVFOP_CURRENT_USER = 11;
+ SVFOP_USER = 12;
+ SVFOP_SESSION_USER = 13;
+ SVFOP_CURRENT_CATALOG = 14;
+ SVFOP_CURRENT_SCHEMA = 15;
+}
+
+enum XmlExprOp
+{
+ XML_EXPR_OP_UNDEFINED = 0;
+ IS_XMLCONCAT = 1;
+ IS_XMLELEMENT = 2;
+ IS_XMLFOREST = 3;
+ IS_XMLPARSE = 4;
+ IS_XMLPI = 5;
+ IS_XMLROOT = 6;
+ IS_XMLSERIALIZE = 7;
+ IS_DOCUMENT = 8;
+}
+
+enum XmlOptionType
+{
+ XML_OPTION_TYPE_UNDEFINED = 0;
+ XMLOPTION_DOCUMENT = 1;
+ XMLOPTION_CONTENT = 2;
+}
+
+enum NullTestType
+{
+ NULL_TEST_TYPE_UNDEFINED = 0;
+ IS_NULL = 1;
+ IS_NOT_NULL = 2;
+}
+
+enum BoolTestType
+{
+ BOOL_TEST_TYPE_UNDEFINED = 0;
+ IS_TRUE = 1;
+ IS_NOT_TRUE = 2;
+ IS_FALSE = 3;
+ IS_NOT_FALSE = 4;
+ IS_UNKNOWN = 5;
+ IS_NOT_UNKNOWN = 6;
+}
+
+enum CmdType
+{
+ CMD_TYPE_UNDEFINED = 0;
+ CMD_UNKNOWN = 1;
+ CMD_SELECT = 2;
+ CMD_UPDATE = 3;
+ CMD_INSERT = 4;
+ CMD_DELETE = 5;
+ CMD_UTILITY = 6;
+ CMD_NOTHING = 7;
+}
+
+enum JoinType
+{
+ JOIN_TYPE_UNDEFINED = 0;
+ JOIN_INNER = 1;
+ JOIN_LEFT = 2;
+ JOIN_FULL = 3;
+ JOIN_RIGHT = 4;
+ JOIN_SEMI = 5;
+ JOIN_ANTI = 6;
+ JOIN_UNIQUE_OUTER = 7;
+ JOIN_UNIQUE_INNER = 8;
+}
+
+enum AggStrategy
+{
+ AGG_STRATEGY_UNDEFINED = 0;
+ AGG_PLAIN = 1;
+ AGG_SORTED = 2;
+ AGG_HASHED = 3;
+ AGG_MIXED = 4;
+}
+
+enum AggSplit
+{
+ AGG_SPLIT_UNDEFINED = 0;
+ AGGSPLIT_SIMPLE = 1;
+ AGGSPLIT_INITIAL_SERIAL = 2;
+ AGGSPLIT_FINAL_DESERIAL = 3;
+}
+
+enum SetOpCmd
+{
+ SET_OP_CMD_UNDEFINED = 0;
+ SETOPCMD_INTERSECT = 1;
+ SETOPCMD_INTERSECT_ALL = 2;
+ SETOPCMD_EXCEPT = 3;
+ SETOPCMD_EXCEPT_ALL = 4;
+}
+
+enum SetOpStrategy
+{
+ SET_OP_STRATEGY_UNDEFINED = 0;
+ SETOP_SORTED = 1;
+ SETOP_HASHED = 2;
+}
+
+enum OnConflictAction
+{
+ ON_CONFLICT_ACTION_UNDEFINED = 0;
+ ONCONFLICT_NONE = 1;
+ ONCONFLICT_NOTHING = 2;
+ ONCONFLICT_UPDATE = 3;
+}
+
+enum LimitOption
+{
+ LIMIT_OPTION_UNDEFINED = 0;
+ LIMIT_OPTION_DEFAULT = 1;
+ LIMIT_OPTION_COUNT = 2;
+ LIMIT_OPTION_WITH_TIES = 3;
+}
+
+enum LockClauseStrength
+{
+ LOCK_CLAUSE_STRENGTH_UNDEFINED = 0;
+ LCS_NONE = 1;
+ LCS_FORKEYSHARE = 2;
+ LCS_FORSHARE = 3;
+ LCS_FORNOKEYUPDATE = 4;
+ LCS_FORUPDATE = 5;
+}
+
+enum LockWaitPolicy
+{
+ LOCK_WAIT_POLICY_UNDEFINED = 0;
+ LockWaitBlock = 1;
+ LockWaitSkip = 2;
+ LockWaitError = 3;
+}
+
+enum LockTupleMode
+{
+ LOCK_TUPLE_MODE_UNDEFINED = 0;
+ LockTupleKeyShare = 1;
+ LockTupleShare = 2;
+ LockTupleNoKeyExclusive = 3;
+ LockTupleExclusive = 4;
+}
+
+message ScanToken {
+ int32 start = 1;
+ int32 end = 2;
+ Token token = 4;
+ KeywordKind keyword_kind = 5;
+}
+
+enum KeywordKind {
+ NO_KEYWORD = 0;
+ UNRESERVED_KEYWORD = 1;
+ COL_NAME_KEYWORD = 2;
+ TYPE_FUNC_NAME_KEYWORD = 3;
+ RESERVED_KEYWORD = 4;
+}
+
+enum Token {
+ NUL = 0;
+ // Single-character tokens that are returned 1:1 (identical with "self" list in scan.l)
+ // Either supporting syntax, or single-character operators (some can be both)
+ // Also see https://www.postgresql.org/docs/12/sql-syntax-lexical.html#SQL-SYNTAX-SPECIAL-CHARS
+ ASCII_37 = 37; // "%"
+ ASCII_40 = 40; // "("
+ ASCII_41 = 41; // ")"
+ ASCII_42 = 42; // "*"
+ ASCII_43 = 43; // "+"
+ ASCII_44 = 44; // ","
+ ASCII_45 = 45; // "-"
+ ASCII_46 = 46; // "."
+ ASCII_47 = 47; // "/"
+ ASCII_58 = 58; // ":"
+ ASCII_59 = 59; // ";"
+ ASCII_60 = 60; // "<"
+ ASCII_61 = 61; // "="
+ ASCII_62 = 62; // ">"
+ ASCII_63 = 63; // "?"
+ ASCII_91 = 91; // "["
+ ASCII_92 = 92; // "\"
+ ASCII_93 = 93; // "]"
+ ASCII_94 = 94; // "^"
+ // Named tokens in scan.l
+ IDENT = 258;
+ UIDENT = 259;
+ FCONST = 260;
+ SCONST = 261;
+ USCONST = 262;
+ BCONST = 263;
+ XCONST = 264;
+ Op = 265;
+ ICONST = 266;
+ PARAM = 267;
+ TYPECAST = 268;
+ DOT_DOT = 269;
+ COLON_EQUALS = 270;
+ EQUALS_GREATER = 271;
+ LESS_EQUALS = 272;
+ GREATER_EQUALS = 273;
+ NOT_EQUALS = 274;
+ SQL_COMMENT = 275;
+ C_COMMENT = 276;
+ ABORT_P = 277;
+ ABSOLUTE_P = 278;
+ ACCESS = 279;
+ ACTION = 280;
+ ADD_P = 281;
+ ADMIN = 282;
+ AFTER = 283;
+ AGGREGATE = 284;
+ ALL = 285;
+ ALSO = 286;
+ ALTER = 287;
+ ALWAYS = 288;
+ ANALYSE = 289;
+ ANALYZE = 290;
+ AND = 291;
+ ANY = 292;
+ ARRAY = 293;
+ AS = 294;
+ ASC = 295;
+ ASENSITIVE = 296;
+ ASSERTION = 297;
+ ASSIGNMENT = 298;
+ ASYMMETRIC = 299;
+ ATOMIC = 300;
+ AT = 301;
+ ATTACH = 302;
+ ATTRIBUTE = 303;
+ AUTHORIZATION = 304;
+ BACKWARD = 305;
+ BEFORE = 306;
+ BEGIN_P = 307;
+ BETWEEN = 308;
+ BIGINT = 309;
+ BINARY = 310;
+ BIT = 311;
+ BOOLEAN_P = 312;
+ BOTH = 313;
+ BREADTH = 314;
+ BY = 315;
+ CACHE = 316;
+ CALL = 317;
+ CALLED = 318;
+ CASCADE = 319;
+ CASCADED = 320;
+ CASE = 321;
+ CAST = 322;
+ CATALOG_P = 323;
+ CHAIN = 324;
+ CHAR_P = 325;
+ CHARACTER = 326;
+ CHARACTERISTICS = 327;
+ CHECK = 328;
+ CHECKPOINT = 329;
+ CLASS = 330;
+ CLOSE = 331;
+ CLUSTER = 332;
+ COALESCE = 333;
+ COLLATE = 334;
+ COLLATION = 335;
+ COLUMN = 336;
+ COLUMNS = 337;
+ COMMENT = 338;
+ COMMENTS = 339;
+ COMMIT = 340;
+ COMMITTED = 341;
+ COMPRESSION = 342;
+ CONCURRENTLY = 343;
+ CONFIGURATION = 344;
+ CONFLICT = 345;
+ CONNECTION = 346;
+ CONSTRAINT = 347;
+ CONSTRAINTS = 348;
+ CONTENT_P = 349;
+ CONTINUE_P = 350;
+ CONVERSION_P = 351;
+ COPY = 352;
+ COST = 353;
+ CREATE = 354;
+ CROSS = 355;
+ CSV = 356;
+ CUBE = 357;
+ CURRENT_P = 358;
+ CURRENT_CATALOG = 359;
+ CURRENT_DATE = 360;
+ CURRENT_ROLE = 361;
+ CURRENT_SCHEMA = 362;
+ CURRENT_TIME = 363;
+ CURRENT_TIMESTAMP = 364;
+ CURRENT_USER = 365;
+ CURSOR = 366;
+ CYCLE = 367;
+ DATA_P = 368;
+ DATABASE = 369;
+ DAY_P = 370;
+ DEALLOCATE = 371;
+ DEC = 372;
+ DECIMAL_P = 373;
+ DECLARE = 374;
+ DEFAULT = 375;
+ DEFAULTS = 376;
+ DEFERRABLE = 377;
+ DEFERRED = 378;
+ DEFINER = 379;
+ DELETE_P = 380;
+ DELIMITER = 381;
+ DELIMITERS = 382;
+ DEPENDS = 383;
+ DEPTH = 384;
+ DESC = 385;
+ DETACH = 386;
+ DICTIONARY = 387;
+ DISABLE_P = 388;
+ DISCARD = 389;
+ DISTINCT = 390;
+ DO = 391;
+ DOCUMENT_P = 392;
+ DOMAIN_P = 393;
+ DOUBLE_P = 394;
+ DROP = 395;
+ EACH = 396;
+ ELSE = 397;
+ ENABLE_P = 398;
+ ENCODING = 399;
+ ENCRYPTED = 400;
+ END_P = 401;
+ ENUM_P = 402;
+ ESCAPE = 403;
+ EVENT = 404;
+ EXCEPT = 405;
+ EXCLUDE = 406;
+ EXCLUDING = 407;
+ EXCLUSIVE = 408;
+ EXECUTE = 409;
+ EXISTS = 410;
+ EXPLAIN = 411;
+ EXPRESSION = 412;
+ EXTENSION = 413;
+ EXTERNAL = 414;
+ EXTRACT = 415;
+ FALSE_P = 416;
+ FAMILY = 417;
+ FETCH = 418;
+ FILTER = 419;
+ FINALIZE = 420;
+ FIRST_P = 421;
+ FLOAT_P = 422;
+ FOLLOWING = 423;
+ FOR = 424;
+ FORCE = 425;
+ FOREIGN = 426;
+ FORWARD = 427;
+ FREEZE = 428;
+ FROM = 429;
+ FULL = 430;
+ FUNCTION = 431;
+ FUNCTIONS = 432;
+ GENERATED = 433;
+ GLOBAL = 434;
+ GRANT = 435;
+ GRANTED = 436;
+ GREATEST = 437;
+ GROUP_P = 438;
+ GROUPING = 439;
+ GROUPS = 440;
+ HANDLER = 441;
+ HAVING = 442;
+ HEADER_P = 443;
+ HOLD = 444;
+ HOUR_P = 445;
+ IDENTITY_P = 446;
+ IF_P = 447;
+ ILIKE = 448;
+ IMMEDIATE = 449;
+ IMMUTABLE = 450;
+ IMPLICIT_P = 451;
+ IMPORT_P = 452;
+ IN_P = 453;
+ INCLUDE = 454;
+ INCLUDING = 455;
+ INCREMENT = 456;
+ INDEX = 457;
+ INDEXES = 458;
+ INHERIT = 459;
+ INHERITS = 460;
+ INITIALLY = 461;
+ INLINE_P = 462;
+ INNER_P = 463;
+ INOUT = 464;
+ INPUT_P = 465;
+ INSENSITIVE = 466;
+ INSERT = 467;
+ INSTEAD = 468;
+ INT_P = 469;
+ INTEGER = 470;
+ INTERSECT = 471;
+ INTERVAL = 472;
+ INTO = 473;
+ INVOKER = 474;
+ IS = 475;
+ ISNULL = 476;
+ ISOLATION = 477;
+ JOIN = 478;
+ KEY = 479;
+ LABEL = 480;
+ LANGUAGE = 481;
+ LARGE_P = 482;
+ LAST_P = 483;
+ LATERAL_P = 484;
+ LEADING = 485;
+ LEAKPROOF = 486;
+ LEAST = 487;
+ LEFT = 488;
+ LEVEL = 489;
+ LIKE = 490;
+ LIMIT = 491;
+ LISTEN = 492;
+ LOAD = 493;
+ LOCAL = 494;
+ LOCALTIME = 495;
+ LOCALTIMESTAMP = 496;
+ LOCATION = 497;
+ LOCK_P = 498;
+ LOCKED = 499;
+ LOGGED = 500;
+ MAPPING = 501;
+ MATCH = 502;
+ MATERIALIZED = 503;
+ MAXVALUE = 504;
+ METHOD = 505;
+ MINUTE_P = 506;
+ MINVALUE = 507;
+ MODE = 508;
+ MONTH_P = 509;
+ MOVE = 510;
+ NAME_P = 511;
+ NAMES = 512;
+ NATIONAL = 513;
+ NATURAL = 514;
+ NCHAR = 515;
+ NEW = 516;
+ NEXT = 517;
+ NFC = 518;
+ NFD = 519;
+ NFKC = 520;
+ NFKD = 521;
+ NO = 522;
+ NONE = 523;
+ NORMALIZE = 524;
+ NORMALIZED = 525;
+ NOT = 526;
+ NOTHING = 527;
+ NOTIFY = 528;
+ NOTNULL = 529;
+ NOWAIT = 530;
+ NULL_P = 531;
+ NULLIF = 532;
+ NULLS_P = 533;
+ NUMERIC = 534;
+ OBJECT_P = 535;
+ OF = 536;
+ OFF = 537;
+ OFFSET = 538;
+ OIDS = 539;
+ OLD = 540;
+ ON = 541;
+ ONLY = 542;
+ OPERATOR = 543;
+ OPTION = 544;
+ OPTIONS = 545;
+ OR = 546;
+ ORDER = 547;
+ ORDINALITY = 548;
+ OTHERS = 549;
+ OUT_P = 550;
+ OUTER_P = 551;
+ OVER = 552;
+ OVERLAPS = 553;
+ OVERLAY = 554;
+ OVERRIDING = 555;
+ OWNED = 556;
+ OWNER = 557;
+ PARALLEL = 558;
+ PARSER = 559;
+ PARTIAL = 560;
+ PARTITION = 561;
+ PASSING = 562;
+ PASSWORD = 563;
+ PLACING = 564;
+ PLANS = 565;
+ POLICY = 566;
+ POSITION = 567;
+ PRECEDING = 568;
+ PRECISION = 569;
+ PRESERVE = 570;
+ PREPARE = 571;
+ PREPARED = 572;
+ PRIMARY = 573;
+ PRIOR = 574;
+ PRIVILEGES = 575;
+ PROCEDURAL = 576;
+ PROCEDURE = 577;
+ PROCEDURES = 578;
+ PROGRAM = 579;
+ PUBLICATION = 580;
+ QUOTE = 581;
+ RANGE = 582;
+ READ = 583;
+ REAL = 584;
+ REASSIGN = 585;
+ RECHECK = 586;
+ RECURSIVE = 587;
+ REF_P = 588;
+ REFERENCES = 589;
+ REFERENCING = 590;
+ REFRESH = 591;
+ REINDEX = 592;
+ RELATIVE_P = 593;
+ RELEASE = 594;
+ RENAME = 595;
+ REPEATABLE = 596;
+ REPLACE = 597;
+ REPLICA = 598;
+ RESET = 599;
+ RESTART = 600;
+ RESTRICT = 601;
+ RETURN = 602;
+ RETURNING = 603;
+ RETURNS = 604;
+ REVOKE = 605;
+ RIGHT = 606;
+ ROLE = 607;
+ ROLLBACK = 608;
+ ROLLUP = 609;
+ ROUTINE = 610;
+ ROUTINES = 611;
+ ROW = 612;
+ ROWS = 613;
+ RULE = 614;
+ SAVEPOINT = 615;
+ SCHEMA = 616;
+ SCHEMAS = 617;
+ SCROLL = 618;
+ SEARCH = 619;
+ SECOND_P = 620;
+ SECURITY = 621;
+ SELECT = 622;
+ SEQUENCE = 623;
+ SEQUENCES = 624;
+ SERIALIZABLE = 625;
+ SERVER = 626;
+ SESSION = 627;
+ SESSION_USER = 628;
+ SET = 629;
+ SETS = 630;
+ SETOF = 631;
+ SHARE = 632;
+ SHOW = 633;
+ SIMILAR = 634;
+ SIMPLE = 635;
+ SKIP = 636;
+ SMALLINT = 637;
+ SNAPSHOT = 638;
+ SOME = 639;
+ SQL_P = 640;
+ STABLE = 641;
+ STANDALONE_P = 642;
+ START = 643;
+ STATEMENT = 644;
+ STATISTICS = 645;
+ STDIN = 646;
+ STDOUT = 647;
+ STORAGE = 648;
+ STORED = 649;
+ STRICT_P = 650;
+ STRIP_P = 651;
+ SUBSCRIPTION = 652;
+ SUBSTRING = 653;
+ SUPPORT = 654;
+ SYMMETRIC = 655;
+ SYSID = 656;
+ SYSTEM_P = 657;
+ TABLE = 658;
+ TABLES = 659;
+ TABLESAMPLE = 660;
+ TABLESPACE = 661;
+ TEMP = 662;
+ TEMPLATE = 663;
+ TEMPORARY = 664;
+ TEXT_P = 665;
+ THEN = 666;
+ TIES = 667;
+ TIME = 668;
+ TIMESTAMP = 669;
+ TO = 670;
+ TRAILING = 671;
+ TRANSACTION = 672;
+ TRANSFORM = 673;
+ TREAT = 674;
+ TRIGGER = 675;
+ TRIM = 676;
+ TRUE_P = 677;
+ TRUNCATE = 678;
+ TRUSTED = 679;
+ TYPE_P = 680;
+ TYPES_P = 681;
+ UESCAPE = 682;
+ UNBOUNDED = 683;
+ UNCOMMITTED = 684;
+ UNENCRYPTED = 685;
+ UNION = 686;
+ UNIQUE = 687;
+ UNKNOWN = 688;
+ UNLISTEN = 689;
+ UNLOGGED = 690;
+ UNTIL = 691;
+ UPDATE = 692;
+ USER = 693;
+ USING = 694;
+ VACUUM = 695;
+ VALID = 696;
+ VALIDATE = 697;
+ VALIDATOR = 698;
+ VALUE_P = 699;
+ VALUES = 700;
+ VARCHAR = 701;
+ VARIADIC = 702;
+ VARYING = 703;
+ VERBOSE = 704;
+ VERSION_P = 705;
+ VIEW = 706;
+ VIEWS = 707;
+ VOLATILE = 708;
+ WHEN = 709;
+ WHERE = 710;
+ WHITESPACE_P = 711;
+ WINDOW = 712;
+ WITH = 713;
+ WITHIN = 714;
+ WITHOUT = 715;
+ WORK = 716;
+ WRAPPER = 717;
+ WRITE = 718;
+ XML_P = 719;
+ XMLATTRIBUTES = 720;
+ XMLCONCAT = 721;
+ XMLELEMENT = 722;
+ XMLEXISTS = 723;
+ XMLFOREST = 724;
+ XMLNAMESPACES = 725;
+ XMLPARSE = 726;
+ XMLPI = 727;
+ XMLROOT = 728;
+ XMLSERIALIZE = 729;
+ XMLTABLE = 730;
+ YEAR_P = 731;
+ YES_P = 732;
+ ZONE = 733;
+ NOT_LA = 734;
+ NULLS_LA = 735;
+ WITH_LA = 736;
+ MODE_TYPE_NAME = 737;
+ MODE_PLPGSQL_EXPR = 738;
+ MODE_PLPGSQL_ASSIGN1 = 739;
+ MODE_PLPGSQL_ASSIGN2 = 740;
+ MODE_PLPGSQL_ASSIGN3 = 741;
+ UMINUS = 742;
+}
diff --git a/protos/15/pg_query.proto b/protos/15/pg_query.proto
new file mode 100644
index 00000000..f4dabe18
--- /dev/null
+++ b/protos/15/pg_query.proto
@@ -0,0 +1,3673 @@
+// This file is autogenerated by ./scripts/generate_protobuf_and_funcs.rb
+
+syntax = "proto3";
+
+package pg_query;
+
+message ParseResult {
+ int32 version = 1;
+ repeated RawStmt stmts = 2;
+}
+
+message ScanResult {
+ int32 version = 1;
+ repeated ScanToken tokens = 2;
+}
+
+message Node {
+ oneof node {
+ Alias alias = 1 [json_name="Alias"];
+ RangeVar range_var = 2 [json_name="RangeVar"];
+ TableFunc table_func = 3 [json_name="TableFunc"];
+ Var var = 4 [json_name="Var"];
+ Param param = 5 [json_name="Param"];
+ Aggref aggref = 6 [json_name="Aggref"];
+ GroupingFunc grouping_func = 7 [json_name="GroupingFunc"];
+ WindowFunc window_func = 8 [json_name="WindowFunc"];
+ SubscriptingRef subscripting_ref = 9 [json_name="SubscriptingRef"];
+ FuncExpr func_expr = 10 [json_name="FuncExpr"];
+ NamedArgExpr named_arg_expr = 11 [json_name="NamedArgExpr"];
+ OpExpr op_expr = 12 [json_name="OpExpr"];
+ DistinctExpr distinct_expr = 13 [json_name="DistinctExpr"];
+ NullIfExpr null_if_expr = 14 [json_name="NullIfExpr"];
+ ScalarArrayOpExpr scalar_array_op_expr = 15 [json_name="ScalarArrayOpExpr"];
+ BoolExpr bool_expr = 16 [json_name="BoolExpr"];
+ SubLink sub_link = 17 [json_name="SubLink"];
+ SubPlan sub_plan = 18 [json_name="SubPlan"];
+ AlternativeSubPlan alternative_sub_plan = 19 [json_name="AlternativeSubPlan"];
+ FieldSelect field_select = 20 [json_name="FieldSelect"];
+ FieldStore field_store = 21 [json_name="FieldStore"];
+ RelabelType relabel_type = 22 [json_name="RelabelType"];
+ CoerceViaIO coerce_via_io = 23 [json_name="CoerceViaIO"];
+ ArrayCoerceExpr array_coerce_expr = 24 [json_name="ArrayCoerceExpr"];
+ ConvertRowtypeExpr convert_rowtype_expr = 25 [json_name="ConvertRowtypeExpr"];
+ CollateExpr collate_expr = 26 [json_name="CollateExpr"];
+ CaseExpr case_expr = 27 [json_name="CaseExpr"];
+ CaseWhen case_when = 28 [json_name="CaseWhen"];
+ CaseTestExpr case_test_expr = 29 [json_name="CaseTestExpr"];
+ ArrayExpr array_expr = 30 [json_name="ArrayExpr"];
+ RowExpr row_expr = 31 [json_name="RowExpr"];
+ RowCompareExpr row_compare_expr = 32 [json_name="RowCompareExpr"];
+ CoalesceExpr coalesce_expr = 33 [json_name="CoalesceExpr"];
+ MinMaxExpr min_max_expr = 34 [json_name="MinMaxExpr"];
+ SQLValueFunction sqlvalue_function = 35 [json_name="SQLValueFunction"];
+ XmlExpr xml_expr = 36 [json_name="XmlExpr"];
+ NullTest null_test = 37 [json_name="NullTest"];
+ BooleanTest boolean_test = 38 [json_name="BooleanTest"];
+ CoerceToDomain coerce_to_domain = 39 [json_name="CoerceToDomain"];
+ CoerceToDomainValue coerce_to_domain_value = 40 [json_name="CoerceToDomainValue"];
+ SetToDefault set_to_default = 41 [json_name="SetToDefault"];
+ CurrentOfExpr current_of_expr = 42 [json_name="CurrentOfExpr"];
+ NextValueExpr next_value_expr = 43 [json_name="NextValueExpr"];
+ InferenceElem inference_elem = 44 [json_name="InferenceElem"];
+ TargetEntry target_entry = 45 [json_name="TargetEntry"];
+ RangeTblRef range_tbl_ref = 46 [json_name="RangeTblRef"];
+ JoinExpr join_expr = 47 [json_name="JoinExpr"];
+ FromExpr from_expr = 48 [json_name="FromExpr"];
+ OnConflictExpr on_conflict_expr = 49 [json_name="OnConflictExpr"];
+ IntoClause into_clause = 50 [json_name="IntoClause"];
+ MergeAction merge_action = 51 [json_name="MergeAction"];
+ RawStmt raw_stmt = 52 [json_name="RawStmt"];
+ Query query = 53 [json_name="Query"];
+ InsertStmt insert_stmt = 54 [json_name="InsertStmt"];
+ DeleteStmt delete_stmt = 55 [json_name="DeleteStmt"];
+ UpdateStmt update_stmt = 56 [json_name="UpdateStmt"];
+ MergeStmt merge_stmt = 57 [json_name="MergeStmt"];
+ SelectStmt select_stmt = 58 [json_name="SelectStmt"];
+ ReturnStmt return_stmt = 59 [json_name="ReturnStmt"];
+ PLAssignStmt plassign_stmt = 60 [json_name="PLAssignStmt"];
+ AlterTableStmt alter_table_stmt = 61 [json_name="AlterTableStmt"];
+ AlterTableCmd alter_table_cmd = 62 [json_name="AlterTableCmd"];
+ AlterDomainStmt alter_domain_stmt = 63 [json_name="AlterDomainStmt"];
+ SetOperationStmt set_operation_stmt = 64 [json_name="SetOperationStmt"];
+ GrantStmt grant_stmt = 65 [json_name="GrantStmt"];
+ GrantRoleStmt grant_role_stmt = 66 [json_name="GrantRoleStmt"];
+ AlterDefaultPrivilegesStmt alter_default_privileges_stmt = 67 [json_name="AlterDefaultPrivilegesStmt"];
+ ClosePortalStmt close_portal_stmt = 68 [json_name="ClosePortalStmt"];
+ ClusterStmt cluster_stmt = 69 [json_name="ClusterStmt"];
+ CopyStmt copy_stmt = 70 [json_name="CopyStmt"];
+ CreateStmt create_stmt = 71 [json_name="CreateStmt"];
+ DefineStmt define_stmt = 72 [json_name="DefineStmt"];
+ DropStmt drop_stmt = 73 [json_name="DropStmt"];
+ TruncateStmt truncate_stmt = 74 [json_name="TruncateStmt"];
+ CommentStmt comment_stmt = 75 [json_name="CommentStmt"];
+ FetchStmt fetch_stmt = 76 [json_name="FetchStmt"];
+ IndexStmt index_stmt = 77 [json_name="IndexStmt"];
+ CreateFunctionStmt create_function_stmt = 78 [json_name="CreateFunctionStmt"];
+ AlterFunctionStmt alter_function_stmt = 79 [json_name="AlterFunctionStmt"];
+ DoStmt do_stmt = 80 [json_name="DoStmt"];
+ RenameStmt rename_stmt = 81 [json_name="RenameStmt"];
+ RuleStmt rule_stmt = 82 [json_name="RuleStmt"];
+ NotifyStmt notify_stmt = 83 [json_name="NotifyStmt"];
+ ListenStmt listen_stmt = 84 [json_name="ListenStmt"];
+ UnlistenStmt unlisten_stmt = 85 [json_name="UnlistenStmt"];
+ TransactionStmt transaction_stmt = 86 [json_name="TransactionStmt"];
+ ViewStmt view_stmt = 87 [json_name="ViewStmt"];
+ LoadStmt load_stmt = 88 [json_name="LoadStmt"];
+ CreateDomainStmt create_domain_stmt = 89 [json_name="CreateDomainStmt"];
+ CreatedbStmt createdb_stmt = 90 [json_name="CreatedbStmt"];
+ DropdbStmt dropdb_stmt = 91 [json_name="DropdbStmt"];
+ VacuumStmt vacuum_stmt = 92 [json_name="VacuumStmt"];
+ ExplainStmt explain_stmt = 93 [json_name="ExplainStmt"];
+ CreateTableAsStmt create_table_as_stmt = 94 [json_name="CreateTableAsStmt"];
+ CreateSeqStmt create_seq_stmt = 95 [json_name="CreateSeqStmt"];
+ AlterSeqStmt alter_seq_stmt = 96 [json_name="AlterSeqStmt"];
+ VariableSetStmt variable_set_stmt = 97 [json_name="VariableSetStmt"];
+ VariableShowStmt variable_show_stmt = 98 [json_name="VariableShowStmt"];
+ DiscardStmt discard_stmt = 99 [json_name="DiscardStmt"];
+ CreateTrigStmt create_trig_stmt = 100 [json_name="CreateTrigStmt"];
+ CreatePLangStmt create_plang_stmt = 101 [json_name="CreatePLangStmt"];
+ CreateRoleStmt create_role_stmt = 102 [json_name="CreateRoleStmt"];
+ AlterRoleStmt alter_role_stmt = 103 [json_name="AlterRoleStmt"];
+ DropRoleStmt drop_role_stmt = 104 [json_name="DropRoleStmt"];
+ LockStmt lock_stmt = 105 [json_name="LockStmt"];
+ ConstraintsSetStmt constraints_set_stmt = 106 [json_name="ConstraintsSetStmt"];
+ ReindexStmt reindex_stmt = 107 [json_name="ReindexStmt"];
+ CheckPointStmt check_point_stmt = 108 [json_name="CheckPointStmt"];
+ CreateSchemaStmt create_schema_stmt = 109 [json_name="CreateSchemaStmt"];
+ AlterDatabaseStmt alter_database_stmt = 110 [json_name="AlterDatabaseStmt"];
+ AlterDatabaseRefreshCollStmt alter_database_refresh_coll_stmt = 111 [json_name="AlterDatabaseRefreshCollStmt"];
+ AlterDatabaseSetStmt alter_database_set_stmt = 112 [json_name="AlterDatabaseSetStmt"];
+ AlterRoleSetStmt alter_role_set_stmt = 113 [json_name="AlterRoleSetStmt"];
+ CreateConversionStmt create_conversion_stmt = 114 [json_name="CreateConversionStmt"];
+ CreateCastStmt create_cast_stmt = 115 [json_name="CreateCastStmt"];
+ CreateOpClassStmt create_op_class_stmt = 116 [json_name="CreateOpClassStmt"];
+ CreateOpFamilyStmt create_op_family_stmt = 117 [json_name="CreateOpFamilyStmt"];
+ AlterOpFamilyStmt alter_op_family_stmt = 118 [json_name="AlterOpFamilyStmt"];
+ PrepareStmt prepare_stmt = 119 [json_name="PrepareStmt"];
+ ExecuteStmt execute_stmt = 120 [json_name="ExecuteStmt"];
+ DeallocateStmt deallocate_stmt = 121 [json_name="DeallocateStmt"];
+ DeclareCursorStmt declare_cursor_stmt = 122 [json_name="DeclareCursorStmt"];
+ CreateTableSpaceStmt create_table_space_stmt = 123 [json_name="CreateTableSpaceStmt"];
+ DropTableSpaceStmt drop_table_space_stmt = 124 [json_name="DropTableSpaceStmt"];
+ AlterObjectDependsStmt alter_object_depends_stmt = 125 [json_name="AlterObjectDependsStmt"];
+ AlterObjectSchemaStmt alter_object_schema_stmt = 126 [json_name="AlterObjectSchemaStmt"];
+ AlterOwnerStmt alter_owner_stmt = 127 [json_name="AlterOwnerStmt"];
+ AlterOperatorStmt alter_operator_stmt = 128 [json_name="AlterOperatorStmt"];
+ AlterTypeStmt alter_type_stmt = 129 [json_name="AlterTypeStmt"];
+ DropOwnedStmt drop_owned_stmt = 130 [json_name="DropOwnedStmt"];
+ ReassignOwnedStmt reassign_owned_stmt = 131 [json_name="ReassignOwnedStmt"];
+ CompositeTypeStmt composite_type_stmt = 132 [json_name="CompositeTypeStmt"];
+ CreateEnumStmt create_enum_stmt = 133 [json_name="CreateEnumStmt"];
+ CreateRangeStmt create_range_stmt = 134 [json_name="CreateRangeStmt"];
+ AlterEnumStmt alter_enum_stmt = 135 [json_name="AlterEnumStmt"];
+ AlterTSDictionaryStmt alter_tsdictionary_stmt = 136 [json_name="AlterTSDictionaryStmt"];
+ AlterTSConfigurationStmt alter_tsconfiguration_stmt = 137 [json_name="AlterTSConfigurationStmt"];
+ CreateFdwStmt create_fdw_stmt = 138 [json_name="CreateFdwStmt"];
+ AlterFdwStmt alter_fdw_stmt = 139 [json_name="AlterFdwStmt"];
+ CreateForeignServerStmt create_foreign_server_stmt = 140 [json_name="CreateForeignServerStmt"];
+ AlterForeignServerStmt alter_foreign_server_stmt = 141 [json_name="AlterForeignServerStmt"];
+ CreateUserMappingStmt create_user_mapping_stmt = 142 [json_name="CreateUserMappingStmt"];
+ AlterUserMappingStmt alter_user_mapping_stmt = 143 [json_name="AlterUserMappingStmt"];
+ DropUserMappingStmt drop_user_mapping_stmt = 144 [json_name="DropUserMappingStmt"];
+ AlterTableSpaceOptionsStmt alter_table_space_options_stmt = 145 [json_name="AlterTableSpaceOptionsStmt"];
+ AlterTableMoveAllStmt alter_table_move_all_stmt = 146 [json_name="AlterTableMoveAllStmt"];
+ SecLabelStmt sec_label_stmt = 147 [json_name="SecLabelStmt"];
+ CreateForeignTableStmt create_foreign_table_stmt = 148 [json_name="CreateForeignTableStmt"];
+ ImportForeignSchemaStmt import_foreign_schema_stmt = 149 [json_name="ImportForeignSchemaStmt"];
+ CreateExtensionStmt create_extension_stmt = 150 [json_name="CreateExtensionStmt"];
+ AlterExtensionStmt alter_extension_stmt = 151 [json_name="AlterExtensionStmt"];
+ AlterExtensionContentsStmt alter_extension_contents_stmt = 152 [json_name="AlterExtensionContentsStmt"];
+ CreateEventTrigStmt create_event_trig_stmt = 153 [json_name="CreateEventTrigStmt"];
+ AlterEventTrigStmt alter_event_trig_stmt = 154 [json_name="AlterEventTrigStmt"];
+ RefreshMatViewStmt refresh_mat_view_stmt = 155 [json_name="RefreshMatViewStmt"];
+ ReplicaIdentityStmt replica_identity_stmt = 156 [json_name="ReplicaIdentityStmt"];
+ AlterSystemStmt alter_system_stmt = 157 [json_name="AlterSystemStmt"];
+ CreatePolicyStmt create_policy_stmt = 158 [json_name="CreatePolicyStmt"];
+ AlterPolicyStmt alter_policy_stmt = 159 [json_name="AlterPolicyStmt"];
+ CreateTransformStmt create_transform_stmt = 160 [json_name="CreateTransformStmt"];
+ CreateAmStmt create_am_stmt = 161 [json_name="CreateAmStmt"];
+ CreatePublicationStmt create_publication_stmt = 162 [json_name="CreatePublicationStmt"];
+ AlterPublicationStmt alter_publication_stmt = 163 [json_name="AlterPublicationStmt"];
+ CreateSubscriptionStmt create_subscription_stmt = 164 [json_name="CreateSubscriptionStmt"];
+ AlterSubscriptionStmt alter_subscription_stmt = 165 [json_name="AlterSubscriptionStmt"];
+ DropSubscriptionStmt drop_subscription_stmt = 166 [json_name="DropSubscriptionStmt"];
+ CreateStatsStmt create_stats_stmt = 167 [json_name="CreateStatsStmt"];
+ AlterCollationStmt alter_collation_stmt = 168 [json_name="AlterCollationStmt"];
+ CallStmt call_stmt = 169 [json_name="CallStmt"];
+ AlterStatsStmt alter_stats_stmt = 170 [json_name="AlterStatsStmt"];
+ A_Expr a_expr = 171 [json_name="A_Expr"];
+ ColumnRef column_ref = 172 [json_name="ColumnRef"];
+ ParamRef param_ref = 173 [json_name="ParamRef"];
+ FuncCall func_call = 174 [json_name="FuncCall"];
+ A_Star a_star = 175 [json_name="A_Star"];
+ A_Indices a_indices = 176 [json_name="A_Indices"];
+ A_Indirection a_indirection = 177 [json_name="A_Indirection"];
+ A_ArrayExpr a_array_expr = 178 [json_name="A_ArrayExpr"];
+ ResTarget res_target = 179 [json_name="ResTarget"];
+ MultiAssignRef multi_assign_ref = 180 [json_name="MultiAssignRef"];
+ TypeCast type_cast = 181 [json_name="TypeCast"];
+ CollateClause collate_clause = 182 [json_name="CollateClause"];
+ SortBy sort_by = 183 [json_name="SortBy"];
+ WindowDef window_def = 184 [json_name="WindowDef"];
+ RangeSubselect range_subselect = 185 [json_name="RangeSubselect"];
+ RangeFunction range_function = 186 [json_name="RangeFunction"];
+ RangeTableSample range_table_sample = 187 [json_name="RangeTableSample"];
+ RangeTableFunc range_table_func = 188 [json_name="RangeTableFunc"];
+ RangeTableFuncCol range_table_func_col = 189 [json_name="RangeTableFuncCol"];
+ TypeName type_name = 190 [json_name="TypeName"];
+ ColumnDef column_def = 191 [json_name="ColumnDef"];
+ IndexElem index_elem = 192 [json_name="IndexElem"];
+ StatsElem stats_elem = 193 [json_name="StatsElem"];
+ Constraint constraint = 194 [json_name="Constraint"];
+ DefElem def_elem = 195 [json_name="DefElem"];
+ RangeTblEntry range_tbl_entry = 196 [json_name="RangeTblEntry"];
+ RangeTblFunction range_tbl_function = 197 [json_name="RangeTblFunction"];
+ TableSampleClause table_sample_clause = 198 [json_name="TableSampleClause"];
+ WithCheckOption with_check_option = 199 [json_name="WithCheckOption"];
+ SortGroupClause sort_group_clause = 200 [json_name="SortGroupClause"];
+ GroupingSet grouping_set = 201 [json_name="GroupingSet"];
+ WindowClause window_clause = 202 [json_name="WindowClause"];
+ ObjectWithArgs object_with_args = 203 [json_name="ObjectWithArgs"];
+ AccessPriv access_priv = 204 [json_name="AccessPriv"];
+ CreateOpClassItem create_op_class_item = 205 [json_name="CreateOpClassItem"];
+ TableLikeClause table_like_clause = 206 [json_name="TableLikeClause"];
+ FunctionParameter function_parameter = 207 [json_name="FunctionParameter"];
+ LockingClause locking_clause = 208 [json_name="LockingClause"];
+ RowMarkClause row_mark_clause = 209 [json_name="RowMarkClause"];
+ XmlSerialize xml_serialize = 210 [json_name="XmlSerialize"];
+ WithClause with_clause = 211 [json_name="WithClause"];
+ InferClause infer_clause = 212 [json_name="InferClause"];
+ OnConflictClause on_conflict_clause = 213 [json_name="OnConflictClause"];
+ CTESearchClause ctesearch_clause = 214 [json_name="CTESearchClause"];
+ CTECycleClause ctecycle_clause = 215 [json_name="CTECycleClause"];
+ CommonTableExpr common_table_expr = 216 [json_name="CommonTableExpr"];
+ MergeWhenClause merge_when_clause = 217 [json_name="MergeWhenClause"];
+ RoleSpec role_spec = 218 [json_name="RoleSpec"];
+ TriggerTransition trigger_transition = 219 [json_name="TriggerTransition"];
+ PartitionElem partition_elem = 220 [json_name="PartitionElem"];
+ PartitionSpec partition_spec = 221 [json_name="PartitionSpec"];
+ PartitionBoundSpec partition_bound_spec = 222 [json_name="PartitionBoundSpec"];
+ PartitionRangeDatum partition_range_datum = 223 [json_name="PartitionRangeDatum"];
+ PartitionCmd partition_cmd = 224 [json_name="PartitionCmd"];
+ VacuumRelation vacuum_relation = 225 [json_name="VacuumRelation"];
+ PublicationObjSpec publication_obj_spec = 226 [json_name="PublicationObjSpec"];
+ PublicationTable publication_table = 227 [json_name="PublicationTable"];
+ InlineCodeBlock inline_code_block = 228 [json_name="InlineCodeBlock"];
+ CallContext call_context = 229 [json_name="CallContext"];
+ Integer integer = 230 [json_name="Integer"];
+ Float float = 231 [json_name="Float"];
+ Boolean boolean = 232 [json_name="Boolean"];
+ String string = 233 [json_name="String"];
+ BitString bit_string = 234 [json_name="BitString"];
+ List list = 235 [json_name="List"];
+ IntList int_list = 236 [json_name="IntList"];
+ OidList oid_list = 237 [json_name="OidList"];
+ A_Const a_const = 238 [json_name="A_Const"];
+ }
+}
+
+message Integer
+{
+ int32 ival = 1; /* machine integer */
+}
+
+message Float
+{
+ string fval = 1; /* string */
+}
+
+message Boolean
+{
+ bool boolval = 1;
+}
+
+message String
+{
+ string sval = 1; /* string */
+}
+
+message BitString
+{
+ string bsval = 1; /* string */
+}
+
+message List
+{
+ repeated Node items = 1;
+}
+
+message OidList
+{
+ repeated Node items = 1;
+}
+
+message IntList
+{
+ repeated Node items = 1;
+}
+
+message A_Const
+{
+ oneof val {
+ Integer ival = 1;
+ Float fval = 2;
+ Boolean boolval = 3;
+ String sval = 4;
+ BitString bsval = 5;
+ }
+ bool isnull = 10;
+ int32 location = 11;
+}
+
+message Alias
+{
+ string aliasname = 1 [json_name="aliasname"];
+ repeated Node colnames = 2 [json_name="colnames"];
+}
+
+message RangeVar
+{
+ string catalogname = 1 [json_name="catalogname"];
+ string schemaname = 2 [json_name="schemaname"];
+ string relname = 3 [json_name="relname"];
+ bool inh = 4 [json_name="inh"];
+ string relpersistence = 5 [json_name="relpersistence"];
+ Alias alias = 6 [json_name="alias"];
+ int32 location = 7 [json_name="location"];
+}
+
+message TableFunc
+{
+ repeated Node ns_uris = 1 [json_name="ns_uris"];
+ repeated Node ns_names = 2 [json_name="ns_names"];
+ Node docexpr = 3 [json_name="docexpr"];
+ Node rowexpr = 4 [json_name="rowexpr"];
+ repeated Node colnames = 5 [json_name="colnames"];
+ repeated Node coltypes = 6 [json_name="coltypes"];
+ repeated Node coltypmods = 7 [json_name="coltypmods"];
+ repeated Node colcollations = 8 [json_name="colcollations"];
+ repeated Node colexprs = 9 [json_name="colexprs"];
+ repeated Node coldefexprs = 10 [json_name="coldefexprs"];
+ repeated uint64 notnulls = 11 [json_name="notnulls"];
+ int32 ordinalitycol = 12 [json_name="ordinalitycol"];
+ int32 location = 13 [json_name="location"];
+}
+
+message Var
+{
+ Node xpr = 1 [json_name="xpr"];
+ int32 varno = 2 [json_name="varno"];
+ int32 varattno = 3 [json_name="varattno"];
+ uint32 vartype = 4 [json_name="vartype"];
+ int32 vartypmod = 5 [json_name="vartypmod"];
+ uint32 varcollid = 6 [json_name="varcollid"];
+ uint32 varlevelsup = 7 [json_name="varlevelsup"];
+ uint32 varnosyn = 8 [json_name="varnosyn"];
+ int32 varattnosyn = 9 [json_name="varattnosyn"];
+ int32 location = 10 [json_name="location"];
+}
+
+message Param
+{
+ Node xpr = 1 [json_name="xpr"];
+ ParamKind paramkind = 2 [json_name="paramkind"];
+ int32 paramid = 3 [json_name="paramid"];
+ uint32 paramtype = 4 [json_name="paramtype"];
+ int32 paramtypmod = 5 [json_name="paramtypmod"];
+ uint32 paramcollid = 6 [json_name="paramcollid"];
+ int32 location = 7 [json_name="location"];
+}
+
+message Aggref
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 aggfnoid = 2 [json_name="aggfnoid"];
+ uint32 aggtype = 3 [json_name="aggtype"];
+ uint32 aggcollid = 4 [json_name="aggcollid"];
+ uint32 inputcollid = 5 [json_name="inputcollid"];
+ uint32 aggtranstype = 6 [json_name="aggtranstype"];
+ repeated Node aggargtypes = 7 [json_name="aggargtypes"];
+ repeated Node aggdirectargs = 8 [json_name="aggdirectargs"];
+ repeated Node args = 9 [json_name="args"];
+ repeated Node aggorder = 10 [json_name="aggorder"];
+ repeated Node aggdistinct = 11 [json_name="aggdistinct"];
+ Node aggfilter = 12 [json_name="aggfilter"];
+ bool aggstar = 13 [json_name="aggstar"];
+ bool aggvariadic = 14 [json_name="aggvariadic"];
+ string aggkind = 15 [json_name="aggkind"];
+ uint32 agglevelsup = 16 [json_name="agglevelsup"];
+ AggSplit aggsplit = 17 [json_name="aggsplit"];
+ int32 aggno = 18 [json_name="aggno"];
+ int32 aggtransno = 19 [json_name="aggtransno"];
+ int32 location = 20 [json_name="location"];
+}
+
+message GroupingFunc
+{
+ Node xpr = 1 [json_name="xpr"];
+ repeated Node args = 2 [json_name="args"];
+ repeated Node refs = 3 [json_name="refs"];
+ repeated Node cols = 4 [json_name="cols"];
+ uint32 agglevelsup = 5 [json_name="agglevelsup"];
+ int32 location = 6 [json_name="location"];
+}
+
+message WindowFunc
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 winfnoid = 2 [json_name="winfnoid"];
+ uint32 wintype = 3 [json_name="wintype"];
+ uint32 wincollid = 4 [json_name="wincollid"];
+ uint32 inputcollid = 5 [json_name="inputcollid"];
+ repeated Node args = 6 [json_name="args"];
+ Node aggfilter = 7 [json_name="aggfilter"];
+ uint32 winref = 8 [json_name="winref"];
+ bool winstar = 9 [json_name="winstar"];
+ bool winagg = 10 [json_name="winagg"];
+ int32 location = 11 [json_name="location"];
+}
+
+message SubscriptingRef
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 refcontainertype = 2 [json_name="refcontainertype"];
+ uint32 refelemtype = 3 [json_name="refelemtype"];
+ uint32 refrestype = 4 [json_name="refrestype"];
+ int32 reftypmod = 5 [json_name="reftypmod"];
+ uint32 refcollid = 6 [json_name="refcollid"];
+ repeated Node refupperindexpr = 7 [json_name="refupperindexpr"];
+ repeated Node reflowerindexpr = 8 [json_name="reflowerindexpr"];
+ Node refexpr = 9 [json_name="refexpr"];
+ Node refassgnexpr = 10 [json_name="refassgnexpr"];
+}
+
+message FuncExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 funcid = 2 [json_name="funcid"];
+ uint32 funcresulttype = 3 [json_name="funcresulttype"];
+ bool funcretset = 4 [json_name="funcretset"];
+ bool funcvariadic = 5 [json_name="funcvariadic"];
+ CoercionForm funcformat = 6 [json_name="funcformat"];
+ uint32 funccollid = 7 [json_name="funccollid"];
+ uint32 inputcollid = 8 [json_name="inputcollid"];
+ repeated Node args = 9 [json_name="args"];
+ int32 location = 10 [json_name="location"];
+}
+
+message NamedArgExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ string name = 3 [json_name="name"];
+ int32 argnumber = 4 [json_name="argnumber"];
+ int32 location = 5 [json_name="location"];
+}
+
+message OpExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 opno = 2 [json_name="opno"];
+ uint32 opfuncid = 3 [json_name="opfuncid"];
+ uint32 opresulttype = 4 [json_name="opresulttype"];
+ bool opretset = 5 [json_name="opretset"];
+ uint32 opcollid = 6 [json_name="opcollid"];
+ uint32 inputcollid = 7 [json_name="inputcollid"];
+ repeated Node args = 8 [json_name="args"];
+ int32 location = 9 [json_name="location"];
+}
+
+message DistinctExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 opno = 2 [json_name="opno"];
+ uint32 opfuncid = 3 [json_name="opfuncid"];
+ uint32 opresulttype = 4 [json_name="opresulttype"];
+ bool opretset = 5 [json_name="opretset"];
+ uint32 opcollid = 6 [json_name="opcollid"];
+ uint32 inputcollid = 7 [json_name="inputcollid"];
+ repeated Node args = 8 [json_name="args"];
+ int32 location = 9 [json_name="location"];
+}
+
+message NullIfExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 opno = 2 [json_name="opno"];
+ uint32 opfuncid = 3 [json_name="opfuncid"];
+ uint32 opresulttype = 4 [json_name="opresulttype"];
+ bool opretset = 5 [json_name="opretset"];
+ uint32 opcollid = 6 [json_name="opcollid"];
+ uint32 inputcollid = 7 [json_name="inputcollid"];
+ repeated Node args = 8 [json_name="args"];
+ int32 location = 9 [json_name="location"];
+}
+
+message ScalarArrayOpExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 opno = 2 [json_name="opno"];
+ uint32 opfuncid = 3 [json_name="opfuncid"];
+ uint32 hashfuncid = 4 [json_name="hashfuncid"];
+ uint32 negfuncid = 5 [json_name="negfuncid"];
+ bool use_or = 6 [json_name="useOr"];
+ uint32 inputcollid = 7 [json_name="inputcollid"];
+ repeated Node args = 8 [json_name="args"];
+ int32 location = 9 [json_name="location"];
+}
+
+message BoolExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ BoolExprType boolop = 2 [json_name="boolop"];
+ repeated Node args = 3 [json_name="args"];
+ int32 location = 4 [json_name="location"];
+}
+
+message SubLink
+{
+ Node xpr = 1 [json_name="xpr"];
+ SubLinkType sub_link_type = 2 [json_name="subLinkType"];
+ int32 sub_link_id = 3 [json_name="subLinkId"];
+ Node testexpr = 4 [json_name="testexpr"];
+ repeated Node oper_name = 5 [json_name="operName"];
+ Node subselect = 6 [json_name="subselect"];
+ int32 location = 7 [json_name="location"];
+}
+
+message SubPlan
+{
+ Node xpr = 1 [json_name="xpr"];
+ SubLinkType sub_link_type = 2 [json_name="subLinkType"];
+ Node testexpr = 3 [json_name="testexpr"];
+ repeated Node param_ids = 4 [json_name="paramIds"];
+ int32 plan_id = 5 [json_name="plan_id"];
+ string plan_name = 6 [json_name="plan_name"];
+ uint32 first_col_type = 7 [json_name="firstColType"];
+ int32 first_col_typmod = 8 [json_name="firstColTypmod"];
+ uint32 first_col_collation = 9 [json_name="firstColCollation"];
+ bool use_hash_table = 10 [json_name="useHashTable"];
+ bool unknown_eq_false = 11 [json_name="unknownEqFalse"];
+ bool parallel_safe = 12 [json_name="parallel_safe"];
+ repeated Node set_param = 13 [json_name="setParam"];
+ repeated Node par_param = 14 [json_name="parParam"];
+ repeated Node args = 15 [json_name="args"];
+ double startup_cost = 16 [json_name="startup_cost"];
+ double per_call_cost = 17 [json_name="per_call_cost"];
+}
+
+message AlternativeSubPlan
+{
+ Node xpr = 1 [json_name="xpr"];
+ repeated Node subplans = 2 [json_name="subplans"];
+}
+
+message FieldSelect
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ int32 fieldnum = 3 [json_name="fieldnum"];
+ uint32 resulttype = 4 [json_name="resulttype"];
+ int32 resulttypmod = 5 [json_name="resulttypmod"];
+ uint32 resultcollid = 6 [json_name="resultcollid"];
+}
+
+message FieldStore
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ repeated Node newvals = 3 [json_name="newvals"];
+ repeated Node fieldnums = 4 [json_name="fieldnums"];
+ uint32 resulttype = 5 [json_name="resulttype"];
+}
+
+message RelabelType
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ uint32 resulttype = 3 [json_name="resulttype"];
+ int32 resulttypmod = 4 [json_name="resulttypmod"];
+ uint32 resultcollid = 5 [json_name="resultcollid"];
+ CoercionForm relabelformat = 6 [json_name="relabelformat"];
+ int32 location = 7 [json_name="location"];
+}
+
+message CoerceViaIO
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ uint32 resulttype = 3 [json_name="resulttype"];
+ uint32 resultcollid = 4 [json_name="resultcollid"];
+ CoercionForm coerceformat = 5 [json_name="coerceformat"];
+ int32 location = 6 [json_name="location"];
+}
+
+message ArrayCoerceExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ Node elemexpr = 3 [json_name="elemexpr"];
+ uint32 resulttype = 4 [json_name="resulttype"];
+ int32 resulttypmod = 5 [json_name="resulttypmod"];
+ uint32 resultcollid = 6 [json_name="resultcollid"];
+ CoercionForm coerceformat = 7 [json_name="coerceformat"];
+ int32 location = 8 [json_name="location"];
+}
+
+message ConvertRowtypeExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ uint32 resulttype = 3 [json_name="resulttype"];
+ CoercionForm convertformat = 4 [json_name="convertformat"];
+ int32 location = 5 [json_name="location"];
+}
+
+message CollateExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ uint32 coll_oid = 3 [json_name="collOid"];
+ int32 location = 4 [json_name="location"];
+}
+
+message CaseExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 casetype = 2 [json_name="casetype"];
+ uint32 casecollid = 3 [json_name="casecollid"];
+ Node arg = 4 [json_name="arg"];
+ repeated Node args = 5 [json_name="args"];
+ Node defresult = 6 [json_name="defresult"];
+ int32 location = 7 [json_name="location"];
+}
+
+message CaseWhen
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node expr = 2 [json_name="expr"];
+ Node result = 3 [json_name="result"];
+ int32 location = 4 [json_name="location"];
+}
+
+message CaseTestExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 type_id = 2 [json_name="typeId"];
+ int32 type_mod = 3 [json_name="typeMod"];
+ uint32 collation = 4 [json_name="collation"];
+}
+
+message ArrayExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 array_typeid = 2 [json_name="array_typeid"];
+ uint32 array_collid = 3 [json_name="array_collid"];
+ uint32 element_typeid = 4 [json_name="element_typeid"];
+ repeated Node elements = 5 [json_name="elements"];
+ bool multidims = 6 [json_name="multidims"];
+ int32 location = 7 [json_name="location"];
+}
+
+message RowExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ repeated Node args = 2 [json_name="args"];
+ uint32 row_typeid = 3 [json_name="row_typeid"];
+ CoercionForm row_format = 4 [json_name="row_format"];
+ repeated Node colnames = 5 [json_name="colnames"];
+ int32 location = 6 [json_name="location"];
+}
+
+message RowCompareExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ RowCompareType rctype = 2 [json_name="rctype"];
+ repeated Node opnos = 3 [json_name="opnos"];
+ repeated Node opfamilies = 4 [json_name="opfamilies"];
+ repeated Node inputcollids = 5 [json_name="inputcollids"];
+ repeated Node largs = 6 [json_name="largs"];
+ repeated Node rargs = 7 [json_name="rargs"];
+}
+
+message CoalesceExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 coalescetype = 2 [json_name="coalescetype"];
+ uint32 coalescecollid = 3 [json_name="coalescecollid"];
+ repeated Node args = 4 [json_name="args"];
+ int32 location = 5 [json_name="location"];
+}
+
+message MinMaxExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 minmaxtype = 2 [json_name="minmaxtype"];
+ uint32 minmaxcollid = 3 [json_name="minmaxcollid"];
+ uint32 inputcollid = 4 [json_name="inputcollid"];
+ MinMaxOp op = 5 [json_name="op"];
+ repeated Node args = 6 [json_name="args"];
+ int32 location = 7 [json_name="location"];
+}
+
+message SQLValueFunction
+{
+ Node xpr = 1 [json_name="xpr"];
+ SQLValueFunctionOp op = 2 [json_name="op"];
+ uint32 type = 3 [json_name="type"];
+ int32 typmod = 4 [json_name="typmod"];
+ int32 location = 5 [json_name="location"];
+}
+
+message XmlExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ XmlExprOp op = 2 [json_name="op"];
+ string name = 3 [json_name="name"];
+ repeated Node named_args = 4 [json_name="named_args"];
+ repeated Node arg_names = 5 [json_name="arg_names"];
+ repeated Node args = 6 [json_name="args"];
+ XmlOptionType xmloption = 7 [json_name="xmloption"];
+ uint32 type = 8 [json_name="type"];
+ int32 typmod = 9 [json_name="typmod"];
+ int32 location = 10 [json_name="location"];
+}
+
+message NullTest
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ NullTestType nulltesttype = 3 [json_name="nulltesttype"];
+ bool argisrow = 4 [json_name="argisrow"];
+ int32 location = 5 [json_name="location"];
+}
+
+message BooleanTest
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ BoolTestType booltesttype = 3 [json_name="booltesttype"];
+ int32 location = 4 [json_name="location"];
+}
+
+message CoerceToDomain
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ uint32 resulttype = 3 [json_name="resulttype"];
+ int32 resulttypmod = 4 [json_name="resulttypmod"];
+ uint32 resultcollid = 5 [json_name="resultcollid"];
+ CoercionForm coercionformat = 6 [json_name="coercionformat"];
+ int32 location = 7 [json_name="location"];
+}
+
+message CoerceToDomainValue
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 type_id = 2 [json_name="typeId"];
+ int32 type_mod = 3 [json_name="typeMod"];
+ uint32 collation = 4 [json_name="collation"];
+ int32 location = 5 [json_name="location"];
+}
+
+message SetToDefault
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 type_id = 2 [json_name="typeId"];
+ int32 type_mod = 3 [json_name="typeMod"];
+ uint32 collation = 4 [json_name="collation"];
+ int32 location = 5 [json_name="location"];
+}
+
+message CurrentOfExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 cvarno = 2 [json_name="cvarno"];
+ string cursor_name = 3 [json_name="cursor_name"];
+ int32 cursor_param = 4 [json_name="cursor_param"];
+}
+
+message NextValueExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 seqid = 2 [json_name="seqid"];
+ uint32 type_id = 3 [json_name="typeId"];
+}
+
+message InferenceElem
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node expr = 2 [json_name="expr"];
+ uint32 infercollid = 3 [json_name="infercollid"];
+ uint32 inferopclass = 4 [json_name="inferopclass"];
+}
+
+message TargetEntry
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node expr = 2 [json_name="expr"];
+ int32 resno = 3 [json_name="resno"];
+ string resname = 4 [json_name="resname"];
+ uint32 ressortgroupref = 5 [json_name="ressortgroupref"];
+ uint32 resorigtbl = 6 [json_name="resorigtbl"];
+ int32 resorigcol = 7 [json_name="resorigcol"];
+ bool resjunk = 8 [json_name="resjunk"];
+}
+
+message RangeTblRef
+{
+ int32 rtindex = 1 [json_name="rtindex"];
+}
+
+message JoinExpr
+{
+ JoinType jointype = 1 [json_name="jointype"];
+ bool is_natural = 2 [json_name="isNatural"];
+ Node larg = 3 [json_name="larg"];
+ Node rarg = 4 [json_name="rarg"];
+ repeated Node using_clause = 5 [json_name="usingClause"];
+ Alias join_using_alias = 6 [json_name="join_using_alias"];
+ Node quals = 7 [json_name="quals"];
+ Alias alias = 8 [json_name="alias"];
+ int32 rtindex = 9 [json_name="rtindex"];
+}
+
+message FromExpr
+{
+ repeated Node fromlist = 1 [json_name="fromlist"];
+ Node quals = 2 [json_name="quals"];
+}
+
+message OnConflictExpr
+{
+ OnConflictAction action = 1 [json_name="action"];
+ repeated Node arbiter_elems = 2 [json_name="arbiterElems"];
+ Node arbiter_where = 3 [json_name="arbiterWhere"];
+ uint32 constraint = 4 [json_name="constraint"];
+ repeated Node on_conflict_set = 5 [json_name="onConflictSet"];
+ Node on_conflict_where = 6 [json_name="onConflictWhere"];
+ int32 excl_rel_index = 7 [json_name="exclRelIndex"];
+ repeated Node excl_rel_tlist = 8 [json_name="exclRelTlist"];
+}
+
+message IntoClause
+{
+ RangeVar rel = 1 [json_name="rel"];
+ repeated Node col_names = 2 [json_name="colNames"];
+ string access_method = 3 [json_name="accessMethod"];
+ repeated Node options = 4 [json_name="options"];
+ OnCommitAction on_commit = 5 [json_name="onCommit"];
+ string table_space_name = 6 [json_name="tableSpaceName"];
+ Node view_query = 7 [json_name="viewQuery"];
+ bool skip_data = 8 [json_name="skipData"];
+}
+
+message MergeAction
+{
+ bool matched = 1 [json_name="matched"];
+ CmdType command_type = 2 [json_name="commandType"];
+ OverridingKind override = 3 [json_name="override"];
+ Node qual = 4 [json_name="qual"];
+ repeated Node target_list = 5 [json_name="targetList"];
+ repeated Node update_colnos = 6 [json_name="updateColnos"];
+}
+
+message RawStmt
+{
+ Node stmt = 1 [json_name="stmt"];
+ int32 stmt_location = 2 [json_name="stmt_location"];
+ int32 stmt_len = 3 [json_name="stmt_len"];
+}
+
+message Query
+{
+ CmdType command_type = 1 [json_name="commandType"];
+ QuerySource query_source = 2 [json_name="querySource"];
+ bool can_set_tag = 3 [json_name="canSetTag"];
+ Node utility_stmt = 4 [json_name="utilityStmt"];
+ int32 result_relation = 5 [json_name="resultRelation"];
+ bool has_aggs = 6 [json_name="hasAggs"];
+ bool has_window_funcs = 7 [json_name="hasWindowFuncs"];
+ bool has_target_srfs = 8 [json_name="hasTargetSRFs"];
+ bool has_sub_links = 9 [json_name="hasSubLinks"];
+ bool has_distinct_on = 10 [json_name="hasDistinctOn"];
+ bool has_recursive = 11 [json_name="hasRecursive"];
+ bool has_modifying_cte = 12 [json_name="hasModifyingCTE"];
+ bool has_for_update = 13 [json_name="hasForUpdate"];
+ bool has_row_security = 14 [json_name="hasRowSecurity"];
+ bool is_return = 15 [json_name="isReturn"];
+ repeated Node cte_list = 16 [json_name="cteList"];
+ repeated Node rtable = 17 [json_name="rtable"];
+ FromExpr jointree = 18 [json_name="jointree"];
+ repeated Node merge_action_list = 19 [json_name="mergeActionList"];
+ bool merge_use_outer_join = 20 [json_name="mergeUseOuterJoin"];
+ repeated Node target_list = 21 [json_name="targetList"];
+ OverridingKind override = 22 [json_name="override"];
+ OnConflictExpr on_conflict = 23 [json_name="onConflict"];
+ repeated Node returning_list = 24 [json_name="returningList"];
+ repeated Node group_clause = 25 [json_name="groupClause"];
+ bool group_distinct = 26 [json_name="groupDistinct"];
+ repeated Node grouping_sets = 27 [json_name="groupingSets"];
+ Node having_qual = 28 [json_name="havingQual"];
+ repeated Node window_clause = 29 [json_name="windowClause"];
+ repeated Node distinct_clause = 30 [json_name="distinctClause"];
+ repeated Node sort_clause = 31 [json_name="sortClause"];
+ Node limit_offset = 32 [json_name="limitOffset"];
+ Node limit_count = 33 [json_name="limitCount"];
+ LimitOption limit_option = 34 [json_name="limitOption"];
+ repeated Node row_marks = 35 [json_name="rowMarks"];
+ Node set_operations = 36 [json_name="setOperations"];
+ repeated Node constraint_deps = 37 [json_name="constraintDeps"];
+ repeated Node with_check_options = 38 [json_name="withCheckOptions"];
+ int32 stmt_location = 39 [json_name="stmt_location"];
+ int32 stmt_len = 40 [json_name="stmt_len"];
+}
+
+message InsertStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ repeated Node cols = 2 [json_name="cols"];
+ Node select_stmt = 3 [json_name="selectStmt"];
+ OnConflictClause on_conflict_clause = 4 [json_name="onConflictClause"];
+ repeated Node returning_list = 5 [json_name="returningList"];
+ WithClause with_clause = 6 [json_name="withClause"];
+ OverridingKind override = 7 [json_name="override"];
+}
+
+message DeleteStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ repeated Node using_clause = 2 [json_name="usingClause"];
+ Node where_clause = 3 [json_name="whereClause"];
+ repeated Node returning_list = 4 [json_name="returningList"];
+ WithClause with_clause = 5 [json_name="withClause"];
+}
+
+message UpdateStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ repeated Node target_list = 2 [json_name="targetList"];
+ Node where_clause = 3 [json_name="whereClause"];
+ repeated Node from_clause = 4 [json_name="fromClause"];
+ repeated Node returning_list = 5 [json_name="returningList"];
+ WithClause with_clause = 6 [json_name="withClause"];
+}
+
+message MergeStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ Node source_relation = 2 [json_name="sourceRelation"];
+ Node join_condition = 3 [json_name="joinCondition"];
+ repeated Node merge_when_clauses = 4 [json_name="mergeWhenClauses"];
+ WithClause with_clause = 5 [json_name="withClause"];
+}
+
+message SelectStmt
+{
+ repeated Node distinct_clause = 1 [json_name="distinctClause"];
+ IntoClause into_clause = 2 [json_name="intoClause"];
+ repeated Node target_list = 3 [json_name="targetList"];
+ repeated Node from_clause = 4 [json_name="fromClause"];
+ Node where_clause = 5 [json_name="whereClause"];
+ repeated Node group_clause = 6 [json_name="groupClause"];
+ bool group_distinct = 7 [json_name="groupDistinct"];
+ Node having_clause = 8 [json_name="havingClause"];
+ repeated Node window_clause = 9 [json_name="windowClause"];
+ repeated Node values_lists = 10 [json_name="valuesLists"];
+ repeated Node sort_clause = 11 [json_name="sortClause"];
+ Node limit_offset = 12 [json_name="limitOffset"];
+ Node limit_count = 13 [json_name="limitCount"];
+ LimitOption limit_option = 14 [json_name="limitOption"];
+ repeated Node locking_clause = 15 [json_name="lockingClause"];
+ WithClause with_clause = 16 [json_name="withClause"];
+ SetOperation op = 17 [json_name="op"];
+ bool all = 18 [json_name="all"];
+ SelectStmt larg = 19 [json_name="larg"];
+ SelectStmt rarg = 20 [json_name="rarg"];
+}
+
+message ReturnStmt
+{
+ Node returnval = 1 [json_name="returnval"];
+}
+
+message PLAssignStmt
+{
+ string name = 1 [json_name="name"];
+ repeated Node indirection = 2 [json_name="indirection"];
+ int32 nnames = 3 [json_name="nnames"];
+ SelectStmt val = 4 [json_name="val"];
+ int32 location = 5 [json_name="location"];
+}
+
+message AlterTableStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ repeated Node cmds = 2 [json_name="cmds"];
+ ObjectType objtype = 3 [json_name="objtype"];
+ bool missing_ok = 4 [json_name="missing_ok"];
+}
+
+message AlterTableCmd
+{
+ AlterTableType subtype = 1 [json_name="subtype"];
+ string name = 2 [json_name="name"];
+ int32 num = 3 [json_name="num"];
+ RoleSpec newowner = 4 [json_name="newowner"];
+ Node def = 5 [json_name="def"];
+ DropBehavior behavior = 6 [json_name="behavior"];
+ bool missing_ok = 7 [json_name="missing_ok"];
+ bool recurse = 8 [json_name="recurse"];
+}
+
+message AlterDomainStmt
+{
+ string subtype = 1 [json_name="subtype"];
+ repeated Node type_name = 2 [json_name="typeName"];
+ string name = 3 [json_name="name"];
+ Node def = 4 [json_name="def"];
+ DropBehavior behavior = 5 [json_name="behavior"];
+ bool missing_ok = 6 [json_name="missing_ok"];
+}
+
+message SetOperationStmt
+{
+ SetOperation op = 1 [json_name="op"];
+ bool all = 2 [json_name="all"];
+ Node larg = 3 [json_name="larg"];
+ Node rarg = 4 [json_name="rarg"];
+ repeated Node col_types = 5 [json_name="colTypes"];
+ repeated Node col_typmods = 6 [json_name="colTypmods"];
+ repeated Node col_collations = 7 [json_name="colCollations"];
+ repeated Node group_clauses = 8 [json_name="groupClauses"];
+}
+
+message GrantStmt
+{
+ bool is_grant = 1 [json_name="is_grant"];
+ GrantTargetType targtype = 2 [json_name="targtype"];
+ ObjectType objtype = 3 [json_name="objtype"];
+ repeated Node objects = 4 [json_name="objects"];
+ repeated Node privileges = 5 [json_name="privileges"];
+ repeated Node grantees = 6 [json_name="grantees"];
+ bool grant_option = 7 [json_name="grant_option"];
+ RoleSpec grantor = 8 [json_name="grantor"];
+ DropBehavior behavior = 9 [json_name="behavior"];
+}
+
+message GrantRoleStmt
+{
+ repeated Node granted_roles = 1 [json_name="granted_roles"];
+ repeated Node grantee_roles = 2 [json_name="grantee_roles"];
+ bool is_grant = 3 [json_name="is_grant"];
+ bool admin_opt = 4 [json_name="admin_opt"];
+ RoleSpec grantor = 5 [json_name="grantor"];
+ DropBehavior behavior = 6 [json_name="behavior"];
+}
+
+message AlterDefaultPrivilegesStmt
+{
+ repeated Node options = 1 [json_name="options"];
+ GrantStmt action = 2 [json_name="action"];
+}
+
+message ClosePortalStmt
+{
+ string portalname = 1 [json_name="portalname"];
+}
+
+message ClusterStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ string indexname = 2 [json_name="indexname"];
+ repeated Node params = 3 [json_name="params"];
+}
+
+message CopyStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ Node query = 2 [json_name="query"];
+ repeated Node attlist = 3 [json_name="attlist"];
+ bool is_from = 4 [json_name="is_from"];
+ bool is_program = 5 [json_name="is_program"];
+ string filename = 6 [json_name="filename"];
+ repeated Node options = 7 [json_name="options"];
+ Node where_clause = 8 [json_name="whereClause"];
+}
+
+message CreateStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ repeated Node table_elts = 2 [json_name="tableElts"];
+ repeated Node inh_relations = 3 [json_name="inhRelations"];
+ PartitionBoundSpec partbound = 4 [json_name="partbound"];
+ PartitionSpec partspec = 5 [json_name="partspec"];
+ TypeName of_typename = 6 [json_name="ofTypename"];
+ repeated Node constraints = 7 [json_name="constraints"];
+ repeated Node options = 8 [json_name="options"];
+ OnCommitAction oncommit = 9 [json_name="oncommit"];
+ string tablespacename = 10 [json_name="tablespacename"];
+ string access_method = 11 [json_name="accessMethod"];
+ bool if_not_exists = 12 [json_name="if_not_exists"];
+}
+
+message DefineStmt
+{
+ ObjectType kind = 1 [json_name="kind"];
+ bool oldstyle = 2 [json_name="oldstyle"];
+ repeated Node defnames = 3 [json_name="defnames"];
+ repeated Node args = 4 [json_name="args"];
+ repeated Node definition = 5 [json_name="definition"];
+ bool if_not_exists = 6 [json_name="if_not_exists"];
+ bool replace = 7 [json_name="replace"];
+}
+
+message DropStmt
+{
+ repeated Node objects = 1 [json_name="objects"];
+ ObjectType remove_type = 2 [json_name="removeType"];
+ DropBehavior behavior = 3 [json_name="behavior"];
+ bool missing_ok = 4 [json_name="missing_ok"];
+ bool concurrent = 5 [json_name="concurrent"];
+}
+
+message TruncateStmt
+{
+ repeated Node relations = 1 [json_name="relations"];
+ bool restart_seqs = 2 [json_name="restart_seqs"];
+ DropBehavior behavior = 3 [json_name="behavior"];
+}
+
+message CommentStmt
+{
+ ObjectType objtype = 1 [json_name="objtype"];
+ Node object = 2 [json_name="object"];
+ string comment = 3 [json_name="comment"];
+}
+
+message FetchStmt
+{
+ FetchDirection direction = 1 [json_name="direction"];
+ int64 how_many = 2 [json_name="howMany"];
+ string portalname = 3 [json_name="portalname"];
+ bool ismove = 4 [json_name="ismove"];
+}
+
+message IndexStmt
+{
+ string idxname = 1 [json_name="idxname"];
+ RangeVar relation = 2 [json_name="relation"];
+ string access_method = 3 [json_name="accessMethod"];
+ string table_space = 4 [json_name="tableSpace"];
+ repeated Node index_params = 5 [json_name="indexParams"];
+ repeated Node index_including_params = 6 [json_name="indexIncludingParams"];
+ repeated Node options = 7 [json_name="options"];
+ Node where_clause = 8 [json_name="whereClause"];
+ repeated Node exclude_op_names = 9 [json_name="excludeOpNames"];
+ string idxcomment = 10 [json_name="idxcomment"];
+ uint32 index_oid = 11 [json_name="indexOid"];
+ uint32 old_node = 12 [json_name="oldNode"];
+ uint32 old_create_subid = 13 [json_name="oldCreateSubid"];
+ uint32 old_first_relfilenode_subid = 14 [json_name="oldFirstRelfilenodeSubid"];
+ bool unique = 15 [json_name="unique"];
+ bool nulls_not_distinct = 16 [json_name="nulls_not_distinct"];
+ bool primary = 17 [json_name="primary"];
+ bool isconstraint = 18 [json_name="isconstraint"];
+ bool deferrable = 19 [json_name="deferrable"];
+ bool initdeferred = 20 [json_name="initdeferred"];
+ bool transformed = 21 [json_name="transformed"];
+ bool concurrent = 22 [json_name="concurrent"];
+ bool if_not_exists = 23 [json_name="if_not_exists"];
+ bool reset_default_tblspc = 24 [json_name="reset_default_tblspc"];
+}
+
+message CreateFunctionStmt
+{
+ bool is_procedure = 1 [json_name="is_procedure"];
+ bool replace = 2 [json_name="replace"];
+ repeated Node funcname = 3 [json_name="funcname"];
+ repeated Node parameters = 4 [json_name="parameters"];
+ TypeName return_type = 5 [json_name="returnType"];
+ repeated Node options = 6 [json_name="options"];
+ Node sql_body = 7 [json_name="sql_body"];
+}
+
+message AlterFunctionStmt
+{
+ ObjectType objtype = 1 [json_name="objtype"];
+ ObjectWithArgs func = 2 [json_name="func"];
+ repeated Node actions = 3 [json_name="actions"];
+}
+
+message DoStmt
+{
+ repeated Node args = 1 [json_name="args"];
+}
+
+message RenameStmt
+{
+ ObjectType rename_type = 1 [json_name="renameType"];
+ ObjectType relation_type = 2 [json_name="relationType"];
+ RangeVar relation = 3 [json_name="relation"];
+ Node object = 4 [json_name="object"];
+ string subname = 5 [json_name="subname"];
+ string newname = 6 [json_name="newname"];
+ DropBehavior behavior = 7 [json_name="behavior"];
+ bool missing_ok = 8 [json_name="missing_ok"];
+}
+
+message RuleStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ string rulename = 2 [json_name="rulename"];
+ Node where_clause = 3 [json_name="whereClause"];
+ CmdType event = 4 [json_name="event"];
+ bool instead = 5 [json_name="instead"];
+ repeated Node actions = 6 [json_name="actions"];
+ bool replace = 7 [json_name="replace"];
+}
+
+message NotifyStmt
+{
+ string conditionname = 1 [json_name="conditionname"];
+ string payload = 2 [json_name="payload"];
+}
+
+message ListenStmt
+{
+ string conditionname = 1 [json_name="conditionname"];
+}
+
+message UnlistenStmt
+{
+ string conditionname = 1 [json_name="conditionname"];
+}
+
+message TransactionStmt
+{
+ TransactionStmtKind kind = 1 [json_name="kind"];
+ repeated Node options = 2 [json_name="options"];
+ string savepoint_name = 3 [json_name="savepoint_name"];
+ string gid = 4 [json_name="gid"];
+ bool chain = 5 [json_name="chain"];
+}
+
+message ViewStmt
+{
+ RangeVar view = 1 [json_name="view"];
+ repeated Node aliases = 2 [json_name="aliases"];
+ Node query = 3 [json_name="query"];
+ bool replace = 4 [json_name="replace"];
+ repeated Node options = 5 [json_name="options"];
+ ViewCheckOption with_check_option = 6 [json_name="withCheckOption"];
+}
+
+message LoadStmt
+{
+ string filename = 1 [json_name="filename"];
+}
+
+message CreateDomainStmt
+{
+ repeated Node domainname = 1 [json_name="domainname"];
+ TypeName type_name = 2 [json_name="typeName"];
+ CollateClause coll_clause = 3 [json_name="collClause"];
+ repeated Node constraints = 4 [json_name="constraints"];
+}
+
+message CreatedbStmt
+{
+ string dbname = 1 [json_name="dbname"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message DropdbStmt
+{
+ string dbname = 1 [json_name="dbname"];
+ bool missing_ok = 2 [json_name="missing_ok"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message VacuumStmt
+{
+ repeated Node options = 1 [json_name="options"];
+ repeated Node rels = 2 [json_name="rels"];
+ bool is_vacuumcmd = 3 [json_name="is_vacuumcmd"];
+}
+
+message ExplainStmt
+{
+ Node query = 1 [json_name="query"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message CreateTableAsStmt
+{
+ Node query = 1 [json_name="query"];
+ IntoClause into = 2 [json_name="into"];
+ ObjectType objtype = 3 [json_name="objtype"];
+ bool is_select_into = 4 [json_name="is_select_into"];
+ bool if_not_exists = 5 [json_name="if_not_exists"];
+}
+
+message CreateSeqStmt
+{
+ RangeVar sequence = 1 [json_name="sequence"];
+ repeated Node options = 2 [json_name="options"];
+ uint32 owner_id = 3 [json_name="ownerId"];
+ bool for_identity = 4 [json_name="for_identity"];
+ bool if_not_exists = 5 [json_name="if_not_exists"];
+}
+
+message AlterSeqStmt
+{
+ RangeVar sequence = 1 [json_name="sequence"];
+ repeated Node options = 2 [json_name="options"];
+ bool for_identity = 3 [json_name="for_identity"];
+ bool missing_ok = 4 [json_name="missing_ok"];
+}
+
+message VariableSetStmt
+{
+ VariableSetKind kind = 1 [json_name="kind"];
+ string name = 2 [json_name="name"];
+ repeated Node args = 3 [json_name="args"];
+ bool is_local = 4 [json_name="is_local"];
+}
+
+message VariableShowStmt
+{
+ string name = 1 [json_name="name"];
+}
+
+message DiscardStmt
+{
+ DiscardMode target = 1 [json_name="target"];
+}
+
+message CreateTrigStmt
+{
+ bool replace = 1 [json_name="replace"];
+ bool isconstraint = 2 [json_name="isconstraint"];
+ string trigname = 3 [json_name="trigname"];
+ RangeVar relation = 4 [json_name="relation"];
+ repeated Node funcname = 5 [json_name="funcname"];
+ repeated Node args = 6 [json_name="args"];
+ bool row = 7 [json_name="row"];
+ int32 timing = 8 [json_name="timing"];
+ int32 events = 9 [json_name="events"];
+ repeated Node columns = 10 [json_name="columns"];
+ Node when_clause = 11 [json_name="whenClause"];
+ repeated Node transition_rels = 12 [json_name="transitionRels"];
+ bool deferrable = 13 [json_name="deferrable"];
+ bool initdeferred = 14 [json_name="initdeferred"];
+ RangeVar constrrel = 15 [json_name="constrrel"];
+}
+
+message CreatePLangStmt
+{
+ bool replace = 1 [json_name="replace"];
+ string plname = 2 [json_name="plname"];
+ repeated Node plhandler = 3 [json_name="plhandler"];
+ repeated Node plinline = 4 [json_name="plinline"];
+ repeated Node plvalidator = 5 [json_name="plvalidator"];
+ bool pltrusted = 6 [json_name="pltrusted"];
+}
+
+message CreateRoleStmt
+{
+ RoleStmtType stmt_type = 1 [json_name="stmt_type"];
+ string role = 2 [json_name="role"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message AlterRoleStmt
+{
+ RoleSpec role = 1 [json_name="role"];
+ repeated Node options = 2 [json_name="options"];
+ int32 action = 3 [json_name="action"];
+}
+
+message DropRoleStmt
+{
+ repeated Node roles = 1 [json_name="roles"];
+ bool missing_ok = 2 [json_name="missing_ok"];
+}
+
+message LockStmt
+{
+ repeated Node relations = 1 [json_name="relations"];
+ int32 mode = 2 [json_name="mode"];
+ bool nowait = 3 [json_name="nowait"];
+}
+
+message ConstraintsSetStmt
+{
+ repeated Node constraints = 1 [json_name="constraints"];
+ bool deferred = 2 [json_name="deferred"];
+}
+
+message ReindexStmt
+{
+ ReindexObjectType kind = 1 [json_name="kind"];
+ RangeVar relation = 2 [json_name="relation"];
+ string name = 3 [json_name="name"];
+ repeated Node params = 4 [json_name="params"];
+}
+
+message CheckPointStmt
+{
+}
+
+message CreateSchemaStmt
+{
+ string schemaname = 1 [json_name="schemaname"];
+ RoleSpec authrole = 2 [json_name="authrole"];
+ repeated Node schema_elts = 3 [json_name="schemaElts"];
+ bool if_not_exists = 4 [json_name="if_not_exists"];
+}
+
+message AlterDatabaseStmt
+{
+ string dbname = 1 [json_name="dbname"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message AlterDatabaseRefreshCollStmt
+{
+ string dbname = 1 [json_name="dbname"];
+}
+
+message AlterDatabaseSetStmt
+{
+ string dbname = 1 [json_name="dbname"];
+ VariableSetStmt setstmt = 2 [json_name="setstmt"];
+}
+
+message AlterRoleSetStmt
+{
+ RoleSpec role = 1 [json_name="role"];
+ string database = 2 [json_name="database"];
+ VariableSetStmt setstmt = 3 [json_name="setstmt"];
+}
+
+message CreateConversionStmt
+{
+ repeated Node conversion_name = 1 [json_name="conversion_name"];
+ string for_encoding_name = 2 [json_name="for_encoding_name"];
+ string to_encoding_name = 3 [json_name="to_encoding_name"];
+ repeated Node func_name = 4 [json_name="func_name"];
+ bool def = 5 [json_name="def"];
+}
+
+message CreateCastStmt
+{
+ TypeName sourcetype = 1 [json_name="sourcetype"];
+ TypeName targettype = 2 [json_name="targettype"];
+ ObjectWithArgs func = 3 [json_name="func"];
+ CoercionContext context = 4 [json_name="context"];
+ bool inout = 5 [json_name="inout"];
+}
+
+message CreateOpClassStmt
+{
+ repeated Node opclassname = 1 [json_name="opclassname"];
+ repeated Node opfamilyname = 2 [json_name="opfamilyname"];
+ string amname = 3 [json_name="amname"];
+ TypeName datatype = 4 [json_name="datatype"];
+ repeated Node items = 5 [json_name="items"];
+ bool is_default = 6 [json_name="isDefault"];
+}
+
+message CreateOpFamilyStmt
+{
+ repeated Node opfamilyname = 1 [json_name="opfamilyname"];
+ string amname = 2 [json_name="amname"];
+}
+
+message AlterOpFamilyStmt
+{
+ repeated Node opfamilyname = 1 [json_name="opfamilyname"];
+ string amname = 2 [json_name="amname"];
+ bool is_drop = 3 [json_name="isDrop"];
+ repeated Node items = 4 [json_name="items"];
+}
+
+message PrepareStmt
+{
+ string name = 1 [json_name="name"];
+ repeated Node argtypes = 2 [json_name="argtypes"];
+ Node query = 3 [json_name="query"];
+}
+
+message ExecuteStmt
+{
+ string name = 1 [json_name="name"];
+ repeated Node params = 2 [json_name="params"];
+}
+
+message DeallocateStmt
+{
+ string name = 1 [json_name="name"];
+}
+
+message DeclareCursorStmt
+{
+ string portalname = 1 [json_name="portalname"];
+ int32 options = 2 [json_name="options"];
+ Node query = 3 [json_name="query"];
+}
+
+message CreateTableSpaceStmt
+{
+ string tablespacename = 1 [json_name="tablespacename"];
+ RoleSpec owner = 2 [json_name="owner"];
+ string location = 3 [json_name="location"];
+ repeated Node options = 4 [json_name="options"];
+}
+
+message DropTableSpaceStmt
+{
+ string tablespacename = 1 [json_name="tablespacename"];
+ bool missing_ok = 2 [json_name="missing_ok"];
+}
+
+message AlterObjectDependsStmt
+{
+ ObjectType object_type = 1 [json_name="objectType"];
+ RangeVar relation = 2 [json_name="relation"];
+ Node object = 3 [json_name="object"];
+ String extname = 4 [json_name="extname"];
+ bool remove = 5 [json_name="remove"];
+}
+
+message AlterObjectSchemaStmt
+{
+ ObjectType object_type = 1 [json_name="objectType"];
+ RangeVar relation = 2 [json_name="relation"];
+ Node object = 3 [json_name="object"];
+ string newschema = 4 [json_name="newschema"];
+ bool missing_ok = 5 [json_name="missing_ok"];
+}
+
+message AlterOwnerStmt
+{
+ ObjectType object_type = 1 [json_name="objectType"];
+ RangeVar relation = 2 [json_name="relation"];
+ Node object = 3 [json_name="object"];
+ RoleSpec newowner = 4 [json_name="newowner"];
+}
+
+message AlterOperatorStmt
+{
+ ObjectWithArgs opername = 1 [json_name="opername"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message AlterTypeStmt
+{
+ repeated Node type_name = 1 [json_name="typeName"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message DropOwnedStmt
+{
+ repeated Node roles = 1 [json_name="roles"];
+ DropBehavior behavior = 2 [json_name="behavior"];
+}
+
+message ReassignOwnedStmt
+{
+ repeated Node roles = 1 [json_name="roles"];
+ RoleSpec newrole = 2 [json_name="newrole"];
+}
+
+message CompositeTypeStmt
+{
+ RangeVar typevar = 1 [json_name="typevar"];
+ repeated Node coldeflist = 2 [json_name="coldeflist"];
+}
+
+message CreateEnumStmt
+{
+ repeated Node type_name = 1 [json_name="typeName"];
+ repeated Node vals = 2 [json_name="vals"];
+}
+
+message CreateRangeStmt
+{
+ repeated Node type_name = 1 [json_name="typeName"];
+ repeated Node params = 2 [json_name="params"];
+}
+
+message AlterEnumStmt
+{
+ repeated Node type_name = 1 [json_name="typeName"];
+ string old_val = 2 [json_name="oldVal"];
+ string new_val = 3 [json_name="newVal"];
+ string new_val_neighbor = 4 [json_name="newValNeighbor"];
+ bool new_val_is_after = 5 [json_name="newValIsAfter"];
+ bool skip_if_new_val_exists = 6 [json_name="skipIfNewValExists"];
+}
+
+message AlterTSDictionaryStmt
+{
+ repeated Node dictname = 1 [json_name="dictname"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message AlterTSConfigurationStmt
+{
+ AlterTSConfigType kind = 1 [json_name="kind"];
+ repeated Node cfgname = 2 [json_name="cfgname"];
+ repeated Node tokentype = 3 [json_name="tokentype"];
+ repeated Node dicts = 4 [json_name="dicts"];
+ bool override = 5 [json_name="override"];
+ bool replace = 6 [json_name="replace"];
+ bool missing_ok = 7 [json_name="missing_ok"];
+}
+
+message CreateFdwStmt
+{
+ string fdwname = 1 [json_name="fdwname"];
+ repeated Node func_options = 2 [json_name="func_options"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message AlterFdwStmt
+{
+ string fdwname = 1 [json_name="fdwname"];
+ repeated Node func_options = 2 [json_name="func_options"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message CreateForeignServerStmt
+{
+ string servername = 1 [json_name="servername"];
+ string servertype = 2 [json_name="servertype"];
+ string version = 3 [json_name="version"];
+ string fdwname = 4 [json_name="fdwname"];
+ bool if_not_exists = 5 [json_name="if_not_exists"];
+ repeated Node options = 6 [json_name="options"];
+}
+
+message AlterForeignServerStmt
+{
+ string servername = 1 [json_name="servername"];
+ string version = 2 [json_name="version"];
+ repeated Node options = 3 [json_name="options"];
+ bool has_version = 4 [json_name="has_version"];
+}
+
+message CreateUserMappingStmt
+{
+ RoleSpec user = 1 [json_name="user"];
+ string servername = 2 [json_name="servername"];
+ bool if_not_exists = 3 [json_name="if_not_exists"];
+ repeated Node options = 4 [json_name="options"];
+}
+
+message AlterUserMappingStmt
+{
+ RoleSpec user = 1 [json_name="user"];
+ string servername = 2 [json_name="servername"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message DropUserMappingStmt
+{
+ RoleSpec user = 1 [json_name="user"];
+ string servername = 2 [json_name="servername"];
+ bool missing_ok = 3 [json_name="missing_ok"];
+}
+
+message AlterTableSpaceOptionsStmt
+{
+ string tablespacename = 1 [json_name="tablespacename"];
+ repeated Node options = 2 [json_name="options"];
+ bool is_reset = 3 [json_name="isReset"];
+}
+
+message AlterTableMoveAllStmt
+{
+ string orig_tablespacename = 1 [json_name="orig_tablespacename"];
+ ObjectType objtype = 2 [json_name="objtype"];
+ repeated Node roles = 3 [json_name="roles"];
+ string new_tablespacename = 4 [json_name="new_tablespacename"];
+ bool nowait = 5 [json_name="nowait"];
+}
+
+message SecLabelStmt
+{
+ ObjectType objtype = 1 [json_name="objtype"];
+ Node object = 2 [json_name="object"];
+ string provider = 3 [json_name="provider"];
+ string label = 4 [json_name="label"];
+}
+
+message CreateForeignTableStmt
+{
+ CreateStmt base_stmt = 1 [json_name="base"];
+ string servername = 2 [json_name="servername"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message ImportForeignSchemaStmt
+{
+ string server_name = 1 [json_name="server_name"];
+ string remote_schema = 2 [json_name="remote_schema"];
+ string local_schema = 3 [json_name="local_schema"];
+ ImportForeignSchemaType list_type = 4 [json_name="list_type"];
+ repeated Node table_list = 5 [json_name="table_list"];
+ repeated Node options = 6 [json_name="options"];
+}
+
+message CreateExtensionStmt
+{
+ string extname = 1 [json_name="extname"];
+ bool if_not_exists = 2 [json_name="if_not_exists"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message AlterExtensionStmt
+{
+ string extname = 1 [json_name="extname"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message AlterExtensionContentsStmt
+{
+ string extname = 1 [json_name="extname"];
+ int32 action = 2 [json_name="action"];
+ ObjectType objtype = 3 [json_name="objtype"];
+ Node object = 4 [json_name="object"];
+}
+
+message CreateEventTrigStmt
+{
+ string trigname = 1 [json_name="trigname"];
+ string eventname = 2 [json_name="eventname"];
+ repeated Node whenclause = 3 [json_name="whenclause"];
+ repeated Node funcname = 4 [json_name="funcname"];
+}
+
+message AlterEventTrigStmt
+{
+ string trigname = 1 [json_name="trigname"];
+ string tgenabled = 2 [json_name="tgenabled"];
+}
+
+message RefreshMatViewStmt
+{
+ bool concurrent = 1 [json_name="concurrent"];
+ bool skip_data = 2 [json_name="skipData"];
+ RangeVar relation = 3 [json_name="relation"];
+}
+
+message ReplicaIdentityStmt
+{
+ string identity_type = 1 [json_name="identity_type"];
+ string name = 2 [json_name="name"];
+}
+
+message AlterSystemStmt
+{
+ VariableSetStmt setstmt = 1 [json_name="setstmt"];
+}
+
+message CreatePolicyStmt
+{
+ string policy_name = 1 [json_name="policy_name"];
+ RangeVar table = 2 [json_name="table"];
+ string cmd_name = 3 [json_name="cmd_name"];
+ bool permissive = 4 [json_name="permissive"];
+ repeated Node roles = 5 [json_name="roles"];
+ Node qual = 6 [json_name="qual"];
+ Node with_check = 7 [json_name="with_check"];
+}
+
+message AlterPolicyStmt
+{
+ string policy_name = 1 [json_name="policy_name"];
+ RangeVar table = 2 [json_name="table"];
+ repeated Node roles = 3 [json_name="roles"];
+ Node qual = 4 [json_name="qual"];
+ Node with_check = 5 [json_name="with_check"];
+}
+
+message CreateTransformStmt
+{
+ bool replace = 1 [json_name="replace"];
+ TypeName type_name = 2 [json_name="type_name"];
+ string lang = 3 [json_name="lang"];
+ ObjectWithArgs fromsql = 4 [json_name="fromsql"];
+ ObjectWithArgs tosql = 5 [json_name="tosql"];
+}
+
+message CreateAmStmt
+{
+ string amname = 1 [json_name="amname"];
+ repeated Node handler_name = 2 [json_name="handler_name"];
+ string amtype = 3 [json_name="amtype"];
+}
+
+message CreatePublicationStmt
+{
+ string pubname = 1 [json_name="pubname"];
+ repeated Node options = 2 [json_name="options"];
+ repeated Node pubobjects = 3 [json_name="pubobjects"];
+ bool for_all_tables = 4 [json_name="for_all_tables"];
+}
+
+message AlterPublicationStmt
+{
+ string pubname = 1 [json_name="pubname"];
+ repeated Node options = 2 [json_name="options"];
+ repeated Node pubobjects = 3 [json_name="pubobjects"];
+ bool for_all_tables = 4 [json_name="for_all_tables"];
+ AlterPublicationAction action = 5 [json_name="action"];
+}
+
+message CreateSubscriptionStmt
+{
+ string subname = 1 [json_name="subname"];
+ string conninfo = 2 [json_name="conninfo"];
+ repeated Node publication = 3 [json_name="publication"];
+ repeated Node options = 4 [json_name="options"];
+}
+
+message AlterSubscriptionStmt
+{
+ AlterSubscriptionType kind = 1 [json_name="kind"];
+ string subname = 2 [json_name="subname"];
+ string conninfo = 3 [json_name="conninfo"];
+ repeated Node publication = 4 [json_name="publication"];
+ repeated Node options = 5 [json_name="options"];
+}
+
+message DropSubscriptionStmt
+{
+ string subname = 1 [json_name="subname"];
+ bool missing_ok = 2 [json_name="missing_ok"];
+ DropBehavior behavior = 3 [json_name="behavior"];
+}
+
+message CreateStatsStmt
+{
+ repeated Node defnames = 1 [json_name="defnames"];
+ repeated Node stat_types = 2 [json_name="stat_types"];
+ repeated Node exprs = 3 [json_name="exprs"];
+ repeated Node relations = 4 [json_name="relations"];
+ string stxcomment = 5 [json_name="stxcomment"];
+ bool transformed = 6 [json_name="transformed"];
+ bool if_not_exists = 7 [json_name="if_not_exists"];
+}
+
+message AlterCollationStmt
+{
+ repeated Node collname = 1 [json_name="collname"];
+}
+
+message CallStmt
+{
+ FuncCall funccall = 1 [json_name="funccall"];
+ FuncExpr funcexpr = 2 [json_name="funcexpr"];
+ repeated Node outargs = 3 [json_name="outargs"];
+}
+
+message AlterStatsStmt
+{
+ repeated Node defnames = 1 [json_name="defnames"];
+ int32 stxstattarget = 2 [json_name="stxstattarget"];
+ bool missing_ok = 3 [json_name="missing_ok"];
+}
+
+message A_Expr
+{
+ A_Expr_Kind kind = 1 [json_name="kind"];
+ repeated Node name = 2 [json_name="name"];
+ Node lexpr = 3 [json_name="lexpr"];
+ Node rexpr = 4 [json_name="rexpr"];
+ int32 location = 5 [json_name="location"];
+}
+
+message ColumnRef
+{
+ repeated Node fields = 1 [json_name="fields"];
+ int32 location = 2 [json_name="location"];
+}
+
+message ParamRef
+{
+ int32 number = 1 [json_name="number"];
+ int32 location = 2 [json_name="location"];
+}
+
+message FuncCall
+{
+ repeated Node funcname = 1 [json_name="funcname"];
+ repeated Node args = 2 [json_name="args"];
+ repeated Node agg_order = 3 [json_name="agg_order"];
+ Node agg_filter = 4 [json_name="agg_filter"];
+ WindowDef over = 5 [json_name="over"];
+ bool agg_within_group = 6 [json_name="agg_within_group"];
+ bool agg_star = 7 [json_name="agg_star"];
+ bool agg_distinct = 8 [json_name="agg_distinct"];
+ bool func_variadic = 9 [json_name="func_variadic"];
+ CoercionForm funcformat = 10 [json_name="funcformat"];
+ int32 location = 11 [json_name="location"];
+}
+
+message A_Star
+{
+}
+
+message A_Indices
+{
+ bool is_slice = 1 [json_name="is_slice"];
+ Node lidx = 2 [json_name="lidx"];
+ Node uidx = 3 [json_name="uidx"];
+}
+
+message A_Indirection
+{
+ Node arg = 1 [json_name="arg"];
+ repeated Node indirection = 2 [json_name="indirection"];
+}
+
+message A_ArrayExpr
+{
+ repeated Node elements = 1 [json_name="elements"];
+ int32 location = 2 [json_name="location"];
+}
+
+message ResTarget
+{
+ string name = 1 [json_name="name"];
+ repeated Node indirection = 2 [json_name="indirection"];
+ Node val = 3 [json_name="val"];
+ int32 location = 4 [json_name="location"];
+}
+
+message MultiAssignRef
+{
+ Node source = 1 [json_name="source"];
+ int32 colno = 2 [json_name="colno"];
+ int32 ncolumns = 3 [json_name="ncolumns"];
+}
+
+message TypeCast
+{
+ Node arg = 1 [json_name="arg"];
+ TypeName type_name = 2 [json_name="typeName"];
+ int32 location = 3 [json_name="location"];
+}
+
+message CollateClause
+{
+ Node arg = 1 [json_name="arg"];
+ repeated Node collname = 2 [json_name="collname"];
+ int32 location = 3 [json_name="location"];
+}
+
+message SortBy
+{
+ Node node = 1 [json_name="node"];
+ SortByDir sortby_dir = 2 [json_name="sortby_dir"];
+ SortByNulls sortby_nulls = 3 [json_name="sortby_nulls"];
+ repeated Node use_op = 4 [json_name="useOp"];
+ int32 location = 5 [json_name="location"];
+}
+
+message WindowDef
+{
+ string name = 1 [json_name="name"];
+ string refname = 2 [json_name="refname"];
+ repeated Node partition_clause = 3 [json_name="partitionClause"];
+ repeated Node order_clause = 4 [json_name="orderClause"];
+ int32 frame_options = 5 [json_name="frameOptions"];
+ Node start_offset = 6 [json_name="startOffset"];
+ Node end_offset = 7 [json_name="endOffset"];
+ int32 location = 8 [json_name="location"];
+}
+
+message RangeSubselect
+{
+ bool lateral = 1 [json_name="lateral"];
+ Node subquery = 2 [json_name="subquery"];
+ Alias alias = 3 [json_name="alias"];
+}
+
+message RangeFunction
+{
+ bool lateral = 1 [json_name="lateral"];
+ bool ordinality = 2 [json_name="ordinality"];
+ bool is_rowsfrom = 3 [json_name="is_rowsfrom"];
+ repeated Node functions = 4 [json_name="functions"];
+ Alias alias = 5 [json_name="alias"];
+ repeated Node coldeflist = 6 [json_name="coldeflist"];
+}
+
+message RangeTableSample
+{
+ Node relation = 1 [json_name="relation"];
+ repeated Node method = 2 [json_name="method"];
+ repeated Node args = 3 [json_name="args"];
+ Node repeatable = 4 [json_name="repeatable"];
+ int32 location = 5 [json_name="location"];
+}
+
+message RangeTableFunc
+{
+ bool lateral = 1 [json_name="lateral"];
+ Node docexpr = 2 [json_name="docexpr"];
+ Node rowexpr = 3 [json_name="rowexpr"];
+ repeated Node namespaces = 4 [json_name="namespaces"];
+ repeated Node columns = 5 [json_name="columns"];
+ Alias alias = 6 [json_name="alias"];
+ int32 location = 7 [json_name="location"];
+}
+
+message RangeTableFuncCol
+{
+ string colname = 1 [json_name="colname"];
+ TypeName type_name = 2 [json_name="typeName"];
+ bool for_ordinality = 3 [json_name="for_ordinality"];
+ bool is_not_null = 4 [json_name="is_not_null"];
+ Node colexpr = 5 [json_name="colexpr"];
+ Node coldefexpr = 6 [json_name="coldefexpr"];
+ int32 location = 7 [json_name="location"];
+}
+
+message TypeName
+{
+ repeated Node names = 1 [json_name="names"];
+ uint32 type_oid = 2 [json_name="typeOid"];
+ bool setof = 3 [json_name="setof"];
+ bool pct_type = 4 [json_name="pct_type"];
+ repeated Node typmods = 5 [json_name="typmods"];
+ int32 typemod = 6 [json_name="typemod"];
+ repeated Node array_bounds = 7 [json_name="arrayBounds"];
+ int32 location = 8 [json_name="location"];
+}
+
+message ColumnDef
+{
+ string colname = 1 [json_name="colname"];
+ TypeName type_name = 2 [json_name="typeName"];
+ string compression = 3 [json_name="compression"];
+ int32 inhcount = 4 [json_name="inhcount"];
+ bool is_local = 5 [json_name="is_local"];
+ bool is_not_null = 6 [json_name="is_not_null"];
+ bool is_from_type = 7 [json_name="is_from_type"];
+ string storage = 8 [json_name="storage"];
+ Node raw_default = 9 [json_name="raw_default"];
+ Node cooked_default = 10 [json_name="cooked_default"];
+ string identity = 11 [json_name="identity"];
+ RangeVar identity_sequence = 12 [json_name="identitySequence"];
+ string generated = 13 [json_name="generated"];
+ CollateClause coll_clause = 14 [json_name="collClause"];
+ uint32 coll_oid = 15 [json_name="collOid"];
+ repeated Node constraints = 16 [json_name="constraints"];
+ repeated Node fdwoptions = 17 [json_name="fdwoptions"];
+ int32 location = 18 [json_name="location"];
+}
+
+message IndexElem
+{
+ string name = 1 [json_name="name"];
+ Node expr = 2 [json_name="expr"];
+ string indexcolname = 3 [json_name="indexcolname"];
+ repeated Node collation = 4 [json_name="collation"];
+ repeated Node opclass = 5 [json_name="opclass"];
+ repeated Node opclassopts = 6 [json_name="opclassopts"];
+ SortByDir ordering = 7 [json_name="ordering"];
+ SortByNulls nulls_ordering = 8 [json_name="nulls_ordering"];
+}
+
+message StatsElem
+{
+ string name = 1 [json_name="name"];
+ Node expr = 2 [json_name="expr"];
+}
+
+message Constraint
+{
+ ConstrType contype = 1 [json_name="contype"];
+ string conname = 2 [json_name="conname"];
+ bool deferrable = 3 [json_name="deferrable"];
+ bool initdeferred = 4 [json_name="initdeferred"];
+ int32 location = 5 [json_name="location"];
+ bool is_no_inherit = 6 [json_name="is_no_inherit"];
+ Node raw_expr = 7 [json_name="raw_expr"];
+ string cooked_expr = 8 [json_name="cooked_expr"];
+ string generated_when = 9 [json_name="generated_when"];
+ bool nulls_not_distinct = 10 [json_name="nulls_not_distinct"];
+ repeated Node keys = 11 [json_name="keys"];
+ repeated Node including = 12 [json_name="including"];
+ repeated Node exclusions = 13 [json_name="exclusions"];
+ repeated Node options = 14 [json_name="options"];
+ string indexname = 15 [json_name="indexname"];
+ string indexspace = 16 [json_name="indexspace"];
+ bool reset_default_tblspc = 17 [json_name="reset_default_tblspc"];
+ string access_method = 18 [json_name="access_method"];
+ Node where_clause = 19 [json_name="where_clause"];
+ RangeVar pktable = 20 [json_name="pktable"];
+ repeated Node fk_attrs = 21 [json_name="fk_attrs"];
+ repeated Node pk_attrs = 22 [json_name="pk_attrs"];
+ string fk_matchtype = 23 [json_name="fk_matchtype"];
+ string fk_upd_action = 24 [json_name="fk_upd_action"];
+ string fk_del_action = 25 [json_name="fk_del_action"];
+ repeated Node fk_del_set_cols = 26 [json_name="fk_del_set_cols"];
+ repeated Node old_conpfeqop = 27 [json_name="old_conpfeqop"];
+ uint32 old_pktable_oid = 28 [json_name="old_pktable_oid"];
+ bool skip_validation = 29 [json_name="skip_validation"];
+ bool initially_valid = 30 [json_name="initially_valid"];
+}
+
+message DefElem
+{
+ string defnamespace = 1 [json_name="defnamespace"];
+ string defname = 2 [json_name="defname"];
+ Node arg = 3 [json_name="arg"];
+ DefElemAction defaction = 4 [json_name="defaction"];
+ int32 location = 5 [json_name="location"];
+}
+
+message RangeTblEntry
+{
+ RTEKind rtekind = 1 [json_name="rtekind"];
+ uint32 relid = 2 [json_name="relid"];
+ string relkind = 3 [json_name="relkind"];
+ int32 rellockmode = 4 [json_name="rellockmode"];
+ TableSampleClause tablesample = 5 [json_name="tablesample"];
+ Query subquery = 6 [json_name="subquery"];
+ bool security_barrier = 7 [json_name="security_barrier"];
+ JoinType jointype = 8 [json_name="jointype"];
+ int32 joinmergedcols = 9 [json_name="joinmergedcols"];
+ repeated Node joinaliasvars = 10 [json_name="joinaliasvars"];
+ repeated Node joinleftcols = 11 [json_name="joinleftcols"];
+ repeated Node joinrightcols = 12 [json_name="joinrightcols"];
+ Alias join_using_alias = 13 [json_name="join_using_alias"];
+ repeated Node functions = 14 [json_name="functions"];
+ bool funcordinality = 15 [json_name="funcordinality"];
+ TableFunc tablefunc = 16 [json_name="tablefunc"];
+ repeated Node values_lists = 17 [json_name="values_lists"];
+ string ctename = 18 [json_name="ctename"];
+ uint32 ctelevelsup = 19 [json_name="ctelevelsup"];
+ bool self_reference = 20 [json_name="self_reference"];
+ repeated Node coltypes = 21 [json_name="coltypes"];
+ repeated Node coltypmods = 22 [json_name="coltypmods"];
+ repeated Node colcollations = 23 [json_name="colcollations"];
+ string enrname = 24 [json_name="enrname"];
+ double enrtuples = 25 [json_name="enrtuples"];
+ Alias alias = 26 [json_name="alias"];
+ Alias eref = 27 [json_name="eref"];
+ bool lateral = 28 [json_name="lateral"];
+ bool inh = 29 [json_name="inh"];
+ bool in_from_cl = 30 [json_name="inFromCl"];
+ uint32 required_perms = 31 [json_name="requiredPerms"];
+ uint32 check_as_user = 32 [json_name="checkAsUser"];
+ repeated uint64 selected_cols = 33 [json_name="selectedCols"];
+ repeated uint64 inserted_cols = 34 [json_name="insertedCols"];
+ repeated uint64 updated_cols = 35 [json_name="updatedCols"];
+ repeated uint64 extra_updated_cols = 36 [json_name="extraUpdatedCols"];
+ repeated Node security_quals = 37 [json_name="securityQuals"];
+}
+
+message RangeTblFunction
+{
+ Node funcexpr = 1 [json_name="funcexpr"];
+ int32 funccolcount = 2 [json_name="funccolcount"];
+ repeated Node funccolnames = 3 [json_name="funccolnames"];
+ repeated Node funccoltypes = 4 [json_name="funccoltypes"];
+ repeated Node funccoltypmods = 5 [json_name="funccoltypmods"];
+ repeated Node funccolcollations = 6 [json_name="funccolcollations"];
+ repeated uint64 funcparams = 7 [json_name="funcparams"];
+}
+
+message TableSampleClause
+{
+ uint32 tsmhandler = 1 [json_name="tsmhandler"];
+ repeated Node args = 2 [json_name="args"];
+ Node repeatable = 3 [json_name="repeatable"];
+}
+
+message WithCheckOption
+{
+ WCOKind kind = 1 [json_name="kind"];
+ string relname = 2 [json_name="relname"];
+ string polname = 3 [json_name="polname"];
+ Node qual = 4 [json_name="qual"];
+ bool cascaded = 5 [json_name="cascaded"];
+}
+
+message SortGroupClause
+{
+ uint32 tle_sort_group_ref = 1 [json_name="tleSortGroupRef"];
+ uint32 eqop = 2 [json_name="eqop"];
+ uint32 sortop = 3 [json_name="sortop"];
+ bool nulls_first = 4 [json_name="nulls_first"];
+ bool hashable = 5 [json_name="hashable"];
+}
+
+message GroupingSet
+{
+ GroupingSetKind kind = 1 [json_name="kind"];
+ repeated Node content = 2 [json_name="content"];
+ int32 location = 3 [json_name="location"];
+}
+
+message WindowClause
+{
+ string name = 1 [json_name="name"];
+ string refname = 2 [json_name="refname"];
+ repeated Node partition_clause = 3 [json_name="partitionClause"];
+ repeated Node order_clause = 4 [json_name="orderClause"];
+ int32 frame_options = 5 [json_name="frameOptions"];
+ Node start_offset = 6 [json_name="startOffset"];
+ Node end_offset = 7 [json_name="endOffset"];
+ repeated Node run_condition = 8 [json_name="runCondition"];
+ uint32 start_in_range_func = 9 [json_name="startInRangeFunc"];
+ uint32 end_in_range_func = 10 [json_name="endInRangeFunc"];
+ uint32 in_range_coll = 11 [json_name="inRangeColl"];
+ bool in_range_asc = 12 [json_name="inRangeAsc"];
+ bool in_range_nulls_first = 13 [json_name="inRangeNullsFirst"];
+ uint32 winref = 14 [json_name="winref"];
+ bool copied_order = 15 [json_name="copiedOrder"];
+}
+
+message ObjectWithArgs
+{
+ repeated Node objname = 1 [json_name="objname"];
+ repeated Node objargs = 2 [json_name="objargs"];
+ repeated Node objfuncargs = 3 [json_name="objfuncargs"];
+ bool args_unspecified = 4 [json_name="args_unspecified"];
+}
+
+message AccessPriv
+{
+ string priv_name = 1 [json_name="priv_name"];
+ repeated Node cols = 2 [json_name="cols"];
+}
+
+message CreateOpClassItem
+{
+ int32 itemtype = 1 [json_name="itemtype"];
+ ObjectWithArgs name = 2 [json_name="name"];
+ int32 number = 3 [json_name="number"];
+ repeated Node order_family = 4 [json_name="order_family"];
+ repeated Node class_args = 5 [json_name="class_args"];
+ TypeName storedtype = 6 [json_name="storedtype"];
+}
+
+message TableLikeClause
+{
+ RangeVar relation = 1 [json_name="relation"];
+ uint32 options = 2 [json_name="options"];
+ uint32 relation_oid = 3 [json_name="relationOid"];
+}
+
+message FunctionParameter
+{
+ string name = 1 [json_name="name"];
+ TypeName arg_type = 2 [json_name="argType"];
+ FunctionParameterMode mode = 3 [json_name="mode"];
+ Node defexpr = 4 [json_name="defexpr"];
+}
+
+message LockingClause
+{
+ repeated Node locked_rels = 1 [json_name="lockedRels"];
+ LockClauseStrength strength = 2 [json_name="strength"];
+ LockWaitPolicy wait_policy = 3 [json_name="waitPolicy"];
+}
+
+message RowMarkClause
+{
+ uint32 rti = 1 [json_name="rti"];
+ LockClauseStrength strength = 2 [json_name="strength"];
+ LockWaitPolicy wait_policy = 3 [json_name="waitPolicy"];
+ bool pushed_down = 4 [json_name="pushedDown"];
+}
+
+message XmlSerialize
+{
+ XmlOptionType xmloption = 1 [json_name="xmloption"];
+ Node expr = 2 [json_name="expr"];
+ TypeName type_name = 3 [json_name="typeName"];
+ int32 location = 4 [json_name="location"];
+}
+
+message WithClause
+{
+ repeated Node ctes = 1 [json_name="ctes"];
+ bool recursive = 2 [json_name="recursive"];
+ int32 location = 3 [json_name="location"];
+}
+
+message InferClause
+{
+ repeated Node index_elems = 1 [json_name="indexElems"];
+ Node where_clause = 2 [json_name="whereClause"];
+ string conname = 3 [json_name="conname"];
+ int32 location = 4 [json_name="location"];
+}
+
+message OnConflictClause
+{
+ OnConflictAction action = 1 [json_name="action"];
+ InferClause infer = 2 [json_name="infer"];
+ repeated Node target_list = 3 [json_name="targetList"];
+ Node where_clause = 4 [json_name="whereClause"];
+ int32 location = 5 [json_name="location"];
+}
+
+message CTESearchClause
+{
+ repeated Node search_col_list = 1 [json_name="search_col_list"];
+ bool search_breadth_first = 2 [json_name="search_breadth_first"];
+ string search_seq_column = 3 [json_name="search_seq_column"];
+ int32 location = 4 [json_name="location"];
+}
+
+message CTECycleClause
+{
+ repeated Node cycle_col_list = 1 [json_name="cycle_col_list"];
+ string cycle_mark_column = 2 [json_name="cycle_mark_column"];
+ Node cycle_mark_value = 3 [json_name="cycle_mark_value"];
+ Node cycle_mark_default = 4 [json_name="cycle_mark_default"];
+ string cycle_path_column = 5 [json_name="cycle_path_column"];
+ int32 location = 6 [json_name="location"];
+ uint32 cycle_mark_type = 7 [json_name="cycle_mark_type"];
+ int32 cycle_mark_typmod = 8 [json_name="cycle_mark_typmod"];
+ uint32 cycle_mark_collation = 9 [json_name="cycle_mark_collation"];
+ uint32 cycle_mark_neop = 10 [json_name="cycle_mark_neop"];
+}
+
+message CommonTableExpr
+{
+ string ctename = 1 [json_name="ctename"];
+ repeated Node aliascolnames = 2 [json_name="aliascolnames"];
+ CTEMaterialize ctematerialized = 3 [json_name="ctematerialized"];
+ Node ctequery = 4 [json_name="ctequery"];
+ CTESearchClause search_clause = 5 [json_name="search_clause"];
+ CTECycleClause cycle_clause = 6 [json_name="cycle_clause"];
+ int32 location = 7 [json_name="location"];
+ bool cterecursive = 8 [json_name="cterecursive"];
+ int32 cterefcount = 9 [json_name="cterefcount"];
+ repeated Node ctecolnames = 10 [json_name="ctecolnames"];
+ repeated Node ctecoltypes = 11 [json_name="ctecoltypes"];
+ repeated Node ctecoltypmods = 12 [json_name="ctecoltypmods"];
+ repeated Node ctecolcollations = 13 [json_name="ctecolcollations"];
+}
+
+message MergeWhenClause
+{
+ bool matched = 1 [json_name="matched"];
+ CmdType command_type = 2 [json_name="commandType"];
+ OverridingKind override = 3 [json_name="override"];
+ Node condition = 4 [json_name="condition"];
+ repeated Node target_list = 5 [json_name="targetList"];
+ repeated Node values = 6 [json_name="values"];
+}
+
+message RoleSpec
+{
+ RoleSpecType roletype = 1 [json_name="roletype"];
+ string rolename = 2 [json_name="rolename"];
+ int32 location = 3 [json_name="location"];
+}
+
+message TriggerTransition
+{
+ string name = 1 [json_name="name"];
+ bool is_new = 2 [json_name="isNew"];
+ bool is_table = 3 [json_name="isTable"];
+}
+
+message PartitionElem
+{
+ string name = 1 [json_name="name"];
+ Node expr = 2 [json_name="expr"];
+ repeated Node collation = 3 [json_name="collation"];
+ repeated Node opclass = 4 [json_name="opclass"];
+ int32 location = 5 [json_name="location"];
+}
+
+message PartitionSpec
+{
+ string strategy = 1 [json_name="strategy"];
+ repeated Node part_params = 2 [json_name="partParams"];
+ int32 location = 3 [json_name="location"];
+}
+
+message PartitionBoundSpec
+{
+ string strategy = 1 [json_name="strategy"];
+ bool is_default = 2 [json_name="is_default"];
+ int32 modulus = 3 [json_name="modulus"];
+ int32 remainder = 4 [json_name="remainder"];
+ repeated Node listdatums = 5 [json_name="listdatums"];
+ repeated Node lowerdatums = 6 [json_name="lowerdatums"];
+ repeated Node upperdatums = 7 [json_name="upperdatums"];
+ int32 location = 8 [json_name="location"];
+}
+
+message PartitionRangeDatum
+{
+ PartitionRangeDatumKind kind = 1 [json_name="kind"];
+ Node value = 2 [json_name="value"];
+ int32 location = 3 [json_name="location"];
+}
+
+message PartitionCmd
+{
+ RangeVar name = 1 [json_name="name"];
+ PartitionBoundSpec bound = 2 [json_name="bound"];
+ bool concurrent = 3 [json_name="concurrent"];
+}
+
+message VacuumRelation
+{
+ RangeVar relation = 1 [json_name="relation"];
+ uint32 oid = 2 [json_name="oid"];
+ repeated Node va_cols = 3 [json_name="va_cols"];
+}
+
+message PublicationObjSpec
+{
+ PublicationObjSpecType pubobjtype = 1 [json_name="pubobjtype"];
+ string name = 2 [json_name="name"];
+ PublicationTable pubtable = 3 [json_name="pubtable"];
+ int32 location = 4 [json_name="location"];
+}
+
+message PublicationTable
+{
+ RangeVar relation = 1 [json_name="relation"];
+ Node where_clause = 2 [json_name="whereClause"];
+ repeated Node columns = 3 [json_name="columns"];
+}
+
+message InlineCodeBlock
+{
+ string source_text = 1 [json_name="source_text"];
+ uint32 lang_oid = 2 [json_name="langOid"];
+ bool lang_is_trusted = 3 [json_name="langIsTrusted"];
+ bool atomic = 4 [json_name="atomic"];
+}
+
+message CallContext
+{
+ bool atomic = 1 [json_name="atomic"];
+}
+
+enum OverridingKind
+{
+ OVERRIDING_KIND_UNDEFINED = 0;
+ OVERRIDING_NOT_SET = 1;
+ OVERRIDING_USER_VALUE = 2;
+ OVERRIDING_SYSTEM_VALUE = 3;
+}
+
+enum QuerySource
+{
+ QUERY_SOURCE_UNDEFINED = 0;
+ QSRC_ORIGINAL = 1;
+ QSRC_PARSER = 2;
+ QSRC_INSTEAD_RULE = 3;
+ QSRC_QUAL_INSTEAD_RULE = 4;
+ QSRC_NON_INSTEAD_RULE = 5;
+}
+
+enum SortByDir
+{
+ SORT_BY_DIR_UNDEFINED = 0;
+ SORTBY_DEFAULT = 1;
+ SORTBY_ASC = 2;
+ SORTBY_DESC = 3;
+ SORTBY_USING = 4;
+}
+
+enum SortByNulls
+{
+ SORT_BY_NULLS_UNDEFINED = 0;
+ SORTBY_NULLS_DEFAULT = 1;
+ SORTBY_NULLS_FIRST = 2;
+ SORTBY_NULLS_LAST = 3;
+}
+
+enum SetQuantifier
+{
+ SET_QUANTIFIER_UNDEFINED = 0;
+ SET_QUANTIFIER_DEFAULT = 1;
+ SET_QUANTIFIER_ALL = 2;
+ SET_QUANTIFIER_DISTINCT = 3;
+}
+
+enum A_Expr_Kind
+{
+ A_EXPR_KIND_UNDEFINED = 0;
+ AEXPR_OP = 1;
+ AEXPR_OP_ANY = 2;
+ AEXPR_OP_ALL = 3;
+ AEXPR_DISTINCT = 4;
+ AEXPR_NOT_DISTINCT = 5;
+ AEXPR_NULLIF = 6;
+ AEXPR_IN = 7;
+ AEXPR_LIKE = 8;
+ AEXPR_ILIKE = 9;
+ AEXPR_SIMILAR = 10;
+ AEXPR_BETWEEN = 11;
+ AEXPR_NOT_BETWEEN = 12;
+ AEXPR_BETWEEN_SYM = 13;
+ AEXPR_NOT_BETWEEN_SYM = 14;
+}
+
+enum RoleSpecType
+{
+ ROLE_SPEC_TYPE_UNDEFINED = 0;
+ ROLESPEC_CSTRING = 1;
+ ROLESPEC_CURRENT_ROLE = 2;
+ ROLESPEC_CURRENT_USER = 3;
+ ROLESPEC_SESSION_USER = 4;
+ ROLESPEC_PUBLIC = 5;
+}
+
+enum TableLikeOption
+{
+ TABLE_LIKE_OPTION_UNDEFINED = 0;
+ CREATE_TABLE_LIKE_COMMENTS = 1;
+ CREATE_TABLE_LIKE_COMPRESSION = 2;
+ CREATE_TABLE_LIKE_CONSTRAINTS = 3;
+ CREATE_TABLE_LIKE_DEFAULTS = 4;
+ CREATE_TABLE_LIKE_GENERATED = 5;
+ CREATE_TABLE_LIKE_IDENTITY = 6;
+ CREATE_TABLE_LIKE_INDEXES = 7;
+ CREATE_TABLE_LIKE_STATISTICS = 8;
+ CREATE_TABLE_LIKE_STORAGE = 9;
+ CREATE_TABLE_LIKE_ALL = 10;
+}
+
+enum DefElemAction
+{
+ DEF_ELEM_ACTION_UNDEFINED = 0;
+ DEFELEM_UNSPEC = 1;
+ DEFELEM_SET = 2;
+ DEFELEM_ADD = 3;
+ DEFELEM_DROP = 4;
+}
+
+enum PartitionRangeDatumKind
+{
+ PARTITION_RANGE_DATUM_KIND_UNDEFINED = 0;
+ PARTITION_RANGE_DATUM_MINVALUE = 1;
+ PARTITION_RANGE_DATUM_VALUE = 2;
+ PARTITION_RANGE_DATUM_MAXVALUE = 3;
+}
+
+enum RTEKind
+{
+ RTEKIND_UNDEFINED = 0;
+ RTE_RELATION = 1;
+ RTE_SUBQUERY = 2;
+ RTE_JOIN = 3;
+ RTE_FUNCTION = 4;
+ RTE_TABLEFUNC = 5;
+ RTE_VALUES = 6;
+ RTE_CTE = 7;
+ RTE_NAMEDTUPLESTORE = 8;
+ RTE_RESULT = 9;
+}
+
+enum WCOKind
+{
+ WCOKIND_UNDEFINED = 0;
+ WCO_VIEW_CHECK = 1;
+ WCO_RLS_INSERT_CHECK = 2;
+ WCO_RLS_UPDATE_CHECK = 3;
+ WCO_RLS_CONFLICT_CHECK = 4;
+ WCO_RLS_MERGE_UPDATE_CHECK = 5;
+ WCO_RLS_MERGE_DELETE_CHECK = 6;
+}
+
+enum GroupingSetKind
+{
+ GROUPING_SET_KIND_UNDEFINED = 0;
+ GROUPING_SET_EMPTY = 1;
+ GROUPING_SET_SIMPLE = 2;
+ GROUPING_SET_ROLLUP = 3;
+ GROUPING_SET_CUBE = 4;
+ GROUPING_SET_SETS = 5;
+}
+
+enum CTEMaterialize
+{
+ CTEMATERIALIZE_UNDEFINED = 0;
+ CTEMaterializeDefault = 1;
+ CTEMaterializeAlways = 2;
+ CTEMaterializeNever = 3;
+}
+
+enum SetOperation
+{
+ SET_OPERATION_UNDEFINED = 0;
+ SETOP_NONE = 1;
+ SETOP_UNION = 2;
+ SETOP_INTERSECT = 3;
+ SETOP_EXCEPT = 4;
+}
+
+enum ObjectType
+{
+ OBJECT_TYPE_UNDEFINED = 0;
+ OBJECT_ACCESS_METHOD = 1;
+ OBJECT_AGGREGATE = 2;
+ OBJECT_AMOP = 3;
+ OBJECT_AMPROC = 4;
+ OBJECT_ATTRIBUTE = 5;
+ OBJECT_CAST = 6;
+ OBJECT_COLUMN = 7;
+ OBJECT_COLLATION = 8;
+ OBJECT_CONVERSION = 9;
+ OBJECT_DATABASE = 10;
+ OBJECT_DEFAULT = 11;
+ OBJECT_DEFACL = 12;
+ OBJECT_DOMAIN = 13;
+ OBJECT_DOMCONSTRAINT = 14;
+ OBJECT_EVENT_TRIGGER = 15;
+ OBJECT_EXTENSION = 16;
+ OBJECT_FDW = 17;
+ OBJECT_FOREIGN_SERVER = 18;
+ OBJECT_FOREIGN_TABLE = 19;
+ OBJECT_FUNCTION = 20;
+ OBJECT_INDEX = 21;
+ OBJECT_LANGUAGE = 22;
+ OBJECT_LARGEOBJECT = 23;
+ OBJECT_MATVIEW = 24;
+ OBJECT_OPCLASS = 25;
+ OBJECT_OPERATOR = 26;
+ OBJECT_OPFAMILY = 27;
+ OBJECT_PARAMETER_ACL = 28;
+ OBJECT_POLICY = 29;
+ OBJECT_PROCEDURE = 30;
+ OBJECT_PUBLICATION = 31;
+ OBJECT_PUBLICATION_NAMESPACE = 32;
+ OBJECT_PUBLICATION_REL = 33;
+ OBJECT_ROLE = 34;
+ OBJECT_ROUTINE = 35;
+ OBJECT_RULE = 36;
+ OBJECT_SCHEMA = 37;
+ OBJECT_SEQUENCE = 38;
+ OBJECT_SUBSCRIPTION = 39;
+ OBJECT_STATISTIC_EXT = 40;
+ OBJECT_TABCONSTRAINT = 41;
+ OBJECT_TABLE = 42;
+ OBJECT_TABLESPACE = 43;
+ OBJECT_TRANSFORM = 44;
+ OBJECT_TRIGGER = 45;
+ OBJECT_TSCONFIGURATION = 46;
+ OBJECT_TSDICTIONARY = 47;
+ OBJECT_TSPARSER = 48;
+ OBJECT_TSTEMPLATE = 49;
+ OBJECT_TYPE = 50;
+ OBJECT_USER_MAPPING = 51;
+ OBJECT_VIEW = 52;
+}
+
+enum DropBehavior
+{
+ DROP_BEHAVIOR_UNDEFINED = 0;
+ DROP_RESTRICT = 1;
+ DROP_CASCADE = 2;
+}
+
+enum AlterTableType
+{
+ ALTER_TABLE_TYPE_UNDEFINED = 0;
+ AT_AddColumn = 1;
+ AT_AddColumnRecurse = 2;
+ AT_AddColumnToView = 3;
+ AT_ColumnDefault = 4;
+ AT_CookedColumnDefault = 5;
+ AT_DropNotNull = 6;
+ AT_SetNotNull = 7;
+ AT_DropExpression = 8;
+ AT_CheckNotNull = 9;
+ AT_SetStatistics = 10;
+ AT_SetOptions = 11;
+ AT_ResetOptions = 12;
+ AT_SetStorage = 13;
+ AT_SetCompression = 14;
+ AT_DropColumn = 15;
+ AT_DropColumnRecurse = 16;
+ AT_AddIndex = 17;
+ AT_ReAddIndex = 18;
+ AT_AddConstraint = 19;
+ AT_AddConstraintRecurse = 20;
+ AT_ReAddConstraint = 21;
+ AT_ReAddDomainConstraint = 22;
+ AT_AlterConstraint = 23;
+ AT_ValidateConstraint = 24;
+ AT_ValidateConstraintRecurse = 25;
+ AT_AddIndexConstraint = 26;
+ AT_DropConstraint = 27;
+ AT_DropConstraintRecurse = 28;
+ AT_ReAddComment = 29;
+ AT_AlterColumnType = 30;
+ AT_AlterColumnGenericOptions = 31;
+ AT_ChangeOwner = 32;
+ AT_ClusterOn = 33;
+ AT_DropCluster = 34;
+ AT_SetLogged = 35;
+ AT_SetUnLogged = 36;
+ AT_DropOids = 37;
+ AT_SetAccessMethod = 38;
+ AT_SetTableSpace = 39;
+ AT_SetRelOptions = 40;
+ AT_ResetRelOptions = 41;
+ AT_ReplaceRelOptions = 42;
+ AT_EnableTrig = 43;
+ AT_EnableAlwaysTrig = 44;
+ AT_EnableReplicaTrig = 45;
+ AT_DisableTrig = 46;
+ AT_EnableTrigAll = 47;
+ AT_DisableTrigAll = 48;
+ AT_EnableTrigUser = 49;
+ AT_DisableTrigUser = 50;
+ AT_EnableRule = 51;
+ AT_EnableAlwaysRule = 52;
+ AT_EnableReplicaRule = 53;
+ AT_DisableRule = 54;
+ AT_AddInherit = 55;
+ AT_DropInherit = 56;
+ AT_AddOf = 57;
+ AT_DropOf = 58;
+ AT_ReplicaIdentity = 59;
+ AT_EnableRowSecurity = 60;
+ AT_DisableRowSecurity = 61;
+ AT_ForceRowSecurity = 62;
+ AT_NoForceRowSecurity = 63;
+ AT_GenericOptions = 64;
+ AT_AttachPartition = 65;
+ AT_DetachPartition = 66;
+ AT_DetachPartitionFinalize = 67;
+ AT_AddIdentity = 68;
+ AT_SetIdentity = 69;
+ AT_DropIdentity = 70;
+ AT_ReAddStatistics = 71;
+}
+
+enum GrantTargetType
+{
+ GRANT_TARGET_TYPE_UNDEFINED = 0;
+ ACL_TARGET_OBJECT = 1;
+ ACL_TARGET_ALL_IN_SCHEMA = 2;
+ ACL_TARGET_DEFAULTS = 3;
+}
+
+enum VariableSetKind
+{
+ VARIABLE_SET_KIND_UNDEFINED = 0;
+ VAR_SET_VALUE = 1;
+ VAR_SET_DEFAULT = 2;
+ VAR_SET_CURRENT = 3;
+ VAR_SET_MULTI = 4;
+ VAR_RESET = 5;
+ VAR_RESET_ALL = 6;
+}
+
+enum ConstrType
+{
+ CONSTR_TYPE_UNDEFINED = 0;
+ CONSTR_NULL = 1;
+ CONSTR_NOTNULL = 2;
+ CONSTR_DEFAULT = 3;
+ CONSTR_IDENTITY = 4;
+ CONSTR_GENERATED = 5;
+ CONSTR_CHECK = 6;
+ CONSTR_PRIMARY = 7;
+ CONSTR_UNIQUE = 8;
+ CONSTR_EXCLUSION = 9;
+ CONSTR_FOREIGN = 10;
+ CONSTR_ATTR_DEFERRABLE = 11;
+ CONSTR_ATTR_NOT_DEFERRABLE = 12;
+ CONSTR_ATTR_DEFERRED = 13;
+ CONSTR_ATTR_IMMEDIATE = 14;
+}
+
+enum ImportForeignSchemaType
+{
+ IMPORT_FOREIGN_SCHEMA_TYPE_UNDEFINED = 0;
+ FDW_IMPORT_SCHEMA_ALL = 1;
+ FDW_IMPORT_SCHEMA_LIMIT_TO = 2;
+ FDW_IMPORT_SCHEMA_EXCEPT = 3;
+}
+
+enum RoleStmtType
+{
+ ROLE_STMT_TYPE_UNDEFINED = 0;
+ ROLESTMT_ROLE = 1;
+ ROLESTMT_USER = 2;
+ ROLESTMT_GROUP = 3;
+}
+
+enum FetchDirection
+{
+ FETCH_DIRECTION_UNDEFINED = 0;
+ FETCH_FORWARD = 1;
+ FETCH_BACKWARD = 2;
+ FETCH_ABSOLUTE = 3;
+ FETCH_RELATIVE = 4;
+}
+
+enum FunctionParameterMode
+{
+ FUNCTION_PARAMETER_MODE_UNDEFINED = 0;
+ FUNC_PARAM_IN = 1;
+ FUNC_PARAM_OUT = 2;
+ FUNC_PARAM_INOUT = 3;
+ FUNC_PARAM_VARIADIC = 4;
+ FUNC_PARAM_TABLE = 5;
+ FUNC_PARAM_DEFAULT = 6;
+}
+
+enum TransactionStmtKind
+{
+ TRANSACTION_STMT_KIND_UNDEFINED = 0;
+ TRANS_STMT_BEGIN = 1;
+ TRANS_STMT_START = 2;
+ TRANS_STMT_COMMIT = 3;
+ TRANS_STMT_ROLLBACK = 4;
+ TRANS_STMT_SAVEPOINT = 5;
+ TRANS_STMT_RELEASE = 6;
+ TRANS_STMT_ROLLBACK_TO = 7;
+ TRANS_STMT_PREPARE = 8;
+ TRANS_STMT_COMMIT_PREPARED = 9;
+ TRANS_STMT_ROLLBACK_PREPARED = 10;
+}
+
+enum ViewCheckOption
+{
+ VIEW_CHECK_OPTION_UNDEFINED = 0;
+ NO_CHECK_OPTION = 1;
+ LOCAL_CHECK_OPTION = 2;
+ CASCADED_CHECK_OPTION = 3;
+}
+
+enum DiscardMode
+{
+ DISCARD_MODE_UNDEFINED = 0;
+ DISCARD_ALL = 1;
+ DISCARD_PLANS = 2;
+ DISCARD_SEQUENCES = 3;
+ DISCARD_TEMP = 4;
+}
+
+enum ReindexObjectType
+{
+ REINDEX_OBJECT_TYPE_UNDEFINED = 0;
+ REINDEX_OBJECT_INDEX = 1;
+ REINDEX_OBJECT_TABLE = 2;
+ REINDEX_OBJECT_SCHEMA = 3;
+ REINDEX_OBJECT_SYSTEM = 4;
+ REINDEX_OBJECT_DATABASE = 5;
+}
+
+enum AlterTSConfigType
+{
+ ALTER_TSCONFIG_TYPE_UNDEFINED = 0;
+ ALTER_TSCONFIG_ADD_MAPPING = 1;
+ ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN = 2;
+ ALTER_TSCONFIG_REPLACE_DICT = 3;
+ ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN = 4;
+ ALTER_TSCONFIG_DROP_MAPPING = 5;
+}
+
+enum PublicationObjSpecType
+{
+ PUBLICATION_OBJ_SPEC_TYPE_UNDEFINED = 0;
+ PUBLICATIONOBJ_TABLE = 1;
+ PUBLICATIONOBJ_TABLES_IN_SCHEMA = 2;
+ PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA = 3;
+ PUBLICATIONOBJ_CONTINUATION = 4;
+}
+
+enum AlterPublicationAction
+{
+ ALTER_PUBLICATION_ACTION_UNDEFINED = 0;
+ AP_AddObjects = 1;
+ AP_DropObjects = 2;
+ AP_SetObjects = 3;
+}
+
+enum AlterSubscriptionType
+{
+ ALTER_SUBSCRIPTION_TYPE_UNDEFINED = 0;
+ ALTER_SUBSCRIPTION_OPTIONS = 1;
+ ALTER_SUBSCRIPTION_CONNECTION = 2;
+ ALTER_SUBSCRIPTION_SET_PUBLICATION = 3;
+ ALTER_SUBSCRIPTION_ADD_PUBLICATION = 4;
+ ALTER_SUBSCRIPTION_DROP_PUBLICATION = 5;
+ ALTER_SUBSCRIPTION_REFRESH = 6;
+ ALTER_SUBSCRIPTION_ENABLED = 7;
+ ALTER_SUBSCRIPTION_SKIP = 8;
+}
+
+enum OnCommitAction
+{
+ ON_COMMIT_ACTION_UNDEFINED = 0;
+ ONCOMMIT_NOOP = 1;
+ ONCOMMIT_PRESERVE_ROWS = 2;
+ ONCOMMIT_DELETE_ROWS = 3;
+ ONCOMMIT_DROP = 4;
+}
+
+enum ParamKind
+{
+ PARAM_KIND_UNDEFINED = 0;
+ PARAM_EXTERN = 1;
+ PARAM_EXEC = 2;
+ PARAM_SUBLINK = 3;
+ PARAM_MULTIEXPR = 4;
+}
+
+enum CoercionContext
+{
+ COERCION_CONTEXT_UNDEFINED = 0;
+ COERCION_IMPLICIT = 1;
+ COERCION_ASSIGNMENT = 2;
+ COERCION_PLPGSQL = 3;
+ COERCION_EXPLICIT = 4;
+}
+
+enum CoercionForm
+{
+ COERCION_FORM_UNDEFINED = 0;
+ COERCE_EXPLICIT_CALL = 1;
+ COERCE_EXPLICIT_CAST = 2;
+ COERCE_IMPLICIT_CAST = 3;
+ COERCE_SQL_SYNTAX = 4;
+}
+
+enum BoolExprType
+{
+ BOOL_EXPR_TYPE_UNDEFINED = 0;
+ AND_EXPR = 1;
+ OR_EXPR = 2;
+ NOT_EXPR = 3;
+}
+
+enum SubLinkType
+{
+ SUB_LINK_TYPE_UNDEFINED = 0;
+ EXISTS_SUBLINK = 1;
+ ALL_SUBLINK = 2;
+ ANY_SUBLINK = 3;
+ ROWCOMPARE_SUBLINK = 4;
+ EXPR_SUBLINK = 5;
+ MULTIEXPR_SUBLINK = 6;
+ ARRAY_SUBLINK = 7;
+ CTE_SUBLINK = 8;
+}
+
+enum RowCompareType
+{
+ ROW_COMPARE_TYPE_UNDEFINED = 0;
+ ROWCOMPARE_LT = 1;
+ ROWCOMPARE_LE = 2;
+ ROWCOMPARE_EQ = 3;
+ ROWCOMPARE_GE = 4;
+ ROWCOMPARE_GT = 5;
+ ROWCOMPARE_NE = 6;
+}
+
+enum MinMaxOp
+{
+ MIN_MAX_OP_UNDEFINED = 0;
+ IS_GREATEST = 1;
+ IS_LEAST = 2;
+}
+
+enum SQLValueFunctionOp
+{
+ SQLVALUE_FUNCTION_OP_UNDEFINED = 0;
+ SVFOP_CURRENT_DATE = 1;
+ SVFOP_CURRENT_TIME = 2;
+ SVFOP_CURRENT_TIME_N = 3;
+ SVFOP_CURRENT_TIMESTAMP = 4;
+ SVFOP_CURRENT_TIMESTAMP_N = 5;
+ SVFOP_LOCALTIME = 6;
+ SVFOP_LOCALTIME_N = 7;
+ SVFOP_LOCALTIMESTAMP = 8;
+ SVFOP_LOCALTIMESTAMP_N = 9;
+ SVFOP_CURRENT_ROLE = 10;
+ SVFOP_CURRENT_USER = 11;
+ SVFOP_USER = 12;
+ SVFOP_SESSION_USER = 13;
+ SVFOP_CURRENT_CATALOG = 14;
+ SVFOP_CURRENT_SCHEMA = 15;
+}
+
+enum XmlExprOp
+{
+ XML_EXPR_OP_UNDEFINED = 0;
+ IS_XMLCONCAT = 1;
+ IS_XMLELEMENT = 2;
+ IS_XMLFOREST = 3;
+ IS_XMLPARSE = 4;
+ IS_XMLPI = 5;
+ IS_XMLROOT = 6;
+ IS_XMLSERIALIZE = 7;
+ IS_DOCUMENT = 8;
+}
+
+enum XmlOptionType
+{
+ XML_OPTION_TYPE_UNDEFINED = 0;
+ XMLOPTION_DOCUMENT = 1;
+ XMLOPTION_CONTENT = 2;
+}
+
+enum NullTestType
+{
+ NULL_TEST_TYPE_UNDEFINED = 0;
+ IS_NULL = 1;
+ IS_NOT_NULL = 2;
+}
+
+enum BoolTestType
+{
+ BOOL_TEST_TYPE_UNDEFINED = 0;
+ IS_TRUE = 1;
+ IS_NOT_TRUE = 2;
+ IS_FALSE = 3;
+ IS_NOT_FALSE = 4;
+ IS_UNKNOWN = 5;
+ IS_NOT_UNKNOWN = 6;
+}
+
+enum CmdType
+{
+ CMD_TYPE_UNDEFINED = 0;
+ CMD_UNKNOWN = 1;
+ CMD_SELECT = 2;
+ CMD_UPDATE = 3;
+ CMD_INSERT = 4;
+ CMD_DELETE = 5;
+ CMD_MERGE = 6;
+ CMD_UTILITY = 7;
+ CMD_NOTHING = 8;
+}
+
+enum JoinType
+{
+ JOIN_TYPE_UNDEFINED = 0;
+ JOIN_INNER = 1;
+ JOIN_LEFT = 2;
+ JOIN_FULL = 3;
+ JOIN_RIGHT = 4;
+ JOIN_SEMI = 5;
+ JOIN_ANTI = 6;
+ JOIN_UNIQUE_OUTER = 7;
+ JOIN_UNIQUE_INNER = 8;
+}
+
+enum AggStrategy
+{
+ AGG_STRATEGY_UNDEFINED = 0;
+ AGG_PLAIN = 1;
+ AGG_SORTED = 2;
+ AGG_HASHED = 3;
+ AGG_MIXED = 4;
+}
+
+enum AggSplit
+{
+ AGG_SPLIT_UNDEFINED = 0;
+ AGGSPLIT_SIMPLE = 1;
+ AGGSPLIT_INITIAL_SERIAL = 2;
+ AGGSPLIT_FINAL_DESERIAL = 3;
+}
+
+enum SetOpCmd
+{
+ SET_OP_CMD_UNDEFINED = 0;
+ SETOPCMD_INTERSECT = 1;
+ SETOPCMD_INTERSECT_ALL = 2;
+ SETOPCMD_EXCEPT = 3;
+ SETOPCMD_EXCEPT_ALL = 4;
+}
+
+enum SetOpStrategy
+{
+ SET_OP_STRATEGY_UNDEFINED = 0;
+ SETOP_SORTED = 1;
+ SETOP_HASHED = 2;
+}
+
+enum OnConflictAction
+{
+ ON_CONFLICT_ACTION_UNDEFINED = 0;
+ ONCONFLICT_NONE = 1;
+ ONCONFLICT_NOTHING = 2;
+ ONCONFLICT_UPDATE = 3;
+}
+
+enum LimitOption
+{
+ LIMIT_OPTION_UNDEFINED = 0;
+ LIMIT_OPTION_DEFAULT = 1;
+ LIMIT_OPTION_COUNT = 2;
+ LIMIT_OPTION_WITH_TIES = 3;
+}
+
+enum LockClauseStrength
+{
+ LOCK_CLAUSE_STRENGTH_UNDEFINED = 0;
+ LCS_NONE = 1;
+ LCS_FORKEYSHARE = 2;
+ LCS_FORSHARE = 3;
+ LCS_FORNOKEYUPDATE = 4;
+ LCS_FORUPDATE = 5;
+}
+
+enum LockWaitPolicy
+{
+ LOCK_WAIT_POLICY_UNDEFINED = 0;
+ LockWaitBlock = 1;
+ LockWaitSkip = 2;
+ LockWaitError = 3;
+}
+
+enum LockTupleMode
+{
+ LOCK_TUPLE_MODE_UNDEFINED = 0;
+ LockTupleKeyShare = 1;
+ LockTupleShare = 2;
+ LockTupleNoKeyExclusive = 3;
+ LockTupleExclusive = 4;
+}
+
+message ScanToken {
+ int32 start = 1;
+ int32 end = 2;
+ Token token = 4;
+ KeywordKind keyword_kind = 5;
+}
+
+enum KeywordKind {
+ NO_KEYWORD = 0;
+ UNRESERVED_KEYWORD = 1;
+ COL_NAME_KEYWORD = 2;
+ TYPE_FUNC_NAME_KEYWORD = 3;
+ RESERVED_KEYWORD = 4;
+}
+
+enum Token {
+ NUL = 0;
+ // Single-character tokens that are returned 1:1 (identical with "self" list in scan.l)
+ // Either supporting syntax, or single-character operators (some can be both)
+ // Also see https://www.postgresql.org/docs/12/sql-syntax-lexical.html#SQL-SYNTAX-SPECIAL-CHARS
+ ASCII_36 = 36; // "$"
+ ASCII_37 = 37; // "%"
+ ASCII_40 = 40; // "("
+ ASCII_41 = 41; // ")"
+ ASCII_42 = 42; // "*"
+ ASCII_43 = 43; // "+"
+ ASCII_44 = 44; // ","
+ ASCII_45 = 45; // "-"
+ ASCII_46 = 46; // "."
+ ASCII_47 = 47; // "/"
+ ASCII_58 = 58; // ":"
+ ASCII_59 = 59; // ";"
+ ASCII_60 = 60; // "<"
+ ASCII_61 = 61; // "="
+ ASCII_62 = 62; // ">"
+ ASCII_63 = 63; // "?"
+ ASCII_91 = 91; // "["
+ ASCII_92 = 92; // "\"
+ ASCII_93 = 93; // "]"
+ ASCII_94 = 94; // "^"
+ // Named tokens in scan.l
+ IDENT = 258;
+ UIDENT = 259;
+ FCONST = 260;
+ SCONST = 261;
+ USCONST = 262;
+ BCONST = 263;
+ XCONST = 264;
+ Op = 265;
+ ICONST = 266;
+ PARAM = 267;
+ TYPECAST = 268;
+ DOT_DOT = 269;
+ COLON_EQUALS = 270;
+ EQUALS_GREATER = 271;
+ LESS_EQUALS = 272;
+ GREATER_EQUALS = 273;
+ NOT_EQUALS = 274;
+ SQL_COMMENT = 275;
+ C_COMMENT = 276;
+ ABORT_P = 277;
+ ABSOLUTE_P = 278;
+ ACCESS = 279;
+ ACTION = 280;
+ ADD_P = 281;
+ ADMIN = 282;
+ AFTER = 283;
+ AGGREGATE = 284;
+ ALL = 285;
+ ALSO = 286;
+ ALTER = 287;
+ ALWAYS = 288;
+ ANALYSE = 289;
+ ANALYZE = 290;
+ AND = 291;
+ ANY = 292;
+ ARRAY = 293;
+ AS = 294;
+ ASC = 295;
+ ASENSITIVE = 296;
+ ASSERTION = 297;
+ ASSIGNMENT = 298;
+ ASYMMETRIC = 299;
+ ATOMIC = 300;
+ AT = 301;
+ ATTACH = 302;
+ ATTRIBUTE = 303;
+ AUTHORIZATION = 304;
+ BACKWARD = 305;
+ BEFORE = 306;
+ BEGIN_P = 307;
+ BETWEEN = 308;
+ BIGINT = 309;
+ BINARY = 310;
+ BIT = 311;
+ BOOLEAN_P = 312;
+ BOTH = 313;
+ BREADTH = 314;
+ BY = 315;
+ CACHE = 316;
+ CALL = 317;
+ CALLED = 318;
+ CASCADE = 319;
+ CASCADED = 320;
+ CASE = 321;
+ CAST = 322;
+ CATALOG_P = 323;
+ CHAIN = 324;
+ CHAR_P = 325;
+ CHARACTER = 326;
+ CHARACTERISTICS = 327;
+ CHECK = 328;
+ CHECKPOINT = 329;
+ CLASS = 330;
+ CLOSE = 331;
+ CLUSTER = 332;
+ COALESCE = 333;
+ COLLATE = 334;
+ COLLATION = 335;
+ COLUMN = 336;
+ COLUMNS = 337;
+ COMMENT = 338;
+ COMMENTS = 339;
+ COMMIT = 340;
+ COMMITTED = 341;
+ COMPRESSION = 342;
+ CONCURRENTLY = 343;
+ CONFIGURATION = 344;
+ CONFLICT = 345;
+ CONNECTION = 346;
+ CONSTRAINT = 347;
+ CONSTRAINTS = 348;
+ CONTENT_P = 349;
+ CONTINUE_P = 350;
+ CONVERSION_P = 351;
+ COPY = 352;
+ COST = 353;
+ CREATE = 354;
+ CROSS = 355;
+ CSV = 356;
+ CUBE = 357;
+ CURRENT_P = 358;
+ CURRENT_CATALOG = 359;
+ CURRENT_DATE = 360;
+ CURRENT_ROLE = 361;
+ CURRENT_SCHEMA = 362;
+ CURRENT_TIME = 363;
+ CURRENT_TIMESTAMP = 364;
+ CURRENT_USER = 365;
+ CURSOR = 366;
+ CYCLE = 367;
+ DATA_P = 368;
+ DATABASE = 369;
+ DAY_P = 370;
+ DEALLOCATE = 371;
+ DEC = 372;
+ DECIMAL_P = 373;
+ DECLARE = 374;
+ DEFAULT = 375;
+ DEFAULTS = 376;
+ DEFERRABLE = 377;
+ DEFERRED = 378;
+ DEFINER = 379;
+ DELETE_P = 380;
+ DELIMITER = 381;
+ DELIMITERS = 382;
+ DEPENDS = 383;
+ DEPTH = 384;
+ DESC = 385;
+ DETACH = 386;
+ DICTIONARY = 387;
+ DISABLE_P = 388;
+ DISCARD = 389;
+ DISTINCT = 390;
+ DO = 391;
+ DOCUMENT_P = 392;
+ DOMAIN_P = 393;
+ DOUBLE_P = 394;
+ DROP = 395;
+ EACH = 396;
+ ELSE = 397;
+ ENABLE_P = 398;
+ ENCODING = 399;
+ ENCRYPTED = 400;
+ END_P = 401;
+ ENUM_P = 402;
+ ESCAPE = 403;
+ EVENT = 404;
+ EXCEPT = 405;
+ EXCLUDE = 406;
+ EXCLUDING = 407;
+ EXCLUSIVE = 408;
+ EXECUTE = 409;
+ EXISTS = 410;
+ EXPLAIN = 411;
+ EXPRESSION = 412;
+ EXTENSION = 413;
+ EXTERNAL = 414;
+ EXTRACT = 415;
+ FALSE_P = 416;
+ FAMILY = 417;
+ FETCH = 418;
+ FILTER = 419;
+ FINALIZE = 420;
+ FIRST_P = 421;
+ FLOAT_P = 422;
+ FOLLOWING = 423;
+ FOR = 424;
+ FORCE = 425;
+ FOREIGN = 426;
+ FORWARD = 427;
+ FREEZE = 428;
+ FROM = 429;
+ FULL = 430;
+ FUNCTION = 431;
+ FUNCTIONS = 432;
+ GENERATED = 433;
+ GLOBAL = 434;
+ GRANT = 435;
+ GRANTED = 436;
+ GREATEST = 437;
+ GROUP_P = 438;
+ GROUPING = 439;
+ GROUPS = 440;
+ HANDLER = 441;
+ HAVING = 442;
+ HEADER_P = 443;
+ HOLD = 444;
+ HOUR_P = 445;
+ IDENTITY_P = 446;
+ IF_P = 447;
+ ILIKE = 448;
+ IMMEDIATE = 449;
+ IMMUTABLE = 450;
+ IMPLICIT_P = 451;
+ IMPORT_P = 452;
+ IN_P = 453;
+ INCLUDE = 454;
+ INCLUDING = 455;
+ INCREMENT = 456;
+ INDEX = 457;
+ INDEXES = 458;
+ INHERIT = 459;
+ INHERITS = 460;
+ INITIALLY = 461;
+ INLINE_P = 462;
+ INNER_P = 463;
+ INOUT = 464;
+ INPUT_P = 465;
+ INSENSITIVE = 466;
+ INSERT = 467;
+ INSTEAD = 468;
+ INT_P = 469;
+ INTEGER = 470;
+ INTERSECT = 471;
+ INTERVAL = 472;
+ INTO = 473;
+ INVOKER = 474;
+ IS = 475;
+ ISNULL = 476;
+ ISOLATION = 477;
+ JOIN = 478;
+ KEY = 479;
+ LABEL = 480;
+ LANGUAGE = 481;
+ LARGE_P = 482;
+ LAST_P = 483;
+ LATERAL_P = 484;
+ LEADING = 485;
+ LEAKPROOF = 486;
+ LEAST = 487;
+ LEFT = 488;
+ LEVEL = 489;
+ LIKE = 490;
+ LIMIT = 491;
+ LISTEN = 492;
+ LOAD = 493;
+ LOCAL = 494;
+ LOCALTIME = 495;
+ LOCALTIMESTAMP = 496;
+ LOCATION = 497;
+ LOCK_P = 498;
+ LOCKED = 499;
+ LOGGED = 500;
+ MAPPING = 501;
+ MATCH = 502;
+ MATCHED = 503;
+ MATERIALIZED = 504;
+ MAXVALUE = 505;
+ MERGE = 506;
+ METHOD = 507;
+ MINUTE_P = 508;
+ MINVALUE = 509;
+ MODE = 510;
+ MONTH_P = 511;
+ MOVE = 512;
+ NAME_P = 513;
+ NAMES = 514;
+ NATIONAL = 515;
+ NATURAL = 516;
+ NCHAR = 517;
+ NEW = 518;
+ NEXT = 519;
+ NFC = 520;
+ NFD = 521;
+ NFKC = 522;
+ NFKD = 523;
+ NO = 524;
+ NONE = 525;
+ NORMALIZE = 526;
+ NORMALIZED = 527;
+ NOT = 528;
+ NOTHING = 529;
+ NOTIFY = 530;
+ NOTNULL = 531;
+ NOWAIT = 532;
+ NULL_P = 533;
+ NULLIF = 534;
+ NULLS_P = 535;
+ NUMERIC = 536;
+ OBJECT_P = 537;
+ OF = 538;
+ OFF = 539;
+ OFFSET = 540;
+ OIDS = 541;
+ OLD = 542;
+ ON = 543;
+ ONLY = 544;
+ OPERATOR = 545;
+ OPTION = 546;
+ OPTIONS = 547;
+ OR = 548;
+ ORDER = 549;
+ ORDINALITY = 550;
+ OTHERS = 551;
+ OUT_P = 552;
+ OUTER_P = 553;
+ OVER = 554;
+ OVERLAPS = 555;
+ OVERLAY = 556;
+ OVERRIDING = 557;
+ OWNED = 558;
+ OWNER = 559;
+ PARALLEL = 560;
+ PARAMETER = 561;
+ PARSER = 562;
+ PARTIAL = 563;
+ PARTITION = 564;
+ PASSING = 565;
+ PASSWORD = 566;
+ PLACING = 567;
+ PLANS = 568;
+ POLICY = 569;
+ POSITION = 570;
+ PRECEDING = 571;
+ PRECISION = 572;
+ PRESERVE = 573;
+ PREPARE = 574;
+ PREPARED = 575;
+ PRIMARY = 576;
+ PRIOR = 577;
+ PRIVILEGES = 578;
+ PROCEDURAL = 579;
+ PROCEDURE = 580;
+ PROCEDURES = 581;
+ PROGRAM = 582;
+ PUBLICATION = 583;
+ QUOTE = 584;
+ RANGE = 585;
+ READ = 586;
+ REAL = 587;
+ REASSIGN = 588;
+ RECHECK = 589;
+ RECURSIVE = 590;
+ REF_P = 591;
+ REFERENCES = 592;
+ REFERENCING = 593;
+ REFRESH = 594;
+ REINDEX = 595;
+ RELATIVE_P = 596;
+ RELEASE = 597;
+ RENAME = 598;
+ REPEATABLE = 599;
+ REPLACE = 600;
+ REPLICA = 601;
+ RESET = 602;
+ RESTART = 603;
+ RESTRICT = 604;
+ RETURN = 605;
+ RETURNING = 606;
+ RETURNS = 607;
+ REVOKE = 608;
+ RIGHT = 609;
+ ROLE = 610;
+ ROLLBACK = 611;
+ ROLLUP = 612;
+ ROUTINE = 613;
+ ROUTINES = 614;
+ ROW = 615;
+ ROWS = 616;
+ RULE = 617;
+ SAVEPOINT = 618;
+ SCHEMA = 619;
+ SCHEMAS = 620;
+ SCROLL = 621;
+ SEARCH = 622;
+ SECOND_P = 623;
+ SECURITY = 624;
+ SELECT = 625;
+ SEQUENCE = 626;
+ SEQUENCES = 627;
+ SERIALIZABLE = 628;
+ SERVER = 629;
+ SESSION = 630;
+ SESSION_USER = 631;
+ SET = 632;
+ SETS = 633;
+ SETOF = 634;
+ SHARE = 635;
+ SHOW = 636;
+ SIMILAR = 637;
+ SIMPLE = 638;
+ SKIP = 639;
+ SMALLINT = 640;
+ SNAPSHOT = 641;
+ SOME = 642;
+ SQL_P = 643;
+ STABLE = 644;
+ STANDALONE_P = 645;
+ START = 646;
+ STATEMENT = 647;
+ STATISTICS = 648;
+ STDIN = 649;
+ STDOUT = 650;
+ STORAGE = 651;
+ STORED = 652;
+ STRICT_P = 653;
+ STRIP_P = 654;
+ SUBSCRIPTION = 655;
+ SUBSTRING = 656;
+ SUPPORT = 657;
+ SYMMETRIC = 658;
+ SYSID = 659;
+ SYSTEM_P = 660;
+ TABLE = 661;
+ TABLES = 662;
+ TABLESAMPLE = 663;
+ TABLESPACE = 664;
+ TEMP = 665;
+ TEMPLATE = 666;
+ TEMPORARY = 667;
+ TEXT_P = 668;
+ THEN = 669;
+ TIES = 670;
+ TIME = 671;
+ TIMESTAMP = 672;
+ TO = 673;
+ TRAILING = 674;
+ TRANSACTION = 675;
+ TRANSFORM = 676;
+ TREAT = 677;
+ TRIGGER = 678;
+ TRIM = 679;
+ TRUE_P = 680;
+ TRUNCATE = 681;
+ TRUSTED = 682;
+ TYPE_P = 683;
+ TYPES_P = 684;
+ UESCAPE = 685;
+ UNBOUNDED = 686;
+ UNCOMMITTED = 687;
+ UNENCRYPTED = 688;
+ UNION = 689;
+ UNIQUE = 690;
+ UNKNOWN = 691;
+ UNLISTEN = 692;
+ UNLOGGED = 693;
+ UNTIL = 694;
+ UPDATE = 695;
+ USER = 696;
+ USING = 697;
+ VACUUM = 698;
+ VALID = 699;
+ VALIDATE = 700;
+ VALIDATOR = 701;
+ VALUE_P = 702;
+ VALUES = 703;
+ VARCHAR = 704;
+ VARIADIC = 705;
+ VARYING = 706;
+ VERBOSE = 707;
+ VERSION_P = 708;
+ VIEW = 709;
+ VIEWS = 710;
+ VOLATILE = 711;
+ WHEN = 712;
+ WHERE = 713;
+ WHITESPACE_P = 714;
+ WINDOW = 715;
+ WITH = 716;
+ WITHIN = 717;
+ WITHOUT = 718;
+ WORK = 719;
+ WRAPPER = 720;
+ WRITE = 721;
+ XML_P = 722;
+ XMLATTRIBUTES = 723;
+ XMLCONCAT = 724;
+ XMLELEMENT = 725;
+ XMLEXISTS = 726;
+ XMLFOREST = 727;
+ XMLNAMESPACES = 728;
+ XMLPARSE = 729;
+ XMLPI = 730;
+ XMLROOT = 731;
+ XMLSERIALIZE = 732;
+ XMLTABLE = 733;
+ YEAR_P = 734;
+ YES_P = 735;
+ ZONE = 736;
+ NOT_LA = 737;
+ NULLS_LA = 738;
+ WITH_LA = 739;
+ MODE_TYPE_NAME = 740;
+ MODE_PLPGSQL_EXPR = 741;
+ MODE_PLPGSQL_ASSIGN1 = 742;
+ MODE_PLPGSQL_ASSIGN2 = 743;
+ MODE_PLPGSQL_ASSIGN3 = 744;
+ UMINUS = 745;
+}
diff --git a/protos/16/pg_query.proto b/protos/16/pg_query.proto
new file mode 100644
index 00000000..c43473e7
--- /dev/null
+++ b/protos/16/pg_query.proto
@@ -0,0 +1,3845 @@
+// This file is autogenerated by ./scripts/generate_protobuf_and_funcs.rb
+
+syntax = "proto3";
+
+package pg_query;
+
+message ParseResult {
+ int32 version = 1;
+ repeated RawStmt stmts = 2;
+}
+
+message ScanResult {
+ int32 version = 1;
+ repeated ScanToken tokens = 2;
+}
+
+message Node {
+ oneof node {
+ Alias alias = 1 [json_name="Alias"];
+ RangeVar range_var = 2 [json_name="RangeVar"];
+ TableFunc table_func = 3 [json_name="TableFunc"];
+ IntoClause into_clause = 4 [json_name="IntoClause"];
+ Var var = 5 [json_name="Var"];
+ Param param = 6 [json_name="Param"];
+ Aggref aggref = 7 [json_name="Aggref"];
+ GroupingFunc grouping_func = 8 [json_name="GroupingFunc"];
+ WindowFunc window_func = 9 [json_name="WindowFunc"];
+ SubscriptingRef subscripting_ref = 10 [json_name="SubscriptingRef"];
+ FuncExpr func_expr = 11 [json_name="FuncExpr"];
+ NamedArgExpr named_arg_expr = 12 [json_name="NamedArgExpr"];
+ OpExpr op_expr = 13 [json_name="OpExpr"];
+ DistinctExpr distinct_expr = 14 [json_name="DistinctExpr"];
+ NullIfExpr null_if_expr = 15 [json_name="NullIfExpr"];
+ ScalarArrayOpExpr scalar_array_op_expr = 16 [json_name="ScalarArrayOpExpr"];
+ BoolExpr bool_expr = 17 [json_name="BoolExpr"];
+ SubLink sub_link = 18 [json_name="SubLink"];
+ SubPlan sub_plan = 19 [json_name="SubPlan"];
+ AlternativeSubPlan alternative_sub_plan = 20 [json_name="AlternativeSubPlan"];
+ FieldSelect field_select = 21 [json_name="FieldSelect"];
+ FieldStore field_store = 22 [json_name="FieldStore"];
+ RelabelType relabel_type = 23 [json_name="RelabelType"];
+ CoerceViaIO coerce_via_io = 24 [json_name="CoerceViaIO"];
+ ArrayCoerceExpr array_coerce_expr = 25 [json_name="ArrayCoerceExpr"];
+ ConvertRowtypeExpr convert_rowtype_expr = 26 [json_name="ConvertRowtypeExpr"];
+ CollateExpr collate_expr = 27 [json_name="CollateExpr"];
+ CaseExpr case_expr = 28 [json_name="CaseExpr"];
+ CaseWhen case_when = 29 [json_name="CaseWhen"];
+ CaseTestExpr case_test_expr = 30 [json_name="CaseTestExpr"];
+ ArrayExpr array_expr = 31 [json_name="ArrayExpr"];
+ RowExpr row_expr = 32 [json_name="RowExpr"];
+ RowCompareExpr row_compare_expr = 33 [json_name="RowCompareExpr"];
+ CoalesceExpr coalesce_expr = 34 [json_name="CoalesceExpr"];
+ MinMaxExpr min_max_expr = 35 [json_name="MinMaxExpr"];
+ SQLValueFunction sqlvalue_function = 36 [json_name="SQLValueFunction"];
+ XmlExpr xml_expr = 37 [json_name="XmlExpr"];
+ JsonFormat json_format = 38 [json_name="JsonFormat"];
+ JsonReturning json_returning = 39 [json_name="JsonReturning"];
+ JsonValueExpr json_value_expr = 40 [json_name="JsonValueExpr"];
+ JsonConstructorExpr json_constructor_expr = 41 [json_name="JsonConstructorExpr"];
+ JsonIsPredicate json_is_predicate = 42 [json_name="JsonIsPredicate"];
+ NullTest null_test = 43 [json_name="NullTest"];
+ BooleanTest boolean_test = 44 [json_name="BooleanTest"];
+ CoerceToDomain coerce_to_domain = 45 [json_name="CoerceToDomain"];
+ CoerceToDomainValue coerce_to_domain_value = 46 [json_name="CoerceToDomainValue"];
+ SetToDefault set_to_default = 47 [json_name="SetToDefault"];
+ CurrentOfExpr current_of_expr = 48 [json_name="CurrentOfExpr"];
+ NextValueExpr next_value_expr = 49 [json_name="NextValueExpr"];
+ InferenceElem inference_elem = 50 [json_name="InferenceElem"];
+ TargetEntry target_entry = 51 [json_name="TargetEntry"];
+ RangeTblRef range_tbl_ref = 52 [json_name="RangeTblRef"];
+ JoinExpr join_expr = 53 [json_name="JoinExpr"];
+ FromExpr from_expr = 54 [json_name="FromExpr"];
+ OnConflictExpr on_conflict_expr = 55 [json_name="OnConflictExpr"];
+ Query query = 56 [json_name="Query"];
+ TypeName type_name = 57 [json_name="TypeName"];
+ ColumnRef column_ref = 58 [json_name="ColumnRef"];
+ ParamRef param_ref = 59 [json_name="ParamRef"];
+ A_Expr a_expr = 60 [json_name="A_Expr"];
+ TypeCast type_cast = 61 [json_name="TypeCast"];
+ CollateClause collate_clause = 62 [json_name="CollateClause"];
+ RoleSpec role_spec = 63 [json_name="RoleSpec"];
+ FuncCall func_call = 64 [json_name="FuncCall"];
+ A_Star a_star = 65 [json_name="A_Star"];
+ A_Indices a_indices = 66 [json_name="A_Indices"];
+ A_Indirection a_indirection = 67 [json_name="A_Indirection"];
+ A_ArrayExpr a_array_expr = 68 [json_name="A_ArrayExpr"];
+ ResTarget res_target = 69 [json_name="ResTarget"];
+ MultiAssignRef multi_assign_ref = 70 [json_name="MultiAssignRef"];
+ SortBy sort_by = 71 [json_name="SortBy"];
+ WindowDef window_def = 72 [json_name="WindowDef"];
+ RangeSubselect range_subselect = 73 [json_name="RangeSubselect"];
+ RangeFunction range_function = 74 [json_name="RangeFunction"];
+ RangeTableFunc range_table_func = 75 [json_name="RangeTableFunc"];
+ RangeTableFuncCol range_table_func_col = 76 [json_name="RangeTableFuncCol"];
+ RangeTableSample range_table_sample = 77 [json_name="RangeTableSample"];
+ ColumnDef column_def = 78 [json_name="ColumnDef"];
+ TableLikeClause table_like_clause = 79 [json_name="TableLikeClause"];
+ IndexElem index_elem = 80 [json_name="IndexElem"];
+ DefElem def_elem = 81 [json_name="DefElem"];
+ LockingClause locking_clause = 82 [json_name="LockingClause"];
+ XmlSerialize xml_serialize = 83 [json_name="XmlSerialize"];
+ PartitionElem partition_elem = 84 [json_name="PartitionElem"];
+ PartitionSpec partition_spec = 85 [json_name="PartitionSpec"];
+ PartitionBoundSpec partition_bound_spec = 86 [json_name="PartitionBoundSpec"];
+ PartitionRangeDatum partition_range_datum = 87 [json_name="PartitionRangeDatum"];
+ PartitionCmd partition_cmd = 88 [json_name="PartitionCmd"];
+ RangeTblEntry range_tbl_entry = 89 [json_name="RangeTblEntry"];
+ RTEPermissionInfo rtepermission_info = 90 [json_name="RTEPermissionInfo"];
+ RangeTblFunction range_tbl_function = 91 [json_name="RangeTblFunction"];
+ TableSampleClause table_sample_clause = 92 [json_name="TableSampleClause"];
+ WithCheckOption with_check_option = 93 [json_name="WithCheckOption"];
+ SortGroupClause sort_group_clause = 94 [json_name="SortGroupClause"];
+ GroupingSet grouping_set = 95 [json_name="GroupingSet"];
+ WindowClause window_clause = 96 [json_name="WindowClause"];
+ RowMarkClause row_mark_clause = 97 [json_name="RowMarkClause"];
+ WithClause with_clause = 98 [json_name="WithClause"];
+ InferClause infer_clause = 99 [json_name="InferClause"];
+ OnConflictClause on_conflict_clause = 100 [json_name="OnConflictClause"];
+ CTESearchClause ctesearch_clause = 101 [json_name="CTESearchClause"];
+ CTECycleClause ctecycle_clause = 102 [json_name="CTECycleClause"];
+ CommonTableExpr common_table_expr = 103 [json_name="CommonTableExpr"];
+ MergeWhenClause merge_when_clause = 104 [json_name="MergeWhenClause"];
+ MergeAction merge_action = 105 [json_name="MergeAction"];
+ TriggerTransition trigger_transition = 106 [json_name="TriggerTransition"];
+ JsonOutput json_output = 107 [json_name="JsonOutput"];
+ JsonKeyValue json_key_value = 108 [json_name="JsonKeyValue"];
+ JsonObjectConstructor json_object_constructor = 109 [json_name="JsonObjectConstructor"];
+ JsonArrayConstructor json_array_constructor = 110 [json_name="JsonArrayConstructor"];
+ JsonArrayQueryConstructor json_array_query_constructor = 111 [json_name="JsonArrayQueryConstructor"];
+ JsonAggConstructor json_agg_constructor = 112 [json_name="JsonAggConstructor"];
+ JsonObjectAgg json_object_agg = 113 [json_name="JsonObjectAgg"];
+ JsonArrayAgg json_array_agg = 114 [json_name="JsonArrayAgg"];
+ RawStmt raw_stmt = 115 [json_name="RawStmt"];
+ InsertStmt insert_stmt = 116 [json_name="InsertStmt"];
+ DeleteStmt delete_stmt = 117 [json_name="DeleteStmt"];
+ UpdateStmt update_stmt = 118 [json_name="UpdateStmt"];
+ MergeStmt merge_stmt = 119 [json_name="MergeStmt"];
+ SelectStmt select_stmt = 120 [json_name="SelectStmt"];
+ SetOperationStmt set_operation_stmt = 121 [json_name="SetOperationStmt"];
+ ReturnStmt return_stmt = 122 [json_name="ReturnStmt"];
+ PLAssignStmt plassign_stmt = 123 [json_name="PLAssignStmt"];
+ CreateSchemaStmt create_schema_stmt = 124 [json_name="CreateSchemaStmt"];
+ AlterTableStmt alter_table_stmt = 125 [json_name="AlterTableStmt"];
+ ReplicaIdentityStmt replica_identity_stmt = 126 [json_name="ReplicaIdentityStmt"];
+ AlterTableCmd alter_table_cmd = 127 [json_name="AlterTableCmd"];
+ AlterCollationStmt alter_collation_stmt = 128 [json_name="AlterCollationStmt"];
+ AlterDomainStmt alter_domain_stmt = 129 [json_name="AlterDomainStmt"];
+ GrantStmt grant_stmt = 130 [json_name="GrantStmt"];
+ ObjectWithArgs object_with_args = 131 [json_name="ObjectWithArgs"];
+ AccessPriv access_priv = 132 [json_name="AccessPriv"];
+ GrantRoleStmt grant_role_stmt = 133 [json_name="GrantRoleStmt"];
+ AlterDefaultPrivilegesStmt alter_default_privileges_stmt = 134 [json_name="AlterDefaultPrivilegesStmt"];
+ CopyStmt copy_stmt = 135 [json_name="CopyStmt"];
+ VariableSetStmt variable_set_stmt = 136 [json_name="VariableSetStmt"];
+ VariableShowStmt variable_show_stmt = 137 [json_name="VariableShowStmt"];
+ CreateStmt create_stmt = 138 [json_name="CreateStmt"];
+ Constraint constraint = 139 [json_name="Constraint"];
+ CreateTableSpaceStmt create_table_space_stmt = 140 [json_name="CreateTableSpaceStmt"];
+ DropTableSpaceStmt drop_table_space_stmt = 141 [json_name="DropTableSpaceStmt"];
+ AlterTableSpaceOptionsStmt alter_table_space_options_stmt = 142 [json_name="AlterTableSpaceOptionsStmt"];
+ AlterTableMoveAllStmt alter_table_move_all_stmt = 143 [json_name="AlterTableMoveAllStmt"];
+ CreateExtensionStmt create_extension_stmt = 144 [json_name="CreateExtensionStmt"];
+ AlterExtensionStmt alter_extension_stmt = 145 [json_name="AlterExtensionStmt"];
+ AlterExtensionContentsStmt alter_extension_contents_stmt = 146 [json_name="AlterExtensionContentsStmt"];
+ CreateFdwStmt create_fdw_stmt = 147 [json_name="CreateFdwStmt"];
+ AlterFdwStmt alter_fdw_stmt = 148 [json_name="AlterFdwStmt"];
+ CreateForeignServerStmt create_foreign_server_stmt = 149 [json_name="CreateForeignServerStmt"];
+ AlterForeignServerStmt alter_foreign_server_stmt = 150 [json_name="AlterForeignServerStmt"];
+ CreateForeignTableStmt create_foreign_table_stmt = 151 [json_name="CreateForeignTableStmt"];
+ CreateUserMappingStmt create_user_mapping_stmt = 152 [json_name="CreateUserMappingStmt"];
+ AlterUserMappingStmt alter_user_mapping_stmt = 153 [json_name="AlterUserMappingStmt"];
+ DropUserMappingStmt drop_user_mapping_stmt = 154 [json_name="DropUserMappingStmt"];
+ ImportForeignSchemaStmt import_foreign_schema_stmt = 155 [json_name="ImportForeignSchemaStmt"];
+ CreatePolicyStmt create_policy_stmt = 156 [json_name="CreatePolicyStmt"];
+ AlterPolicyStmt alter_policy_stmt = 157 [json_name="AlterPolicyStmt"];
+ CreateAmStmt create_am_stmt = 158 [json_name="CreateAmStmt"];
+ CreateTrigStmt create_trig_stmt = 159 [json_name="CreateTrigStmt"];
+ CreateEventTrigStmt create_event_trig_stmt = 160 [json_name="CreateEventTrigStmt"];
+ AlterEventTrigStmt alter_event_trig_stmt = 161 [json_name="AlterEventTrigStmt"];
+ CreatePLangStmt create_plang_stmt = 162 [json_name="CreatePLangStmt"];
+ CreateRoleStmt create_role_stmt = 163 [json_name="CreateRoleStmt"];
+ AlterRoleStmt alter_role_stmt = 164 [json_name="AlterRoleStmt"];
+ AlterRoleSetStmt alter_role_set_stmt = 165 [json_name="AlterRoleSetStmt"];
+ DropRoleStmt drop_role_stmt = 166 [json_name="DropRoleStmt"];
+ CreateSeqStmt create_seq_stmt = 167 [json_name="CreateSeqStmt"];
+ AlterSeqStmt alter_seq_stmt = 168 [json_name="AlterSeqStmt"];
+ DefineStmt define_stmt = 169 [json_name="DefineStmt"];
+ CreateDomainStmt create_domain_stmt = 170 [json_name="CreateDomainStmt"];
+ CreateOpClassStmt create_op_class_stmt = 171 [json_name="CreateOpClassStmt"];
+ CreateOpClassItem create_op_class_item = 172 [json_name="CreateOpClassItem"];
+ CreateOpFamilyStmt create_op_family_stmt = 173 [json_name="CreateOpFamilyStmt"];
+ AlterOpFamilyStmt alter_op_family_stmt = 174 [json_name="AlterOpFamilyStmt"];
+ DropStmt drop_stmt = 175 [json_name="DropStmt"];
+ TruncateStmt truncate_stmt = 176 [json_name="TruncateStmt"];
+ CommentStmt comment_stmt = 177 [json_name="CommentStmt"];
+ SecLabelStmt sec_label_stmt = 178 [json_name="SecLabelStmt"];
+ DeclareCursorStmt declare_cursor_stmt = 179 [json_name="DeclareCursorStmt"];
+ ClosePortalStmt close_portal_stmt = 180 [json_name="ClosePortalStmt"];
+ FetchStmt fetch_stmt = 181 [json_name="FetchStmt"];
+ IndexStmt index_stmt = 182 [json_name="IndexStmt"];
+ CreateStatsStmt create_stats_stmt = 183 [json_name="CreateStatsStmt"];
+ StatsElem stats_elem = 184 [json_name="StatsElem"];
+ AlterStatsStmt alter_stats_stmt = 185 [json_name="AlterStatsStmt"];
+ CreateFunctionStmt create_function_stmt = 186 [json_name="CreateFunctionStmt"];
+ FunctionParameter function_parameter = 187 [json_name="FunctionParameter"];
+ AlterFunctionStmt alter_function_stmt = 188 [json_name="AlterFunctionStmt"];
+ DoStmt do_stmt = 189 [json_name="DoStmt"];
+ InlineCodeBlock inline_code_block = 190 [json_name="InlineCodeBlock"];
+ CallStmt call_stmt = 191 [json_name="CallStmt"];
+ CallContext call_context = 192 [json_name="CallContext"];
+ RenameStmt rename_stmt = 193 [json_name="RenameStmt"];
+ AlterObjectDependsStmt alter_object_depends_stmt = 194 [json_name="AlterObjectDependsStmt"];
+ AlterObjectSchemaStmt alter_object_schema_stmt = 195 [json_name="AlterObjectSchemaStmt"];
+ AlterOwnerStmt alter_owner_stmt = 196 [json_name="AlterOwnerStmt"];
+ AlterOperatorStmt alter_operator_stmt = 197 [json_name="AlterOperatorStmt"];
+ AlterTypeStmt alter_type_stmt = 198 [json_name="AlterTypeStmt"];
+ RuleStmt rule_stmt = 199 [json_name="RuleStmt"];
+ NotifyStmt notify_stmt = 200 [json_name="NotifyStmt"];
+ ListenStmt listen_stmt = 201 [json_name="ListenStmt"];
+ UnlistenStmt unlisten_stmt = 202 [json_name="UnlistenStmt"];
+ TransactionStmt transaction_stmt = 203 [json_name="TransactionStmt"];
+ CompositeTypeStmt composite_type_stmt = 204 [json_name="CompositeTypeStmt"];
+ CreateEnumStmt create_enum_stmt = 205 [json_name="CreateEnumStmt"];
+ CreateRangeStmt create_range_stmt = 206 [json_name="CreateRangeStmt"];
+ AlterEnumStmt alter_enum_stmt = 207 [json_name="AlterEnumStmt"];
+ ViewStmt view_stmt = 208 [json_name="ViewStmt"];
+ LoadStmt load_stmt = 209 [json_name="LoadStmt"];
+ CreatedbStmt createdb_stmt = 210 [json_name="CreatedbStmt"];
+ AlterDatabaseStmt alter_database_stmt = 211 [json_name="AlterDatabaseStmt"];
+ AlterDatabaseRefreshCollStmt alter_database_refresh_coll_stmt = 212 [json_name="AlterDatabaseRefreshCollStmt"];
+ AlterDatabaseSetStmt alter_database_set_stmt = 213 [json_name="AlterDatabaseSetStmt"];
+ DropdbStmt dropdb_stmt = 214 [json_name="DropdbStmt"];
+ AlterSystemStmt alter_system_stmt = 215 [json_name="AlterSystemStmt"];
+ ClusterStmt cluster_stmt = 216 [json_name="ClusterStmt"];
+ VacuumStmt vacuum_stmt = 217 [json_name="VacuumStmt"];
+ VacuumRelation vacuum_relation = 218 [json_name="VacuumRelation"];
+ ExplainStmt explain_stmt = 219 [json_name="ExplainStmt"];
+ CreateTableAsStmt create_table_as_stmt = 220 [json_name="CreateTableAsStmt"];
+ RefreshMatViewStmt refresh_mat_view_stmt = 221 [json_name="RefreshMatViewStmt"];
+ CheckPointStmt check_point_stmt = 222 [json_name="CheckPointStmt"];
+ DiscardStmt discard_stmt = 223 [json_name="DiscardStmt"];
+ LockStmt lock_stmt = 224 [json_name="LockStmt"];
+ ConstraintsSetStmt constraints_set_stmt = 225 [json_name="ConstraintsSetStmt"];
+ ReindexStmt reindex_stmt = 226 [json_name="ReindexStmt"];
+ CreateConversionStmt create_conversion_stmt = 227 [json_name="CreateConversionStmt"];
+ CreateCastStmt create_cast_stmt = 228 [json_name="CreateCastStmt"];
+ CreateTransformStmt create_transform_stmt = 229 [json_name="CreateTransformStmt"];
+ PrepareStmt prepare_stmt = 230 [json_name="PrepareStmt"];
+ ExecuteStmt execute_stmt = 231 [json_name="ExecuteStmt"];
+ DeallocateStmt deallocate_stmt = 232 [json_name="DeallocateStmt"];
+ DropOwnedStmt drop_owned_stmt = 233 [json_name="DropOwnedStmt"];
+ ReassignOwnedStmt reassign_owned_stmt = 234 [json_name="ReassignOwnedStmt"];
+ AlterTSDictionaryStmt alter_tsdictionary_stmt = 235 [json_name="AlterTSDictionaryStmt"];
+ AlterTSConfigurationStmt alter_tsconfiguration_stmt = 236 [json_name="AlterTSConfigurationStmt"];
+ PublicationTable publication_table = 237 [json_name="PublicationTable"];
+ PublicationObjSpec publication_obj_spec = 238 [json_name="PublicationObjSpec"];
+ CreatePublicationStmt create_publication_stmt = 239 [json_name="CreatePublicationStmt"];
+ AlterPublicationStmt alter_publication_stmt = 240 [json_name="AlterPublicationStmt"];
+ CreateSubscriptionStmt create_subscription_stmt = 241 [json_name="CreateSubscriptionStmt"];
+ AlterSubscriptionStmt alter_subscription_stmt = 242 [json_name="AlterSubscriptionStmt"];
+ DropSubscriptionStmt drop_subscription_stmt = 243 [json_name="DropSubscriptionStmt"];
+ Integer integer = 244 [json_name="Integer"];
+ Float float = 245 [json_name="Float"];
+ Boolean boolean = 246 [json_name="Boolean"];
+ String string = 247 [json_name="String"];
+ BitString bit_string = 248 [json_name="BitString"];
+ List list = 249 [json_name="List"];
+ IntList int_list = 250 [json_name="IntList"];
+ OidList oid_list = 251 [json_name="OidList"];
+ A_Const a_const = 252 [json_name="A_Const"];
+ }
+}
+
+message Integer
+{
+ int32 ival = 1; /* machine integer */
+}
+
+message Float
+{
+ string fval = 1; /* string */
+}
+
+message Boolean
+{
+ bool boolval = 1;
+}
+
+message String
+{
+ string sval = 1; /* string */
+}
+
+message BitString
+{
+ string bsval = 1; /* string */
+}
+
+message List
+{
+ repeated Node items = 1;
+}
+
+message OidList
+{
+ repeated Node items = 1;
+}
+
+message IntList
+{
+ repeated Node items = 1;
+}
+
+message A_Const
+{
+ oneof val {
+ Integer ival = 1;
+ Float fval = 2;
+ Boolean boolval = 3;
+ String sval = 4;
+ BitString bsval = 5;
+ }
+ bool isnull = 10;
+ int32 location = 11;
+}
+
+message Alias
+{
+ string aliasname = 1 [json_name="aliasname"];
+ repeated Node colnames = 2 [json_name="colnames"];
+}
+
+message RangeVar
+{
+ string catalogname = 1 [json_name="catalogname"];
+ string schemaname = 2 [json_name="schemaname"];
+ string relname = 3 [json_name="relname"];
+ bool inh = 4 [json_name="inh"];
+ string relpersistence = 5 [json_name="relpersistence"];
+ Alias alias = 6 [json_name="alias"];
+ int32 location = 7 [json_name="location"];
+}
+
+message TableFunc
+{
+ repeated Node ns_uris = 1 [json_name="ns_uris"];
+ repeated Node ns_names = 2 [json_name="ns_names"];
+ Node docexpr = 3 [json_name="docexpr"];
+ Node rowexpr = 4 [json_name="rowexpr"];
+ repeated Node colnames = 5 [json_name="colnames"];
+ repeated Node coltypes = 6 [json_name="coltypes"];
+ repeated Node coltypmods = 7 [json_name="coltypmods"];
+ repeated Node colcollations = 8 [json_name="colcollations"];
+ repeated Node colexprs = 9 [json_name="colexprs"];
+ repeated Node coldefexprs = 10 [json_name="coldefexprs"];
+ repeated uint64 notnulls = 11 [json_name="notnulls"];
+ int32 ordinalitycol = 12 [json_name="ordinalitycol"];
+ int32 location = 13 [json_name="location"];
+}
+
+message IntoClause
+{
+ RangeVar rel = 1 [json_name="rel"];
+ repeated Node col_names = 2 [json_name="colNames"];
+ string access_method = 3 [json_name="accessMethod"];
+ repeated Node options = 4 [json_name="options"];
+ OnCommitAction on_commit = 5 [json_name="onCommit"];
+ string table_space_name = 6 [json_name="tableSpaceName"];
+ Node view_query = 7 [json_name="viewQuery"];
+ bool skip_data = 8 [json_name="skipData"];
+}
+
+message Var
+{
+ Node xpr = 1 [json_name="xpr"];
+ int32 varno = 2 [json_name="varno"];
+ int32 varattno = 3 [json_name="varattno"];
+ uint32 vartype = 4 [json_name="vartype"];
+ int32 vartypmod = 5 [json_name="vartypmod"];
+ uint32 varcollid = 6 [json_name="varcollid"];
+ repeated uint64 varnullingrels = 7 [json_name="varnullingrels"];
+ uint32 varlevelsup = 8 [json_name="varlevelsup"];
+ int32 location = 9 [json_name="location"];
+}
+
+message Param
+{
+ Node xpr = 1 [json_name="xpr"];
+ ParamKind paramkind = 2 [json_name="paramkind"];
+ int32 paramid = 3 [json_name="paramid"];
+ uint32 paramtype = 4 [json_name="paramtype"];
+ int32 paramtypmod = 5 [json_name="paramtypmod"];
+ uint32 paramcollid = 6 [json_name="paramcollid"];
+ int32 location = 7 [json_name="location"];
+}
+
+message Aggref
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 aggfnoid = 2 [json_name="aggfnoid"];
+ uint32 aggtype = 3 [json_name="aggtype"];
+ uint32 aggcollid = 4 [json_name="aggcollid"];
+ uint32 inputcollid = 5 [json_name="inputcollid"];
+ repeated Node aggargtypes = 6 [json_name="aggargtypes"];
+ repeated Node aggdirectargs = 7 [json_name="aggdirectargs"];
+ repeated Node args = 8 [json_name="args"];
+ repeated Node aggorder = 9 [json_name="aggorder"];
+ repeated Node aggdistinct = 10 [json_name="aggdistinct"];
+ Node aggfilter = 11 [json_name="aggfilter"];
+ bool aggstar = 12 [json_name="aggstar"];
+ bool aggvariadic = 13 [json_name="aggvariadic"];
+ string aggkind = 14 [json_name="aggkind"];
+ uint32 agglevelsup = 15 [json_name="agglevelsup"];
+ AggSplit aggsplit = 16 [json_name="aggsplit"];
+ int32 aggno = 17 [json_name="aggno"];
+ int32 aggtransno = 18 [json_name="aggtransno"];
+ int32 location = 19 [json_name="location"];
+}
+
+message GroupingFunc
+{
+ Node xpr = 1 [json_name="xpr"];
+ repeated Node args = 2 [json_name="args"];
+ repeated Node refs = 3 [json_name="refs"];
+ uint32 agglevelsup = 4 [json_name="agglevelsup"];
+ int32 location = 5 [json_name="location"];
+}
+
+message WindowFunc
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 winfnoid = 2 [json_name="winfnoid"];
+ uint32 wintype = 3 [json_name="wintype"];
+ uint32 wincollid = 4 [json_name="wincollid"];
+ uint32 inputcollid = 5 [json_name="inputcollid"];
+ repeated Node args = 6 [json_name="args"];
+ Node aggfilter = 7 [json_name="aggfilter"];
+ uint32 winref = 8 [json_name="winref"];
+ bool winstar = 9 [json_name="winstar"];
+ bool winagg = 10 [json_name="winagg"];
+ int32 location = 11 [json_name="location"];
+}
+
+message SubscriptingRef
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 refcontainertype = 2 [json_name="refcontainertype"];
+ uint32 refelemtype = 3 [json_name="refelemtype"];
+ uint32 refrestype = 4 [json_name="refrestype"];
+ int32 reftypmod = 5 [json_name="reftypmod"];
+ uint32 refcollid = 6 [json_name="refcollid"];
+ repeated Node refupperindexpr = 7 [json_name="refupperindexpr"];
+ repeated Node reflowerindexpr = 8 [json_name="reflowerindexpr"];
+ Node refexpr = 9 [json_name="refexpr"];
+ Node refassgnexpr = 10 [json_name="refassgnexpr"];
+}
+
+message FuncExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 funcid = 2 [json_name="funcid"];
+ uint32 funcresulttype = 3 [json_name="funcresulttype"];
+ bool funcretset = 4 [json_name="funcretset"];
+ bool funcvariadic = 5 [json_name="funcvariadic"];
+ CoercionForm funcformat = 6 [json_name="funcformat"];
+ uint32 funccollid = 7 [json_name="funccollid"];
+ uint32 inputcollid = 8 [json_name="inputcollid"];
+ repeated Node args = 9 [json_name="args"];
+ int32 location = 10 [json_name="location"];
+}
+
+message NamedArgExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ string name = 3 [json_name="name"];
+ int32 argnumber = 4 [json_name="argnumber"];
+ int32 location = 5 [json_name="location"];
+}
+
+message OpExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 opno = 2 [json_name="opno"];
+ uint32 opresulttype = 3 [json_name="opresulttype"];
+ bool opretset = 4 [json_name="opretset"];
+ uint32 opcollid = 5 [json_name="opcollid"];
+ uint32 inputcollid = 6 [json_name="inputcollid"];
+ repeated Node args = 7 [json_name="args"];
+ int32 location = 8 [json_name="location"];
+}
+
+message DistinctExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 opno = 2 [json_name="opno"];
+ uint32 opresulttype = 3 [json_name="opresulttype"];
+ bool opretset = 4 [json_name="opretset"];
+ uint32 opcollid = 5 [json_name="opcollid"];
+ uint32 inputcollid = 6 [json_name="inputcollid"];
+ repeated Node args = 7 [json_name="args"];
+ int32 location = 8 [json_name="location"];
+}
+
+message NullIfExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 opno = 2 [json_name="opno"];
+ uint32 opresulttype = 3 [json_name="opresulttype"];
+ bool opretset = 4 [json_name="opretset"];
+ uint32 opcollid = 5 [json_name="opcollid"];
+ uint32 inputcollid = 6 [json_name="inputcollid"];
+ repeated Node args = 7 [json_name="args"];
+ int32 location = 8 [json_name="location"];
+}
+
+message ScalarArrayOpExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 opno = 2 [json_name="opno"];
+ bool use_or = 3 [json_name="useOr"];
+ uint32 inputcollid = 4 [json_name="inputcollid"];
+ repeated Node args = 5 [json_name="args"];
+ int32 location = 6 [json_name="location"];
+}
+
+message BoolExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ BoolExprType boolop = 2 [json_name="boolop"];
+ repeated Node args = 3 [json_name="args"];
+ int32 location = 4 [json_name="location"];
+}
+
+message SubLink
+{
+ Node xpr = 1 [json_name="xpr"];
+ SubLinkType sub_link_type = 2 [json_name="subLinkType"];
+ int32 sub_link_id = 3 [json_name="subLinkId"];
+ Node testexpr = 4 [json_name="testexpr"];
+ repeated Node oper_name = 5 [json_name="operName"];
+ Node subselect = 6 [json_name="subselect"];
+ int32 location = 7 [json_name="location"];
+}
+
+message SubPlan
+{
+ Node xpr = 1 [json_name="xpr"];
+ SubLinkType sub_link_type = 2 [json_name="subLinkType"];
+ Node testexpr = 3 [json_name="testexpr"];
+ repeated Node param_ids = 4 [json_name="paramIds"];
+ int32 plan_id = 5 [json_name="plan_id"];
+ string plan_name = 6 [json_name="plan_name"];
+ uint32 first_col_type = 7 [json_name="firstColType"];
+ int32 first_col_typmod = 8 [json_name="firstColTypmod"];
+ uint32 first_col_collation = 9 [json_name="firstColCollation"];
+ bool use_hash_table = 10 [json_name="useHashTable"];
+ bool unknown_eq_false = 11 [json_name="unknownEqFalse"];
+ bool parallel_safe = 12 [json_name="parallel_safe"];
+ repeated Node set_param = 13 [json_name="setParam"];
+ repeated Node par_param = 14 [json_name="parParam"];
+ repeated Node args = 15 [json_name="args"];
+ double startup_cost = 16 [json_name="startup_cost"];
+ double per_call_cost = 17 [json_name="per_call_cost"];
+}
+
+message AlternativeSubPlan
+{
+ Node xpr = 1 [json_name="xpr"];
+ repeated Node subplans = 2 [json_name="subplans"];
+}
+
+message FieldSelect
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ int32 fieldnum = 3 [json_name="fieldnum"];
+ uint32 resulttype = 4 [json_name="resulttype"];
+ int32 resulttypmod = 5 [json_name="resulttypmod"];
+ uint32 resultcollid = 6 [json_name="resultcollid"];
+}
+
+message FieldStore
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ repeated Node newvals = 3 [json_name="newvals"];
+ repeated Node fieldnums = 4 [json_name="fieldnums"];
+ uint32 resulttype = 5 [json_name="resulttype"];
+}
+
+message RelabelType
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ uint32 resulttype = 3 [json_name="resulttype"];
+ int32 resulttypmod = 4 [json_name="resulttypmod"];
+ uint32 resultcollid = 5 [json_name="resultcollid"];
+ CoercionForm relabelformat = 6 [json_name="relabelformat"];
+ int32 location = 7 [json_name="location"];
+}
+
+message CoerceViaIO
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ uint32 resulttype = 3 [json_name="resulttype"];
+ uint32 resultcollid = 4 [json_name="resultcollid"];
+ CoercionForm coerceformat = 5 [json_name="coerceformat"];
+ int32 location = 6 [json_name="location"];
+}
+
+message ArrayCoerceExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ Node elemexpr = 3 [json_name="elemexpr"];
+ uint32 resulttype = 4 [json_name="resulttype"];
+ int32 resulttypmod = 5 [json_name="resulttypmod"];
+ uint32 resultcollid = 6 [json_name="resultcollid"];
+ CoercionForm coerceformat = 7 [json_name="coerceformat"];
+ int32 location = 8 [json_name="location"];
+}
+
+message ConvertRowtypeExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ uint32 resulttype = 3 [json_name="resulttype"];
+ CoercionForm convertformat = 4 [json_name="convertformat"];
+ int32 location = 5 [json_name="location"];
+}
+
+message CollateExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ uint32 coll_oid = 3 [json_name="collOid"];
+ int32 location = 4 [json_name="location"];
+}
+
+message CaseExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 casetype = 2 [json_name="casetype"];
+ uint32 casecollid = 3 [json_name="casecollid"];
+ Node arg = 4 [json_name="arg"];
+ repeated Node args = 5 [json_name="args"];
+ Node defresult = 6 [json_name="defresult"];
+ int32 location = 7 [json_name="location"];
+}
+
+message CaseWhen
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node expr = 2 [json_name="expr"];
+ Node result = 3 [json_name="result"];
+ int32 location = 4 [json_name="location"];
+}
+
+message CaseTestExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 type_id = 2 [json_name="typeId"];
+ int32 type_mod = 3 [json_name="typeMod"];
+ uint32 collation = 4 [json_name="collation"];
+}
+
+message ArrayExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 array_typeid = 2 [json_name="array_typeid"];
+ uint32 array_collid = 3 [json_name="array_collid"];
+ uint32 element_typeid = 4 [json_name="element_typeid"];
+ repeated Node elements = 5 [json_name="elements"];
+ bool multidims = 6 [json_name="multidims"];
+ int32 location = 7 [json_name="location"];
+}
+
+message RowExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ repeated Node args = 2 [json_name="args"];
+ uint32 row_typeid = 3 [json_name="row_typeid"];
+ CoercionForm row_format = 4 [json_name="row_format"];
+ repeated Node colnames = 5 [json_name="colnames"];
+ int32 location = 6 [json_name="location"];
+}
+
+message RowCompareExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ RowCompareType rctype = 2 [json_name="rctype"];
+ repeated Node opnos = 3 [json_name="opnos"];
+ repeated Node opfamilies = 4 [json_name="opfamilies"];
+ repeated Node inputcollids = 5 [json_name="inputcollids"];
+ repeated Node largs = 6 [json_name="largs"];
+ repeated Node rargs = 7 [json_name="rargs"];
+}
+
+message CoalesceExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 coalescetype = 2 [json_name="coalescetype"];
+ uint32 coalescecollid = 3 [json_name="coalescecollid"];
+ repeated Node args = 4 [json_name="args"];
+ int32 location = 5 [json_name="location"];
+}
+
+message MinMaxExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 minmaxtype = 2 [json_name="minmaxtype"];
+ uint32 minmaxcollid = 3 [json_name="minmaxcollid"];
+ uint32 inputcollid = 4 [json_name="inputcollid"];
+ MinMaxOp op = 5 [json_name="op"];
+ repeated Node args = 6 [json_name="args"];
+ int32 location = 7 [json_name="location"];
+}
+
+message SQLValueFunction
+{
+ Node xpr = 1 [json_name="xpr"];
+ SQLValueFunctionOp op = 2 [json_name="op"];
+ uint32 type = 3 [json_name="type"];
+ int32 typmod = 4 [json_name="typmod"];
+ int32 location = 5 [json_name="location"];
+}
+
+message XmlExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ XmlExprOp op = 2 [json_name="op"];
+ string name = 3 [json_name="name"];
+ repeated Node named_args = 4 [json_name="named_args"];
+ repeated Node arg_names = 5 [json_name="arg_names"];
+ repeated Node args = 6 [json_name="args"];
+ XmlOptionType xmloption = 7 [json_name="xmloption"];
+ bool indent = 8 [json_name="indent"];
+ uint32 type = 9 [json_name="type"];
+ int32 typmod = 10 [json_name="typmod"];
+ int32 location = 11 [json_name="location"];
+}
+
+message JsonFormat
+{
+ JsonFormatType format_type = 1 [json_name="format_type"];
+ JsonEncoding encoding = 2 [json_name="encoding"];
+ int32 location = 3 [json_name="location"];
+}
+
+message JsonReturning
+{
+ JsonFormat format = 1 [json_name="format"];
+ uint32 typid = 2 [json_name="typid"];
+ int32 typmod = 3 [json_name="typmod"];
+}
+
+message JsonValueExpr
+{
+ Node raw_expr = 1 [json_name="raw_expr"];
+ Node formatted_expr = 2 [json_name="formatted_expr"];
+ JsonFormat format = 3 [json_name="format"];
+}
+
+message JsonConstructorExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ JsonConstructorType type = 2 [json_name="type"];
+ repeated Node args = 3 [json_name="args"];
+ Node func = 4 [json_name="func"];
+ Node coercion = 5 [json_name="coercion"];
+ JsonReturning returning = 6 [json_name="returning"];
+ bool absent_on_null = 7 [json_name="absent_on_null"];
+ bool unique = 8 [json_name="unique"];
+ int32 location = 9 [json_name="location"];
+}
+
+message JsonIsPredicate
+{
+ Node expr = 1 [json_name="expr"];
+ JsonFormat format = 2 [json_name="format"];
+ JsonValueType item_type = 3 [json_name="item_type"];
+ bool unique_keys = 4 [json_name="unique_keys"];
+ int32 location = 5 [json_name="location"];
+}
+
+message NullTest
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ NullTestType nulltesttype = 3 [json_name="nulltesttype"];
+ bool argisrow = 4 [json_name="argisrow"];
+ int32 location = 5 [json_name="location"];
+}
+
+message BooleanTest
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ BoolTestType booltesttype = 3 [json_name="booltesttype"];
+ int32 location = 4 [json_name="location"];
+}
+
+message CoerceToDomain
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ uint32 resulttype = 3 [json_name="resulttype"];
+ int32 resulttypmod = 4 [json_name="resulttypmod"];
+ uint32 resultcollid = 5 [json_name="resultcollid"];
+ CoercionForm coercionformat = 6 [json_name="coercionformat"];
+ int32 location = 7 [json_name="location"];
+}
+
+message CoerceToDomainValue
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 type_id = 2 [json_name="typeId"];
+ int32 type_mod = 3 [json_name="typeMod"];
+ uint32 collation = 4 [json_name="collation"];
+ int32 location = 5 [json_name="location"];
+}
+
+message SetToDefault
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 type_id = 2 [json_name="typeId"];
+ int32 type_mod = 3 [json_name="typeMod"];
+ uint32 collation = 4 [json_name="collation"];
+ int32 location = 5 [json_name="location"];
+}
+
+message CurrentOfExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 cvarno = 2 [json_name="cvarno"];
+ string cursor_name = 3 [json_name="cursor_name"];
+ int32 cursor_param = 4 [json_name="cursor_param"];
+}
+
+message NextValueExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 seqid = 2 [json_name="seqid"];
+ uint32 type_id = 3 [json_name="typeId"];
+}
+
+message InferenceElem
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node expr = 2 [json_name="expr"];
+ uint32 infercollid = 3 [json_name="infercollid"];
+ uint32 inferopclass = 4 [json_name="inferopclass"];
+}
+
+message TargetEntry
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node expr = 2 [json_name="expr"];
+ int32 resno = 3 [json_name="resno"];
+ string resname = 4 [json_name="resname"];
+ uint32 ressortgroupref = 5 [json_name="ressortgroupref"];
+ uint32 resorigtbl = 6 [json_name="resorigtbl"];
+ int32 resorigcol = 7 [json_name="resorigcol"];
+ bool resjunk = 8 [json_name="resjunk"];
+}
+
+message RangeTblRef
+{
+ int32 rtindex = 1 [json_name="rtindex"];
+}
+
+message JoinExpr
+{
+ JoinType jointype = 1 [json_name="jointype"];
+ bool is_natural = 2 [json_name="isNatural"];
+ Node larg = 3 [json_name="larg"];
+ Node rarg = 4 [json_name="rarg"];
+ repeated Node using_clause = 5 [json_name="usingClause"];
+ Alias join_using_alias = 6 [json_name="join_using_alias"];
+ Node quals = 7 [json_name="quals"];
+ Alias alias = 8 [json_name="alias"];
+ int32 rtindex = 9 [json_name="rtindex"];
+}
+
+message FromExpr
+{
+ repeated Node fromlist = 1 [json_name="fromlist"];
+ Node quals = 2 [json_name="quals"];
+}
+
+message OnConflictExpr
+{
+ OnConflictAction action = 1 [json_name="action"];
+ repeated Node arbiter_elems = 2 [json_name="arbiterElems"];
+ Node arbiter_where = 3 [json_name="arbiterWhere"];
+ uint32 constraint = 4 [json_name="constraint"];
+ repeated Node on_conflict_set = 5 [json_name="onConflictSet"];
+ Node on_conflict_where = 6 [json_name="onConflictWhere"];
+ int32 excl_rel_index = 7 [json_name="exclRelIndex"];
+ repeated Node excl_rel_tlist = 8 [json_name="exclRelTlist"];
+}
+
+message Query
+{
+ CmdType command_type = 1 [json_name="commandType"];
+ QuerySource query_source = 2 [json_name="querySource"];
+ bool can_set_tag = 3 [json_name="canSetTag"];
+ Node utility_stmt = 4 [json_name="utilityStmt"];
+ int32 result_relation = 5 [json_name="resultRelation"];
+ bool has_aggs = 6 [json_name="hasAggs"];
+ bool has_window_funcs = 7 [json_name="hasWindowFuncs"];
+ bool has_target_srfs = 8 [json_name="hasTargetSRFs"];
+ bool has_sub_links = 9 [json_name="hasSubLinks"];
+ bool has_distinct_on = 10 [json_name="hasDistinctOn"];
+ bool has_recursive = 11 [json_name="hasRecursive"];
+ bool has_modifying_cte = 12 [json_name="hasModifyingCTE"];
+ bool has_for_update = 13 [json_name="hasForUpdate"];
+ bool has_row_security = 14 [json_name="hasRowSecurity"];
+ bool is_return = 15 [json_name="isReturn"];
+ repeated Node cte_list = 16 [json_name="cteList"];
+ repeated Node rtable = 17 [json_name="rtable"];
+ repeated Node rteperminfos = 18 [json_name="rteperminfos"];
+ FromExpr jointree = 19 [json_name="jointree"];
+ repeated Node merge_action_list = 20 [json_name="mergeActionList"];
+ bool merge_use_outer_join = 21 [json_name="mergeUseOuterJoin"];
+ repeated Node target_list = 22 [json_name="targetList"];
+ OverridingKind override = 23 [json_name="override"];
+ OnConflictExpr on_conflict = 24 [json_name="onConflict"];
+ repeated Node returning_list = 25 [json_name="returningList"];
+ repeated Node group_clause = 26 [json_name="groupClause"];
+ bool group_distinct = 27 [json_name="groupDistinct"];
+ repeated Node grouping_sets = 28 [json_name="groupingSets"];
+ Node having_qual = 29 [json_name="havingQual"];
+ repeated Node window_clause = 30 [json_name="windowClause"];
+ repeated Node distinct_clause = 31 [json_name="distinctClause"];
+ repeated Node sort_clause = 32 [json_name="sortClause"];
+ Node limit_offset = 33 [json_name="limitOffset"];
+ Node limit_count = 34 [json_name="limitCount"];
+ LimitOption limit_option = 35 [json_name="limitOption"];
+ repeated Node row_marks = 36 [json_name="rowMarks"];
+ Node set_operations = 37 [json_name="setOperations"];
+ repeated Node constraint_deps = 38 [json_name="constraintDeps"];
+ repeated Node with_check_options = 39 [json_name="withCheckOptions"];
+ int32 stmt_location = 40 [json_name="stmt_location"];
+ int32 stmt_len = 41 [json_name="stmt_len"];
+}
+
+message TypeName
+{
+ repeated Node names = 1 [json_name="names"];
+ uint32 type_oid = 2 [json_name="typeOid"];
+ bool setof = 3 [json_name="setof"];
+ bool pct_type = 4 [json_name="pct_type"];
+ repeated Node typmods = 5 [json_name="typmods"];
+ int32 typemod = 6 [json_name="typemod"];
+ repeated Node array_bounds = 7 [json_name="arrayBounds"];
+ int32 location = 8 [json_name="location"];
+}
+
+message ColumnRef
+{
+ repeated Node fields = 1 [json_name="fields"];
+ int32 location = 2 [json_name="location"];
+}
+
+message ParamRef
+{
+ int32 number = 1 [json_name="number"];
+ int32 location = 2 [json_name="location"];
+}
+
+message A_Expr
+{
+ A_Expr_Kind kind = 1 [json_name="kind"];
+ repeated Node name = 2 [json_name="name"];
+ Node lexpr = 3 [json_name="lexpr"];
+ Node rexpr = 4 [json_name="rexpr"];
+ int32 location = 5 [json_name="location"];
+}
+
+message TypeCast
+{
+ Node arg = 1 [json_name="arg"];
+ TypeName type_name = 2 [json_name="typeName"];
+ int32 location = 3 [json_name="location"];
+}
+
+message CollateClause
+{
+ Node arg = 1 [json_name="arg"];
+ repeated Node collname = 2 [json_name="collname"];
+ int32 location = 3 [json_name="location"];
+}
+
+message RoleSpec
+{
+ RoleSpecType roletype = 1 [json_name="roletype"];
+ string rolename = 2 [json_name="rolename"];
+ int32 location = 3 [json_name="location"];
+}
+
+message FuncCall
+{
+ repeated Node funcname = 1 [json_name="funcname"];
+ repeated Node args = 2 [json_name="args"];
+ repeated Node agg_order = 3 [json_name="agg_order"];
+ Node agg_filter = 4 [json_name="agg_filter"];
+ WindowDef over = 5 [json_name="over"];
+ bool agg_within_group = 6 [json_name="agg_within_group"];
+ bool agg_star = 7 [json_name="agg_star"];
+ bool agg_distinct = 8 [json_name="agg_distinct"];
+ bool func_variadic = 9 [json_name="func_variadic"];
+ CoercionForm funcformat = 10 [json_name="funcformat"];
+ int32 location = 11 [json_name="location"];
+}
+
+message A_Star
+{
+}
+
+message A_Indices
+{
+ bool is_slice = 1 [json_name="is_slice"];
+ Node lidx = 2 [json_name="lidx"];
+ Node uidx = 3 [json_name="uidx"];
+}
+
+message A_Indirection
+{
+ Node arg = 1 [json_name="arg"];
+ repeated Node indirection = 2 [json_name="indirection"];
+}
+
+message A_ArrayExpr
+{
+ repeated Node elements = 1 [json_name="elements"];
+ int32 location = 2 [json_name="location"];
+}
+
+message ResTarget
+{
+ string name = 1 [json_name="name"];
+ repeated Node indirection = 2 [json_name="indirection"];
+ Node val = 3 [json_name="val"];
+ int32 location = 4 [json_name="location"];
+}
+
+message MultiAssignRef
+{
+ Node source = 1 [json_name="source"];
+ int32 colno = 2 [json_name="colno"];
+ int32 ncolumns = 3 [json_name="ncolumns"];
+}
+
+message SortBy
+{
+ Node node = 1 [json_name="node"];
+ SortByDir sortby_dir = 2 [json_name="sortby_dir"];
+ SortByNulls sortby_nulls = 3 [json_name="sortby_nulls"];
+ repeated Node use_op = 4 [json_name="useOp"];
+ int32 location = 5 [json_name="location"];
+}
+
+message WindowDef
+{
+ string name = 1 [json_name="name"];
+ string refname = 2 [json_name="refname"];
+ repeated Node partition_clause = 3 [json_name="partitionClause"];
+ repeated Node order_clause = 4 [json_name="orderClause"];
+ int32 frame_options = 5 [json_name="frameOptions"];
+ Node start_offset = 6 [json_name="startOffset"];
+ Node end_offset = 7 [json_name="endOffset"];
+ int32 location = 8 [json_name="location"];
+}
+
+message RangeSubselect
+{
+ bool lateral = 1 [json_name="lateral"];
+ Node subquery = 2 [json_name="subquery"];
+ Alias alias = 3 [json_name="alias"];
+}
+
+message RangeFunction
+{
+ bool lateral = 1 [json_name="lateral"];
+ bool ordinality = 2 [json_name="ordinality"];
+ bool is_rowsfrom = 3 [json_name="is_rowsfrom"];
+ repeated Node functions = 4 [json_name="functions"];
+ Alias alias = 5 [json_name="alias"];
+ repeated Node coldeflist = 6 [json_name="coldeflist"];
+}
+
+message RangeTableFunc
+{
+ bool lateral = 1 [json_name="lateral"];
+ Node docexpr = 2 [json_name="docexpr"];
+ Node rowexpr = 3 [json_name="rowexpr"];
+ repeated Node namespaces = 4 [json_name="namespaces"];
+ repeated Node columns = 5 [json_name="columns"];
+ Alias alias = 6 [json_name="alias"];
+ int32 location = 7 [json_name="location"];
+}
+
+message RangeTableFuncCol
+{
+ string colname = 1 [json_name="colname"];
+ TypeName type_name = 2 [json_name="typeName"];
+ bool for_ordinality = 3 [json_name="for_ordinality"];
+ bool is_not_null = 4 [json_name="is_not_null"];
+ Node colexpr = 5 [json_name="colexpr"];
+ Node coldefexpr = 6 [json_name="coldefexpr"];
+ int32 location = 7 [json_name="location"];
+}
+
+message RangeTableSample
+{
+ Node relation = 1 [json_name="relation"];
+ repeated Node method = 2 [json_name="method"];
+ repeated Node args = 3 [json_name="args"];
+ Node repeatable = 4 [json_name="repeatable"];
+ int32 location = 5 [json_name="location"];
+}
+
+message ColumnDef
+{
+ string colname = 1 [json_name="colname"];
+ TypeName type_name = 2 [json_name="typeName"];
+ string compression = 3 [json_name="compression"];
+ int32 inhcount = 4 [json_name="inhcount"];
+ bool is_local = 5 [json_name="is_local"];
+ bool is_not_null = 6 [json_name="is_not_null"];
+ bool is_from_type = 7 [json_name="is_from_type"];
+ string storage = 8 [json_name="storage"];
+ string storage_name = 9 [json_name="storage_name"];
+ Node raw_default = 10 [json_name="raw_default"];
+ Node cooked_default = 11 [json_name="cooked_default"];
+ string identity = 12 [json_name="identity"];
+ RangeVar identity_sequence = 13 [json_name="identitySequence"];
+ string generated = 14 [json_name="generated"];
+ CollateClause coll_clause = 15 [json_name="collClause"];
+ uint32 coll_oid = 16 [json_name="collOid"];
+ repeated Node constraints = 17 [json_name="constraints"];
+ repeated Node fdwoptions = 18 [json_name="fdwoptions"];
+ int32 location = 19 [json_name="location"];
+}
+
+message TableLikeClause
+{
+ RangeVar relation = 1 [json_name="relation"];
+ uint32 options = 2 [json_name="options"];
+ uint32 relation_oid = 3 [json_name="relationOid"];
+}
+
+message IndexElem
+{
+ string name = 1 [json_name="name"];
+ Node expr = 2 [json_name="expr"];
+ string indexcolname = 3 [json_name="indexcolname"];
+ repeated Node collation = 4 [json_name="collation"];
+ repeated Node opclass = 5 [json_name="opclass"];
+ repeated Node opclassopts = 6 [json_name="opclassopts"];
+ SortByDir ordering = 7 [json_name="ordering"];
+ SortByNulls nulls_ordering = 8 [json_name="nulls_ordering"];
+}
+
+message DefElem
+{
+ string defnamespace = 1 [json_name="defnamespace"];
+ string defname = 2 [json_name="defname"];
+ Node arg = 3 [json_name="arg"];
+ DefElemAction defaction = 4 [json_name="defaction"];
+ int32 location = 5 [json_name="location"];
+}
+
+message LockingClause
+{
+ repeated Node locked_rels = 1 [json_name="lockedRels"];
+ LockClauseStrength strength = 2 [json_name="strength"];
+ LockWaitPolicy wait_policy = 3 [json_name="waitPolicy"];
+}
+
+message XmlSerialize
+{
+ XmlOptionType xmloption = 1 [json_name="xmloption"];
+ Node expr = 2 [json_name="expr"];
+ TypeName type_name = 3 [json_name="typeName"];
+ bool indent = 4 [json_name="indent"];
+ int32 location = 5 [json_name="location"];
+}
+
+message PartitionElem
+{
+ string name = 1 [json_name="name"];
+ Node expr = 2 [json_name="expr"];
+ repeated Node collation = 3 [json_name="collation"];
+ repeated Node opclass = 4 [json_name="opclass"];
+ int32 location = 5 [json_name="location"];
+}
+
+message PartitionSpec
+{
+ PartitionStrategy strategy = 1 [json_name="strategy"];
+ repeated Node part_params = 2 [json_name="partParams"];
+ int32 location = 3 [json_name="location"];
+}
+
+message PartitionBoundSpec
+{
+ string strategy = 1 [json_name="strategy"];
+ bool is_default = 2 [json_name="is_default"];
+ int32 modulus = 3 [json_name="modulus"];
+ int32 remainder = 4 [json_name="remainder"];
+ repeated Node listdatums = 5 [json_name="listdatums"];
+ repeated Node lowerdatums = 6 [json_name="lowerdatums"];
+ repeated Node upperdatums = 7 [json_name="upperdatums"];
+ int32 location = 8 [json_name="location"];
+}
+
+message PartitionRangeDatum
+{
+ PartitionRangeDatumKind kind = 1 [json_name="kind"];
+ Node value = 2 [json_name="value"];
+ int32 location = 3 [json_name="location"];
+}
+
+message PartitionCmd
+{
+ RangeVar name = 1 [json_name="name"];
+ PartitionBoundSpec bound = 2 [json_name="bound"];
+ bool concurrent = 3 [json_name="concurrent"];
+}
+
+message RangeTblEntry
+{
+ RTEKind rtekind = 1 [json_name="rtekind"];
+ uint32 relid = 2 [json_name="relid"];
+ string relkind = 3 [json_name="relkind"];
+ int32 rellockmode = 4 [json_name="rellockmode"];
+ TableSampleClause tablesample = 5 [json_name="tablesample"];
+ uint32 perminfoindex = 6 [json_name="perminfoindex"];
+ Query subquery = 7 [json_name="subquery"];
+ bool security_barrier = 8 [json_name="security_barrier"];
+ JoinType jointype = 9 [json_name="jointype"];
+ int32 joinmergedcols = 10 [json_name="joinmergedcols"];
+ repeated Node joinaliasvars = 11 [json_name="joinaliasvars"];
+ repeated Node joinleftcols = 12 [json_name="joinleftcols"];
+ repeated Node joinrightcols = 13 [json_name="joinrightcols"];
+ Alias join_using_alias = 14 [json_name="join_using_alias"];
+ repeated Node functions = 15 [json_name="functions"];
+ bool funcordinality = 16 [json_name="funcordinality"];
+ TableFunc tablefunc = 17 [json_name="tablefunc"];
+ repeated Node values_lists = 18 [json_name="values_lists"];
+ string ctename = 19 [json_name="ctename"];
+ uint32 ctelevelsup = 20 [json_name="ctelevelsup"];
+ bool self_reference = 21 [json_name="self_reference"];
+ repeated Node coltypes = 22 [json_name="coltypes"];
+ repeated Node coltypmods = 23 [json_name="coltypmods"];
+ repeated Node colcollations = 24 [json_name="colcollations"];
+ string enrname = 25 [json_name="enrname"];
+ double enrtuples = 26 [json_name="enrtuples"];
+ Alias alias = 27 [json_name="alias"];
+ Alias eref = 28 [json_name="eref"];
+ bool lateral = 29 [json_name="lateral"];
+ bool inh = 30 [json_name="inh"];
+ bool in_from_cl = 31 [json_name="inFromCl"];
+ repeated Node security_quals = 32 [json_name="securityQuals"];
+}
+
+message RTEPermissionInfo
+{
+ uint32 relid = 1 [json_name="relid"];
+ bool inh = 2 [json_name="inh"];
+ uint64 required_perms = 3 [json_name="requiredPerms"];
+ uint32 check_as_user = 4 [json_name="checkAsUser"];
+ repeated uint64 selected_cols = 5 [json_name="selectedCols"];
+ repeated uint64 inserted_cols = 6 [json_name="insertedCols"];
+ repeated uint64 updated_cols = 7 [json_name="updatedCols"];
+}
+
+message RangeTblFunction
+{
+ Node funcexpr = 1 [json_name="funcexpr"];
+ int32 funccolcount = 2 [json_name="funccolcount"];
+ repeated Node funccolnames = 3 [json_name="funccolnames"];
+ repeated Node funccoltypes = 4 [json_name="funccoltypes"];
+ repeated Node funccoltypmods = 5 [json_name="funccoltypmods"];
+ repeated Node funccolcollations = 6 [json_name="funccolcollations"];
+ repeated uint64 funcparams = 7 [json_name="funcparams"];
+}
+
+message TableSampleClause
+{
+ uint32 tsmhandler = 1 [json_name="tsmhandler"];
+ repeated Node args = 2 [json_name="args"];
+ Node repeatable = 3 [json_name="repeatable"];
+}
+
+message WithCheckOption
+{
+ WCOKind kind = 1 [json_name="kind"];
+ string relname = 2 [json_name="relname"];
+ string polname = 3 [json_name="polname"];
+ Node qual = 4 [json_name="qual"];
+ bool cascaded = 5 [json_name="cascaded"];
+}
+
+message SortGroupClause
+{
+ uint32 tle_sort_group_ref = 1 [json_name="tleSortGroupRef"];
+ uint32 eqop = 2 [json_name="eqop"];
+ uint32 sortop = 3 [json_name="sortop"];
+ bool nulls_first = 4 [json_name="nulls_first"];
+ bool hashable = 5 [json_name="hashable"];
+}
+
+message GroupingSet
+{
+ GroupingSetKind kind = 1 [json_name="kind"];
+ repeated Node content = 2 [json_name="content"];
+ int32 location = 3 [json_name="location"];
+}
+
+message WindowClause
+{
+ string name = 1 [json_name="name"];
+ string refname = 2 [json_name="refname"];
+ repeated Node partition_clause = 3 [json_name="partitionClause"];
+ repeated Node order_clause = 4 [json_name="orderClause"];
+ int32 frame_options = 5 [json_name="frameOptions"];
+ Node start_offset = 6 [json_name="startOffset"];
+ Node end_offset = 7 [json_name="endOffset"];
+ repeated Node run_condition = 8 [json_name="runCondition"];
+ uint32 start_in_range_func = 9 [json_name="startInRangeFunc"];
+ uint32 end_in_range_func = 10 [json_name="endInRangeFunc"];
+ uint32 in_range_coll = 11 [json_name="inRangeColl"];
+ bool in_range_asc = 12 [json_name="inRangeAsc"];
+ bool in_range_nulls_first = 13 [json_name="inRangeNullsFirst"];
+ uint32 winref = 14 [json_name="winref"];
+ bool copied_order = 15 [json_name="copiedOrder"];
+}
+
+message RowMarkClause
+{
+ uint32 rti = 1 [json_name="rti"];
+ LockClauseStrength strength = 2 [json_name="strength"];
+ LockWaitPolicy wait_policy = 3 [json_name="waitPolicy"];
+ bool pushed_down = 4 [json_name="pushedDown"];
+}
+
+message WithClause
+{
+ repeated Node ctes = 1 [json_name="ctes"];
+ bool recursive = 2 [json_name="recursive"];
+ int32 location = 3 [json_name="location"];
+}
+
+message InferClause
+{
+ repeated Node index_elems = 1 [json_name="indexElems"];
+ Node where_clause = 2 [json_name="whereClause"];
+ string conname = 3 [json_name="conname"];
+ int32 location = 4 [json_name="location"];
+}
+
+message OnConflictClause
+{
+ OnConflictAction action = 1 [json_name="action"];
+ InferClause infer = 2 [json_name="infer"];
+ repeated Node target_list = 3 [json_name="targetList"];
+ Node where_clause = 4 [json_name="whereClause"];
+ int32 location = 5 [json_name="location"];
+}
+
+message CTESearchClause
+{
+ repeated Node search_col_list = 1 [json_name="search_col_list"];
+ bool search_breadth_first = 2 [json_name="search_breadth_first"];
+ string search_seq_column = 3 [json_name="search_seq_column"];
+ int32 location = 4 [json_name="location"];
+}
+
+message CTECycleClause
+{
+ repeated Node cycle_col_list = 1 [json_name="cycle_col_list"];
+ string cycle_mark_column = 2 [json_name="cycle_mark_column"];
+ Node cycle_mark_value = 3 [json_name="cycle_mark_value"];
+ Node cycle_mark_default = 4 [json_name="cycle_mark_default"];
+ string cycle_path_column = 5 [json_name="cycle_path_column"];
+ int32 location = 6 [json_name="location"];
+ uint32 cycle_mark_type = 7 [json_name="cycle_mark_type"];
+ int32 cycle_mark_typmod = 8 [json_name="cycle_mark_typmod"];
+ uint32 cycle_mark_collation = 9 [json_name="cycle_mark_collation"];
+ uint32 cycle_mark_neop = 10 [json_name="cycle_mark_neop"];
+}
+
+message CommonTableExpr
+{
+ string ctename = 1 [json_name="ctename"];
+ repeated Node aliascolnames = 2 [json_name="aliascolnames"];
+ CTEMaterialize ctematerialized = 3 [json_name="ctematerialized"];
+ Node ctequery = 4 [json_name="ctequery"];
+ CTESearchClause search_clause = 5 [json_name="search_clause"];
+ CTECycleClause cycle_clause = 6 [json_name="cycle_clause"];
+ int32 location = 7 [json_name="location"];
+ bool cterecursive = 8 [json_name="cterecursive"];
+ int32 cterefcount = 9 [json_name="cterefcount"];
+ repeated Node ctecolnames = 10 [json_name="ctecolnames"];
+ repeated Node ctecoltypes = 11 [json_name="ctecoltypes"];
+ repeated Node ctecoltypmods = 12 [json_name="ctecoltypmods"];
+ repeated Node ctecolcollations = 13 [json_name="ctecolcollations"];
+}
+
+message MergeWhenClause
+{
+ bool matched = 1 [json_name="matched"];
+ CmdType command_type = 2 [json_name="commandType"];
+ OverridingKind override = 3 [json_name="override"];
+ Node condition = 4 [json_name="condition"];
+ repeated Node target_list = 5 [json_name="targetList"];
+ repeated Node values = 6 [json_name="values"];
+}
+
+message MergeAction
+{
+ bool matched = 1 [json_name="matched"];
+ CmdType command_type = 2 [json_name="commandType"];
+ OverridingKind override = 3 [json_name="override"];
+ Node qual = 4 [json_name="qual"];
+ repeated Node target_list = 5 [json_name="targetList"];
+ repeated Node update_colnos = 6 [json_name="updateColnos"];
+}
+
+message TriggerTransition
+{
+ string name = 1 [json_name="name"];
+ bool is_new = 2 [json_name="isNew"];
+ bool is_table = 3 [json_name="isTable"];
+}
+
+message JsonOutput
+{
+ TypeName type_name = 1 [json_name="typeName"];
+ JsonReturning returning = 2 [json_name="returning"];
+}
+
+message JsonKeyValue
+{
+ Node key = 1 [json_name="key"];
+ JsonValueExpr value = 2 [json_name="value"];
+}
+
+message JsonObjectConstructor
+{
+ repeated Node exprs = 1 [json_name="exprs"];
+ JsonOutput output = 2 [json_name="output"];
+ bool absent_on_null = 3 [json_name="absent_on_null"];
+ bool unique = 4 [json_name="unique"];
+ int32 location = 5 [json_name="location"];
+}
+
+message JsonArrayConstructor
+{
+ repeated Node exprs = 1 [json_name="exprs"];
+ JsonOutput output = 2 [json_name="output"];
+ bool absent_on_null = 3 [json_name="absent_on_null"];
+ int32 location = 4 [json_name="location"];
+}
+
+message JsonArrayQueryConstructor
+{
+ Node query = 1 [json_name="query"];
+ JsonOutput output = 2 [json_name="output"];
+ JsonFormat format = 3 [json_name="format"];
+ bool absent_on_null = 4 [json_name="absent_on_null"];
+ int32 location = 5 [json_name="location"];
+}
+
+message JsonAggConstructor
+{
+ JsonOutput output = 1 [json_name="output"];
+ Node agg_filter = 2 [json_name="agg_filter"];
+ repeated Node agg_order = 3 [json_name="agg_order"];
+ WindowDef over = 4 [json_name="over"];
+ int32 location = 5 [json_name="location"];
+}
+
+message JsonObjectAgg
+{
+ JsonAggConstructor constructor = 1 [json_name="constructor"];
+ JsonKeyValue arg = 2 [json_name="arg"];
+ bool absent_on_null = 3 [json_name="absent_on_null"];
+ bool unique = 4 [json_name="unique"];
+}
+
+message JsonArrayAgg
+{
+ JsonAggConstructor constructor = 1 [json_name="constructor"];
+ JsonValueExpr arg = 2 [json_name="arg"];
+ bool absent_on_null = 3 [json_name="absent_on_null"];
+}
+
+message RawStmt
+{
+ Node stmt = 1 [json_name="stmt"];
+ int32 stmt_location = 2 [json_name="stmt_location"];
+ int32 stmt_len = 3 [json_name="stmt_len"];
+}
+
+message InsertStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ repeated Node cols = 2 [json_name="cols"];
+ Node select_stmt = 3 [json_name="selectStmt"];
+ OnConflictClause on_conflict_clause = 4 [json_name="onConflictClause"];
+ repeated Node returning_list = 5 [json_name="returningList"];
+ WithClause with_clause = 6 [json_name="withClause"];
+ OverridingKind override = 7 [json_name="override"];
+}
+
+message DeleteStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ repeated Node using_clause = 2 [json_name="usingClause"];
+ Node where_clause = 3 [json_name="whereClause"];
+ repeated Node returning_list = 4 [json_name="returningList"];
+ WithClause with_clause = 5 [json_name="withClause"];
+}
+
+message UpdateStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ repeated Node target_list = 2 [json_name="targetList"];
+ Node where_clause = 3 [json_name="whereClause"];
+ repeated Node from_clause = 4 [json_name="fromClause"];
+ repeated Node returning_list = 5 [json_name="returningList"];
+ WithClause with_clause = 6 [json_name="withClause"];
+}
+
+message MergeStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ Node source_relation = 2 [json_name="sourceRelation"];
+ Node join_condition = 3 [json_name="joinCondition"];
+ repeated Node merge_when_clauses = 4 [json_name="mergeWhenClauses"];
+ WithClause with_clause = 5 [json_name="withClause"];
+}
+
+message SelectStmt
+{
+ repeated Node distinct_clause = 1 [json_name="distinctClause"];
+ IntoClause into_clause = 2 [json_name="intoClause"];
+ repeated Node target_list = 3 [json_name="targetList"];
+ repeated Node from_clause = 4 [json_name="fromClause"];
+ Node where_clause = 5 [json_name="whereClause"];
+ repeated Node group_clause = 6 [json_name="groupClause"];
+ bool group_distinct = 7 [json_name="groupDistinct"];
+ Node having_clause = 8 [json_name="havingClause"];
+ repeated Node window_clause = 9 [json_name="windowClause"];
+ repeated Node values_lists = 10 [json_name="valuesLists"];
+ repeated Node sort_clause = 11 [json_name="sortClause"];
+ Node limit_offset = 12 [json_name="limitOffset"];
+ Node limit_count = 13 [json_name="limitCount"];
+ LimitOption limit_option = 14 [json_name="limitOption"];
+ repeated Node locking_clause = 15 [json_name="lockingClause"];
+ WithClause with_clause = 16 [json_name="withClause"];
+ SetOperation op = 17 [json_name="op"];
+ bool all = 18 [json_name="all"];
+ SelectStmt larg = 19 [json_name="larg"];
+ SelectStmt rarg = 20 [json_name="rarg"];
+}
+
+message SetOperationStmt
+{
+ SetOperation op = 1 [json_name="op"];
+ bool all = 2 [json_name="all"];
+ Node larg = 3 [json_name="larg"];
+ Node rarg = 4 [json_name="rarg"];
+ repeated Node col_types = 5 [json_name="colTypes"];
+ repeated Node col_typmods = 6 [json_name="colTypmods"];
+ repeated Node col_collations = 7 [json_name="colCollations"];
+ repeated Node group_clauses = 8 [json_name="groupClauses"];
+}
+
+message ReturnStmt
+{
+ Node returnval = 1 [json_name="returnval"];
+}
+
+message PLAssignStmt
+{
+ string name = 1 [json_name="name"];
+ repeated Node indirection = 2 [json_name="indirection"];
+ int32 nnames = 3 [json_name="nnames"];
+ SelectStmt val = 4 [json_name="val"];
+ int32 location = 5 [json_name="location"];
+}
+
+message CreateSchemaStmt
+{
+ string schemaname = 1 [json_name="schemaname"];
+ RoleSpec authrole = 2 [json_name="authrole"];
+ repeated Node schema_elts = 3 [json_name="schemaElts"];
+ bool if_not_exists = 4 [json_name="if_not_exists"];
+}
+
+message AlterTableStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ repeated Node cmds = 2 [json_name="cmds"];
+ ObjectType objtype = 3 [json_name="objtype"];
+ bool missing_ok = 4 [json_name="missing_ok"];
+}
+
+message ReplicaIdentityStmt
+{
+ string identity_type = 1 [json_name="identity_type"];
+ string name = 2 [json_name="name"];
+}
+
+message AlterTableCmd
+{
+ AlterTableType subtype = 1 [json_name="subtype"];
+ string name = 2 [json_name="name"];
+ int32 num = 3 [json_name="num"];
+ RoleSpec newowner = 4 [json_name="newowner"];
+ Node def = 5 [json_name="def"];
+ DropBehavior behavior = 6 [json_name="behavior"];
+ bool missing_ok = 7 [json_name="missing_ok"];
+ bool recurse = 8 [json_name="recurse"];
+}
+
+message AlterCollationStmt
+{
+ repeated Node collname = 1 [json_name="collname"];
+}
+
+message AlterDomainStmt
+{
+ string subtype = 1 [json_name="subtype"];
+ repeated Node type_name = 2 [json_name="typeName"];
+ string name = 3 [json_name="name"];
+ Node def = 4 [json_name="def"];
+ DropBehavior behavior = 5 [json_name="behavior"];
+ bool missing_ok = 6 [json_name="missing_ok"];
+}
+
+message GrantStmt
+{
+ bool is_grant = 1 [json_name="is_grant"];
+ GrantTargetType targtype = 2 [json_name="targtype"];
+ ObjectType objtype = 3 [json_name="objtype"];
+ repeated Node objects = 4 [json_name="objects"];
+ repeated Node privileges = 5 [json_name="privileges"];
+ repeated Node grantees = 6 [json_name="grantees"];
+ bool grant_option = 7 [json_name="grant_option"];
+ RoleSpec grantor = 8 [json_name="grantor"];
+ DropBehavior behavior = 9 [json_name="behavior"];
+}
+
+message ObjectWithArgs
+{
+ repeated Node objname = 1 [json_name="objname"];
+ repeated Node objargs = 2 [json_name="objargs"];
+ repeated Node objfuncargs = 3 [json_name="objfuncargs"];
+ bool args_unspecified = 4 [json_name="args_unspecified"];
+}
+
+message AccessPriv
+{
+ string priv_name = 1 [json_name="priv_name"];
+ repeated Node cols = 2 [json_name="cols"];
+}
+
+message GrantRoleStmt
+{
+ repeated Node granted_roles = 1 [json_name="granted_roles"];
+ repeated Node grantee_roles = 2 [json_name="grantee_roles"];
+ bool is_grant = 3 [json_name="is_grant"];
+ repeated Node opt = 4 [json_name="opt"];
+ RoleSpec grantor = 5 [json_name="grantor"];
+ DropBehavior behavior = 6 [json_name="behavior"];
+}
+
+message AlterDefaultPrivilegesStmt
+{
+ repeated Node options = 1 [json_name="options"];
+ GrantStmt action = 2 [json_name="action"];
+}
+
+message CopyStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ Node query = 2 [json_name="query"];
+ repeated Node attlist = 3 [json_name="attlist"];
+ bool is_from = 4 [json_name="is_from"];
+ bool is_program = 5 [json_name="is_program"];
+ string filename = 6 [json_name="filename"];
+ repeated Node options = 7 [json_name="options"];
+ Node where_clause = 8 [json_name="whereClause"];
+}
+
+message VariableSetStmt
+{
+ VariableSetKind kind = 1 [json_name="kind"];
+ string name = 2 [json_name="name"];
+ repeated Node args = 3 [json_name="args"];
+ bool is_local = 4 [json_name="is_local"];
+}
+
+message VariableShowStmt
+{
+ string name = 1 [json_name="name"];
+}
+
+message CreateStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ repeated Node table_elts = 2 [json_name="tableElts"];
+ repeated Node inh_relations = 3 [json_name="inhRelations"];
+ PartitionBoundSpec partbound = 4 [json_name="partbound"];
+ PartitionSpec partspec = 5 [json_name="partspec"];
+ TypeName of_typename = 6 [json_name="ofTypename"];
+ repeated Node constraints = 7 [json_name="constraints"];
+ repeated Node options = 8 [json_name="options"];
+ OnCommitAction oncommit = 9 [json_name="oncommit"];
+ string tablespacename = 10 [json_name="tablespacename"];
+ string access_method = 11 [json_name="accessMethod"];
+ bool if_not_exists = 12 [json_name="if_not_exists"];
+}
+
+message Constraint
+{
+ ConstrType contype = 1 [json_name="contype"];
+ string conname = 2 [json_name="conname"];
+ bool deferrable = 3 [json_name="deferrable"];
+ bool initdeferred = 4 [json_name="initdeferred"];
+ int32 location = 5 [json_name="location"];
+ bool is_no_inherit = 6 [json_name="is_no_inherit"];
+ Node raw_expr = 7 [json_name="raw_expr"];
+ string cooked_expr = 8 [json_name="cooked_expr"];
+ string generated_when = 9 [json_name="generated_when"];
+ bool nulls_not_distinct = 10 [json_name="nulls_not_distinct"];
+ repeated Node keys = 11 [json_name="keys"];
+ repeated Node including = 12 [json_name="including"];
+ repeated Node exclusions = 13 [json_name="exclusions"];
+ repeated Node options = 14 [json_name="options"];
+ string indexname = 15 [json_name="indexname"];
+ string indexspace = 16 [json_name="indexspace"];
+ bool reset_default_tblspc = 17 [json_name="reset_default_tblspc"];
+ string access_method = 18 [json_name="access_method"];
+ Node where_clause = 19 [json_name="where_clause"];
+ RangeVar pktable = 20 [json_name="pktable"];
+ repeated Node fk_attrs = 21 [json_name="fk_attrs"];
+ repeated Node pk_attrs = 22 [json_name="pk_attrs"];
+ string fk_matchtype = 23 [json_name="fk_matchtype"];
+ string fk_upd_action = 24 [json_name="fk_upd_action"];
+ string fk_del_action = 25 [json_name="fk_del_action"];
+ repeated Node fk_del_set_cols = 26 [json_name="fk_del_set_cols"];
+ repeated Node old_conpfeqop = 27 [json_name="old_conpfeqop"];
+ uint32 old_pktable_oid = 28 [json_name="old_pktable_oid"];
+ bool skip_validation = 29 [json_name="skip_validation"];
+ bool initially_valid = 30 [json_name="initially_valid"];
+}
+
+message CreateTableSpaceStmt
+{
+ string tablespacename = 1 [json_name="tablespacename"];
+ RoleSpec owner = 2 [json_name="owner"];
+ string location = 3 [json_name="location"];
+ repeated Node options = 4 [json_name="options"];
+}
+
+message DropTableSpaceStmt
+{
+ string tablespacename = 1 [json_name="tablespacename"];
+ bool missing_ok = 2 [json_name="missing_ok"];
+}
+
+message AlterTableSpaceOptionsStmt
+{
+ string tablespacename = 1 [json_name="tablespacename"];
+ repeated Node options = 2 [json_name="options"];
+ bool is_reset = 3 [json_name="isReset"];
+}
+
+message AlterTableMoveAllStmt
+{
+ string orig_tablespacename = 1 [json_name="orig_tablespacename"];
+ ObjectType objtype = 2 [json_name="objtype"];
+ repeated Node roles = 3 [json_name="roles"];
+ string new_tablespacename = 4 [json_name="new_tablespacename"];
+ bool nowait = 5 [json_name="nowait"];
+}
+
+message CreateExtensionStmt
+{
+ string extname = 1 [json_name="extname"];
+ bool if_not_exists = 2 [json_name="if_not_exists"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message AlterExtensionStmt
+{
+ string extname = 1 [json_name="extname"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message AlterExtensionContentsStmt
+{
+ string extname = 1 [json_name="extname"];
+ int32 action = 2 [json_name="action"];
+ ObjectType objtype = 3 [json_name="objtype"];
+ Node object = 4 [json_name="object"];
+}
+
+message CreateFdwStmt
+{
+ string fdwname = 1 [json_name="fdwname"];
+ repeated Node func_options = 2 [json_name="func_options"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message AlterFdwStmt
+{
+ string fdwname = 1 [json_name="fdwname"];
+ repeated Node func_options = 2 [json_name="func_options"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message CreateForeignServerStmt
+{
+ string servername = 1 [json_name="servername"];
+ string servertype = 2 [json_name="servertype"];
+ string version = 3 [json_name="version"];
+ string fdwname = 4 [json_name="fdwname"];
+ bool if_not_exists = 5 [json_name="if_not_exists"];
+ repeated Node options = 6 [json_name="options"];
+}
+
+message AlterForeignServerStmt
+{
+ string servername = 1 [json_name="servername"];
+ string version = 2 [json_name="version"];
+ repeated Node options = 3 [json_name="options"];
+ bool has_version = 4 [json_name="has_version"];
+}
+
+message CreateForeignTableStmt
+{
+ CreateStmt base_stmt = 1 [json_name="base"];
+ string servername = 2 [json_name="servername"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message CreateUserMappingStmt
+{
+ RoleSpec user = 1 [json_name="user"];
+ string servername = 2 [json_name="servername"];
+ bool if_not_exists = 3 [json_name="if_not_exists"];
+ repeated Node options = 4 [json_name="options"];
+}
+
+message AlterUserMappingStmt
+{
+ RoleSpec user = 1 [json_name="user"];
+ string servername = 2 [json_name="servername"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message DropUserMappingStmt
+{
+ RoleSpec user = 1 [json_name="user"];
+ string servername = 2 [json_name="servername"];
+ bool missing_ok = 3 [json_name="missing_ok"];
+}
+
+message ImportForeignSchemaStmt
+{
+ string server_name = 1 [json_name="server_name"];
+ string remote_schema = 2 [json_name="remote_schema"];
+ string local_schema = 3 [json_name="local_schema"];
+ ImportForeignSchemaType list_type = 4 [json_name="list_type"];
+ repeated Node table_list = 5 [json_name="table_list"];
+ repeated Node options = 6 [json_name="options"];
+}
+
+message CreatePolicyStmt
+{
+ string policy_name = 1 [json_name="policy_name"];
+ RangeVar table = 2 [json_name="table"];
+ string cmd_name = 3 [json_name="cmd_name"];
+ bool permissive = 4 [json_name="permissive"];
+ repeated Node roles = 5 [json_name="roles"];
+ Node qual = 6 [json_name="qual"];
+ Node with_check = 7 [json_name="with_check"];
+}
+
+message AlterPolicyStmt
+{
+ string policy_name = 1 [json_name="policy_name"];
+ RangeVar table = 2 [json_name="table"];
+ repeated Node roles = 3 [json_name="roles"];
+ Node qual = 4 [json_name="qual"];
+ Node with_check = 5 [json_name="with_check"];
+}
+
+message CreateAmStmt
+{
+ string amname = 1 [json_name="amname"];
+ repeated Node handler_name = 2 [json_name="handler_name"];
+ string amtype = 3 [json_name="amtype"];
+}
+
+message CreateTrigStmt
+{
+ bool replace = 1 [json_name="replace"];
+ bool isconstraint = 2 [json_name="isconstraint"];
+ string trigname = 3 [json_name="trigname"];
+ RangeVar relation = 4 [json_name="relation"];
+ repeated Node funcname = 5 [json_name="funcname"];
+ repeated Node args = 6 [json_name="args"];
+ bool row = 7 [json_name="row"];
+ int32 timing = 8 [json_name="timing"];
+ int32 events = 9 [json_name="events"];
+ repeated Node columns = 10 [json_name="columns"];
+ Node when_clause = 11 [json_name="whenClause"];
+ repeated Node transition_rels = 12 [json_name="transitionRels"];
+ bool deferrable = 13 [json_name="deferrable"];
+ bool initdeferred = 14 [json_name="initdeferred"];
+ RangeVar constrrel = 15 [json_name="constrrel"];
+}
+
+message CreateEventTrigStmt
+{
+ string trigname = 1 [json_name="trigname"];
+ string eventname = 2 [json_name="eventname"];
+ repeated Node whenclause = 3 [json_name="whenclause"];
+ repeated Node funcname = 4 [json_name="funcname"];
+}
+
+message AlterEventTrigStmt
+{
+ string trigname = 1 [json_name="trigname"];
+ string tgenabled = 2 [json_name="tgenabled"];
+}
+
+message CreatePLangStmt
+{
+ bool replace = 1 [json_name="replace"];
+ string plname = 2 [json_name="plname"];
+ repeated Node plhandler = 3 [json_name="plhandler"];
+ repeated Node plinline = 4 [json_name="plinline"];
+ repeated Node plvalidator = 5 [json_name="plvalidator"];
+ bool pltrusted = 6 [json_name="pltrusted"];
+}
+
+message CreateRoleStmt
+{
+ RoleStmtType stmt_type = 1 [json_name="stmt_type"];
+ string role = 2 [json_name="role"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message AlterRoleStmt
+{
+ RoleSpec role = 1 [json_name="role"];
+ repeated Node options = 2 [json_name="options"];
+ int32 action = 3 [json_name="action"];
+}
+
+message AlterRoleSetStmt
+{
+ RoleSpec role = 1 [json_name="role"];
+ string database = 2 [json_name="database"];
+ VariableSetStmt setstmt = 3 [json_name="setstmt"];
+}
+
+message DropRoleStmt
+{
+ repeated Node roles = 1 [json_name="roles"];
+ bool missing_ok = 2 [json_name="missing_ok"];
+}
+
+message CreateSeqStmt
+{
+ RangeVar sequence = 1 [json_name="sequence"];
+ repeated Node options = 2 [json_name="options"];
+ uint32 owner_id = 3 [json_name="ownerId"];
+ bool for_identity = 4 [json_name="for_identity"];
+ bool if_not_exists = 5 [json_name="if_not_exists"];
+}
+
+message AlterSeqStmt
+{
+ RangeVar sequence = 1 [json_name="sequence"];
+ repeated Node options = 2 [json_name="options"];
+ bool for_identity = 3 [json_name="for_identity"];
+ bool missing_ok = 4 [json_name="missing_ok"];
+}
+
+message DefineStmt
+{
+ ObjectType kind = 1 [json_name="kind"];
+ bool oldstyle = 2 [json_name="oldstyle"];
+ repeated Node defnames = 3 [json_name="defnames"];
+ repeated Node args = 4 [json_name="args"];
+ repeated Node definition = 5 [json_name="definition"];
+ bool if_not_exists = 6 [json_name="if_not_exists"];
+ bool replace = 7 [json_name="replace"];
+}
+
+message CreateDomainStmt
+{
+ repeated Node domainname = 1 [json_name="domainname"];
+ TypeName type_name = 2 [json_name="typeName"];
+ CollateClause coll_clause = 3 [json_name="collClause"];
+ repeated Node constraints = 4 [json_name="constraints"];
+}
+
+message CreateOpClassStmt
+{
+ repeated Node opclassname = 1 [json_name="opclassname"];
+ repeated Node opfamilyname = 2 [json_name="opfamilyname"];
+ string amname = 3 [json_name="amname"];
+ TypeName datatype = 4 [json_name="datatype"];
+ repeated Node items = 5 [json_name="items"];
+ bool is_default = 6 [json_name="isDefault"];
+}
+
+message CreateOpClassItem
+{
+ int32 itemtype = 1 [json_name="itemtype"];
+ ObjectWithArgs name = 2 [json_name="name"];
+ int32 number = 3 [json_name="number"];
+ repeated Node order_family = 4 [json_name="order_family"];
+ repeated Node class_args = 5 [json_name="class_args"];
+ TypeName storedtype = 6 [json_name="storedtype"];
+}
+
+message CreateOpFamilyStmt
+{
+ repeated Node opfamilyname = 1 [json_name="opfamilyname"];
+ string amname = 2 [json_name="amname"];
+}
+
+message AlterOpFamilyStmt
+{
+ repeated Node opfamilyname = 1 [json_name="opfamilyname"];
+ string amname = 2 [json_name="amname"];
+ bool is_drop = 3 [json_name="isDrop"];
+ repeated Node items = 4 [json_name="items"];
+}
+
+message DropStmt
+{
+ repeated Node objects = 1 [json_name="objects"];
+ ObjectType remove_type = 2 [json_name="removeType"];
+ DropBehavior behavior = 3 [json_name="behavior"];
+ bool missing_ok = 4 [json_name="missing_ok"];
+ bool concurrent = 5 [json_name="concurrent"];
+}
+
+message TruncateStmt
+{
+ repeated Node relations = 1 [json_name="relations"];
+ bool restart_seqs = 2 [json_name="restart_seqs"];
+ DropBehavior behavior = 3 [json_name="behavior"];
+}
+
+message CommentStmt
+{
+ ObjectType objtype = 1 [json_name="objtype"];
+ Node object = 2 [json_name="object"];
+ string comment = 3 [json_name="comment"];
+}
+
+message SecLabelStmt
+{
+ ObjectType objtype = 1 [json_name="objtype"];
+ Node object = 2 [json_name="object"];
+ string provider = 3 [json_name="provider"];
+ string label = 4 [json_name="label"];
+}
+
+message DeclareCursorStmt
+{
+ string portalname = 1 [json_name="portalname"];
+ int32 options = 2 [json_name="options"];
+ Node query = 3 [json_name="query"];
+}
+
+message ClosePortalStmt
+{
+ string portalname = 1 [json_name="portalname"];
+}
+
+message FetchStmt
+{
+ FetchDirection direction = 1 [json_name="direction"];
+ int64 how_many = 2 [json_name="howMany"];
+ string portalname = 3 [json_name="portalname"];
+ bool ismove = 4 [json_name="ismove"];
+}
+
+message IndexStmt
+{
+ string idxname = 1 [json_name="idxname"];
+ RangeVar relation = 2 [json_name="relation"];
+ string access_method = 3 [json_name="accessMethod"];
+ string table_space = 4 [json_name="tableSpace"];
+ repeated Node index_params = 5 [json_name="indexParams"];
+ repeated Node index_including_params = 6 [json_name="indexIncludingParams"];
+ repeated Node options = 7 [json_name="options"];
+ Node where_clause = 8 [json_name="whereClause"];
+ repeated Node exclude_op_names = 9 [json_name="excludeOpNames"];
+ string idxcomment = 10 [json_name="idxcomment"];
+ uint32 index_oid = 11 [json_name="indexOid"];
+ uint32 old_number = 12 [json_name="oldNumber"];
+ uint32 old_create_subid = 13 [json_name="oldCreateSubid"];
+ uint32 old_first_relfilelocator_subid = 14 [json_name="oldFirstRelfilelocatorSubid"];
+ bool unique = 15 [json_name="unique"];
+ bool nulls_not_distinct = 16 [json_name="nulls_not_distinct"];
+ bool primary = 17 [json_name="primary"];
+ bool isconstraint = 18 [json_name="isconstraint"];
+ bool deferrable = 19 [json_name="deferrable"];
+ bool initdeferred = 20 [json_name="initdeferred"];
+ bool transformed = 21 [json_name="transformed"];
+ bool concurrent = 22 [json_name="concurrent"];
+ bool if_not_exists = 23 [json_name="if_not_exists"];
+ bool reset_default_tblspc = 24 [json_name="reset_default_tblspc"];
+}
+
+message CreateStatsStmt
+{
+ repeated Node defnames = 1 [json_name="defnames"];
+ repeated Node stat_types = 2 [json_name="stat_types"];
+ repeated Node exprs = 3 [json_name="exprs"];
+ repeated Node relations = 4 [json_name="relations"];
+ string stxcomment = 5 [json_name="stxcomment"];
+ bool transformed = 6 [json_name="transformed"];
+ bool if_not_exists = 7 [json_name="if_not_exists"];
+}
+
+message StatsElem
+{
+ string name = 1 [json_name="name"];
+ Node expr = 2 [json_name="expr"];
+}
+
+message AlterStatsStmt
+{
+ repeated Node defnames = 1 [json_name="defnames"];
+ int32 stxstattarget = 2 [json_name="stxstattarget"];
+ bool missing_ok = 3 [json_name="missing_ok"];
+}
+
+message CreateFunctionStmt
+{
+ bool is_procedure = 1 [json_name="is_procedure"];
+ bool replace = 2 [json_name="replace"];
+ repeated Node funcname = 3 [json_name="funcname"];
+ repeated Node parameters = 4 [json_name="parameters"];
+ TypeName return_type = 5 [json_name="returnType"];
+ repeated Node options = 6 [json_name="options"];
+ Node sql_body = 7 [json_name="sql_body"];
+}
+
+message FunctionParameter
+{
+ string name = 1 [json_name="name"];
+ TypeName arg_type = 2 [json_name="argType"];
+ FunctionParameterMode mode = 3 [json_name="mode"];
+ Node defexpr = 4 [json_name="defexpr"];
+}
+
+message AlterFunctionStmt
+{
+ ObjectType objtype = 1 [json_name="objtype"];
+ ObjectWithArgs func = 2 [json_name="func"];
+ repeated Node actions = 3 [json_name="actions"];
+}
+
+message DoStmt
+{
+ repeated Node args = 1 [json_name="args"];
+}
+
+message InlineCodeBlock
+{
+ string source_text = 1 [json_name="source_text"];
+ uint32 lang_oid = 2 [json_name="langOid"];
+ bool lang_is_trusted = 3 [json_name="langIsTrusted"];
+ bool atomic = 4 [json_name="atomic"];
+}
+
+message CallStmt
+{
+ FuncCall funccall = 1 [json_name="funccall"];
+ FuncExpr funcexpr = 2 [json_name="funcexpr"];
+ repeated Node outargs = 3 [json_name="outargs"];
+}
+
+message CallContext
+{
+ bool atomic = 1 [json_name="atomic"];
+}
+
+message RenameStmt
+{
+ ObjectType rename_type = 1 [json_name="renameType"];
+ ObjectType relation_type = 2 [json_name="relationType"];
+ RangeVar relation = 3 [json_name="relation"];
+ Node object = 4 [json_name="object"];
+ string subname = 5 [json_name="subname"];
+ string newname = 6 [json_name="newname"];
+ DropBehavior behavior = 7 [json_name="behavior"];
+ bool missing_ok = 8 [json_name="missing_ok"];
+}
+
+message AlterObjectDependsStmt
+{
+ ObjectType object_type = 1 [json_name="objectType"];
+ RangeVar relation = 2 [json_name="relation"];
+ Node object = 3 [json_name="object"];
+ String extname = 4 [json_name="extname"];
+ bool remove = 5 [json_name="remove"];
+}
+
+message AlterObjectSchemaStmt
+{
+ ObjectType object_type = 1 [json_name="objectType"];
+ RangeVar relation = 2 [json_name="relation"];
+ Node object = 3 [json_name="object"];
+ string newschema = 4 [json_name="newschema"];
+ bool missing_ok = 5 [json_name="missing_ok"];
+}
+
+message AlterOwnerStmt
+{
+ ObjectType object_type = 1 [json_name="objectType"];
+ RangeVar relation = 2 [json_name="relation"];
+ Node object = 3 [json_name="object"];
+ RoleSpec newowner = 4 [json_name="newowner"];
+}
+
+message AlterOperatorStmt
+{
+ ObjectWithArgs opername = 1 [json_name="opername"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message AlterTypeStmt
+{
+ repeated Node type_name = 1 [json_name="typeName"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message RuleStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ string rulename = 2 [json_name="rulename"];
+ Node where_clause = 3 [json_name="whereClause"];
+ CmdType event = 4 [json_name="event"];
+ bool instead = 5 [json_name="instead"];
+ repeated Node actions = 6 [json_name="actions"];
+ bool replace = 7 [json_name="replace"];
+}
+
+message NotifyStmt
+{
+ string conditionname = 1 [json_name="conditionname"];
+ string payload = 2 [json_name="payload"];
+}
+
+message ListenStmt
+{
+ string conditionname = 1 [json_name="conditionname"];
+}
+
+message UnlistenStmt
+{
+ string conditionname = 1 [json_name="conditionname"];
+}
+
+message TransactionStmt
+{
+ TransactionStmtKind kind = 1 [json_name="kind"];
+ repeated Node options = 2 [json_name="options"];
+ string savepoint_name = 3 [json_name="savepoint_name"];
+ string gid = 4 [json_name="gid"];
+ bool chain = 5 [json_name="chain"];
+}
+
+message CompositeTypeStmt
+{
+ RangeVar typevar = 1 [json_name="typevar"];
+ repeated Node coldeflist = 2 [json_name="coldeflist"];
+}
+
+message CreateEnumStmt
+{
+ repeated Node type_name = 1 [json_name="typeName"];
+ repeated Node vals = 2 [json_name="vals"];
+}
+
+message CreateRangeStmt
+{
+ repeated Node type_name = 1 [json_name="typeName"];
+ repeated Node params = 2 [json_name="params"];
+}
+
+message AlterEnumStmt
+{
+ repeated Node type_name = 1 [json_name="typeName"];
+ string old_val = 2 [json_name="oldVal"];
+ string new_val = 3 [json_name="newVal"];
+ string new_val_neighbor = 4 [json_name="newValNeighbor"];
+ bool new_val_is_after = 5 [json_name="newValIsAfter"];
+ bool skip_if_new_val_exists = 6 [json_name="skipIfNewValExists"];
+}
+
+message ViewStmt
+{
+ RangeVar view = 1 [json_name="view"];
+ repeated Node aliases = 2 [json_name="aliases"];
+ Node query = 3 [json_name="query"];
+ bool replace = 4 [json_name="replace"];
+ repeated Node options = 5 [json_name="options"];
+ ViewCheckOption with_check_option = 6 [json_name="withCheckOption"];
+}
+
+message LoadStmt
+{
+ string filename = 1 [json_name="filename"];
+}
+
+message CreatedbStmt
+{
+ string dbname = 1 [json_name="dbname"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message AlterDatabaseStmt
+{
+ string dbname = 1 [json_name="dbname"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message AlterDatabaseRefreshCollStmt
+{
+ string dbname = 1 [json_name="dbname"];
+}
+
+message AlterDatabaseSetStmt
+{
+ string dbname = 1 [json_name="dbname"];
+ VariableSetStmt setstmt = 2 [json_name="setstmt"];
+}
+
+message DropdbStmt
+{
+ string dbname = 1 [json_name="dbname"];
+ bool missing_ok = 2 [json_name="missing_ok"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message AlterSystemStmt
+{
+ VariableSetStmt setstmt = 1 [json_name="setstmt"];
+}
+
+message ClusterStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ string indexname = 2 [json_name="indexname"];
+ repeated Node params = 3 [json_name="params"];
+}
+
+message VacuumStmt
+{
+ repeated Node options = 1 [json_name="options"];
+ repeated Node rels = 2 [json_name="rels"];
+ bool is_vacuumcmd = 3 [json_name="is_vacuumcmd"];
+}
+
+message VacuumRelation
+{
+ RangeVar relation = 1 [json_name="relation"];
+ uint32 oid = 2 [json_name="oid"];
+ repeated Node va_cols = 3 [json_name="va_cols"];
+}
+
+message ExplainStmt
+{
+ Node query = 1 [json_name="query"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message CreateTableAsStmt
+{
+ Node query = 1 [json_name="query"];
+ IntoClause into = 2 [json_name="into"];
+ ObjectType objtype = 3 [json_name="objtype"];
+ bool is_select_into = 4 [json_name="is_select_into"];
+ bool if_not_exists = 5 [json_name="if_not_exists"];
+}
+
+message RefreshMatViewStmt
+{
+ bool concurrent = 1 [json_name="concurrent"];
+ bool skip_data = 2 [json_name="skipData"];
+ RangeVar relation = 3 [json_name="relation"];
+}
+
+message CheckPointStmt
+{
+}
+
+message DiscardStmt
+{
+ DiscardMode target = 1 [json_name="target"];
+}
+
+message LockStmt
+{
+ repeated Node relations = 1 [json_name="relations"];
+ int32 mode = 2 [json_name="mode"];
+ bool nowait = 3 [json_name="nowait"];
+}
+
+message ConstraintsSetStmt
+{
+ repeated Node constraints = 1 [json_name="constraints"];
+ bool deferred = 2 [json_name="deferred"];
+}
+
+message ReindexStmt
+{
+ ReindexObjectType kind = 1 [json_name="kind"];
+ RangeVar relation = 2 [json_name="relation"];
+ string name = 3 [json_name="name"];
+ repeated Node params = 4 [json_name="params"];
+}
+
+message CreateConversionStmt
+{
+ repeated Node conversion_name = 1 [json_name="conversion_name"];
+ string for_encoding_name = 2 [json_name="for_encoding_name"];
+ string to_encoding_name = 3 [json_name="to_encoding_name"];
+ repeated Node func_name = 4 [json_name="func_name"];
+ bool def = 5 [json_name="def"];
+}
+
+message CreateCastStmt
+{
+ TypeName sourcetype = 1 [json_name="sourcetype"];
+ TypeName targettype = 2 [json_name="targettype"];
+ ObjectWithArgs func = 3 [json_name="func"];
+ CoercionContext context = 4 [json_name="context"];
+ bool inout = 5 [json_name="inout"];
+}
+
+message CreateTransformStmt
+{
+ bool replace = 1 [json_name="replace"];
+ TypeName type_name = 2 [json_name="type_name"];
+ string lang = 3 [json_name="lang"];
+ ObjectWithArgs fromsql = 4 [json_name="fromsql"];
+ ObjectWithArgs tosql = 5 [json_name="tosql"];
+}
+
+message PrepareStmt
+{
+ string name = 1 [json_name="name"];
+ repeated Node argtypes = 2 [json_name="argtypes"];
+ Node query = 3 [json_name="query"];
+}
+
+message ExecuteStmt
+{
+ string name = 1 [json_name="name"];
+ repeated Node params = 2 [json_name="params"];
+}
+
+message DeallocateStmt
+{
+ string name = 1 [json_name="name"];
+}
+
+message DropOwnedStmt
+{
+ repeated Node roles = 1 [json_name="roles"];
+ DropBehavior behavior = 2 [json_name="behavior"];
+}
+
+message ReassignOwnedStmt
+{
+ repeated Node roles = 1 [json_name="roles"];
+ RoleSpec newrole = 2 [json_name="newrole"];
+}
+
+message AlterTSDictionaryStmt
+{
+ repeated Node dictname = 1 [json_name="dictname"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message AlterTSConfigurationStmt
+{
+ AlterTSConfigType kind = 1 [json_name="kind"];
+ repeated Node cfgname = 2 [json_name="cfgname"];
+ repeated Node tokentype = 3 [json_name="tokentype"];
+ repeated Node dicts = 4 [json_name="dicts"];
+ bool override = 5 [json_name="override"];
+ bool replace = 6 [json_name="replace"];
+ bool missing_ok = 7 [json_name="missing_ok"];
+}
+
+message PublicationTable
+{
+ RangeVar relation = 1 [json_name="relation"];
+ Node where_clause = 2 [json_name="whereClause"];
+ repeated Node columns = 3 [json_name="columns"];
+}
+
+message PublicationObjSpec
+{
+ PublicationObjSpecType pubobjtype = 1 [json_name="pubobjtype"];
+ string name = 2 [json_name="name"];
+ PublicationTable pubtable = 3 [json_name="pubtable"];
+ int32 location = 4 [json_name="location"];
+}
+
+message CreatePublicationStmt
+{
+ string pubname = 1 [json_name="pubname"];
+ repeated Node options = 2 [json_name="options"];
+ repeated Node pubobjects = 3 [json_name="pubobjects"];
+ bool for_all_tables = 4 [json_name="for_all_tables"];
+}
+
+message AlterPublicationStmt
+{
+ string pubname = 1 [json_name="pubname"];
+ repeated Node options = 2 [json_name="options"];
+ repeated Node pubobjects = 3 [json_name="pubobjects"];
+ bool for_all_tables = 4 [json_name="for_all_tables"];
+ AlterPublicationAction action = 5 [json_name="action"];
+}
+
+message CreateSubscriptionStmt
+{
+ string subname = 1 [json_name="subname"];
+ string conninfo = 2 [json_name="conninfo"];
+ repeated Node publication = 3 [json_name="publication"];
+ repeated Node options = 4 [json_name="options"];
+}
+
+message AlterSubscriptionStmt
+{
+ AlterSubscriptionType kind = 1 [json_name="kind"];
+ string subname = 2 [json_name="subname"];
+ string conninfo = 3 [json_name="conninfo"];
+ repeated Node publication = 4 [json_name="publication"];
+ repeated Node options = 5 [json_name="options"];
+}
+
+message DropSubscriptionStmt
+{
+ string subname = 1 [json_name="subname"];
+ bool missing_ok = 2 [json_name="missing_ok"];
+ DropBehavior behavior = 3 [json_name="behavior"];
+}
+
+enum OverridingKind
+{
+ OVERRIDING_KIND_UNDEFINED = 0;
+ OVERRIDING_NOT_SET = 1;
+ OVERRIDING_USER_VALUE = 2;
+ OVERRIDING_SYSTEM_VALUE = 3;
+}
+
+enum QuerySource
+{
+ QUERY_SOURCE_UNDEFINED = 0;
+ QSRC_ORIGINAL = 1;
+ QSRC_PARSER = 2;
+ QSRC_INSTEAD_RULE = 3;
+ QSRC_QUAL_INSTEAD_RULE = 4;
+ QSRC_NON_INSTEAD_RULE = 5;
+}
+
+enum SortByDir
+{
+ SORT_BY_DIR_UNDEFINED = 0;
+ SORTBY_DEFAULT = 1;
+ SORTBY_ASC = 2;
+ SORTBY_DESC = 3;
+ SORTBY_USING = 4;
+}
+
+enum SortByNulls
+{
+ SORT_BY_NULLS_UNDEFINED = 0;
+ SORTBY_NULLS_DEFAULT = 1;
+ SORTBY_NULLS_FIRST = 2;
+ SORTBY_NULLS_LAST = 3;
+}
+
+enum SetQuantifier
+{
+ SET_QUANTIFIER_UNDEFINED = 0;
+ SET_QUANTIFIER_DEFAULT = 1;
+ SET_QUANTIFIER_ALL = 2;
+ SET_QUANTIFIER_DISTINCT = 3;
+}
+
+enum A_Expr_Kind
+{
+ A_EXPR_KIND_UNDEFINED = 0;
+ AEXPR_OP = 1;
+ AEXPR_OP_ANY = 2;
+ AEXPR_OP_ALL = 3;
+ AEXPR_DISTINCT = 4;
+ AEXPR_NOT_DISTINCT = 5;
+ AEXPR_NULLIF = 6;
+ AEXPR_IN = 7;
+ AEXPR_LIKE = 8;
+ AEXPR_ILIKE = 9;
+ AEXPR_SIMILAR = 10;
+ AEXPR_BETWEEN = 11;
+ AEXPR_NOT_BETWEEN = 12;
+ AEXPR_BETWEEN_SYM = 13;
+ AEXPR_NOT_BETWEEN_SYM = 14;
+}
+
+enum RoleSpecType
+{
+ ROLE_SPEC_TYPE_UNDEFINED = 0;
+ ROLESPEC_CSTRING = 1;
+ ROLESPEC_CURRENT_ROLE = 2;
+ ROLESPEC_CURRENT_USER = 3;
+ ROLESPEC_SESSION_USER = 4;
+ ROLESPEC_PUBLIC = 5;
+}
+
+enum TableLikeOption
+{
+ TABLE_LIKE_OPTION_UNDEFINED = 0;
+ CREATE_TABLE_LIKE_COMMENTS = 1;
+ CREATE_TABLE_LIKE_COMPRESSION = 2;
+ CREATE_TABLE_LIKE_CONSTRAINTS = 3;
+ CREATE_TABLE_LIKE_DEFAULTS = 4;
+ CREATE_TABLE_LIKE_GENERATED = 5;
+ CREATE_TABLE_LIKE_IDENTITY = 6;
+ CREATE_TABLE_LIKE_INDEXES = 7;
+ CREATE_TABLE_LIKE_STATISTICS = 8;
+ CREATE_TABLE_LIKE_STORAGE = 9;
+ CREATE_TABLE_LIKE_ALL = 10;
+}
+
+enum DefElemAction
+{
+ DEF_ELEM_ACTION_UNDEFINED = 0;
+ DEFELEM_UNSPEC = 1;
+ DEFELEM_SET = 2;
+ DEFELEM_ADD = 3;
+ DEFELEM_DROP = 4;
+}
+
+enum PartitionStrategy
+{
+ PARTITION_STRATEGY_UNDEFINED = 0;
+ PARTITION_STRATEGY_LIST = 1;
+ PARTITION_STRATEGY_RANGE = 2;
+ PARTITION_STRATEGY_HASH = 3;
+}
+
+enum PartitionRangeDatumKind
+{
+ PARTITION_RANGE_DATUM_KIND_UNDEFINED = 0;
+ PARTITION_RANGE_DATUM_MINVALUE = 1;
+ PARTITION_RANGE_DATUM_VALUE = 2;
+ PARTITION_RANGE_DATUM_MAXVALUE = 3;
+}
+
+enum RTEKind
+{
+ RTEKIND_UNDEFINED = 0;
+ RTE_RELATION = 1;
+ RTE_SUBQUERY = 2;
+ RTE_JOIN = 3;
+ RTE_FUNCTION = 4;
+ RTE_TABLEFUNC = 5;
+ RTE_VALUES = 6;
+ RTE_CTE = 7;
+ RTE_NAMEDTUPLESTORE = 8;
+ RTE_RESULT = 9;
+}
+
+enum WCOKind
+{
+ WCOKIND_UNDEFINED = 0;
+ WCO_VIEW_CHECK = 1;
+ WCO_RLS_INSERT_CHECK = 2;
+ WCO_RLS_UPDATE_CHECK = 3;
+ WCO_RLS_CONFLICT_CHECK = 4;
+ WCO_RLS_MERGE_UPDATE_CHECK = 5;
+ WCO_RLS_MERGE_DELETE_CHECK = 6;
+}
+
+enum GroupingSetKind
+{
+ GROUPING_SET_KIND_UNDEFINED = 0;
+ GROUPING_SET_EMPTY = 1;
+ GROUPING_SET_SIMPLE = 2;
+ GROUPING_SET_ROLLUP = 3;
+ GROUPING_SET_CUBE = 4;
+ GROUPING_SET_SETS = 5;
+}
+
+enum CTEMaterialize
+{
+ CTEMATERIALIZE_UNDEFINED = 0;
+ CTEMaterializeDefault = 1;
+ CTEMaterializeAlways = 2;
+ CTEMaterializeNever = 3;
+}
+
+enum SetOperation
+{
+ SET_OPERATION_UNDEFINED = 0;
+ SETOP_NONE = 1;
+ SETOP_UNION = 2;
+ SETOP_INTERSECT = 3;
+ SETOP_EXCEPT = 4;
+}
+
+enum ObjectType
+{
+ OBJECT_TYPE_UNDEFINED = 0;
+ OBJECT_ACCESS_METHOD = 1;
+ OBJECT_AGGREGATE = 2;
+ OBJECT_AMOP = 3;
+ OBJECT_AMPROC = 4;
+ OBJECT_ATTRIBUTE = 5;
+ OBJECT_CAST = 6;
+ OBJECT_COLUMN = 7;
+ OBJECT_COLLATION = 8;
+ OBJECT_CONVERSION = 9;
+ OBJECT_DATABASE = 10;
+ OBJECT_DEFAULT = 11;
+ OBJECT_DEFACL = 12;
+ OBJECT_DOMAIN = 13;
+ OBJECT_DOMCONSTRAINT = 14;
+ OBJECT_EVENT_TRIGGER = 15;
+ OBJECT_EXTENSION = 16;
+ OBJECT_FDW = 17;
+ OBJECT_FOREIGN_SERVER = 18;
+ OBJECT_FOREIGN_TABLE = 19;
+ OBJECT_FUNCTION = 20;
+ OBJECT_INDEX = 21;
+ OBJECT_LANGUAGE = 22;
+ OBJECT_LARGEOBJECT = 23;
+ OBJECT_MATVIEW = 24;
+ OBJECT_OPCLASS = 25;
+ OBJECT_OPERATOR = 26;
+ OBJECT_OPFAMILY = 27;
+ OBJECT_PARAMETER_ACL = 28;
+ OBJECT_POLICY = 29;
+ OBJECT_PROCEDURE = 30;
+ OBJECT_PUBLICATION = 31;
+ OBJECT_PUBLICATION_NAMESPACE = 32;
+ OBJECT_PUBLICATION_REL = 33;
+ OBJECT_ROLE = 34;
+ OBJECT_ROUTINE = 35;
+ OBJECT_RULE = 36;
+ OBJECT_SCHEMA = 37;
+ OBJECT_SEQUENCE = 38;
+ OBJECT_SUBSCRIPTION = 39;
+ OBJECT_STATISTIC_EXT = 40;
+ OBJECT_TABCONSTRAINT = 41;
+ OBJECT_TABLE = 42;
+ OBJECT_TABLESPACE = 43;
+ OBJECT_TRANSFORM = 44;
+ OBJECT_TRIGGER = 45;
+ OBJECT_TSCONFIGURATION = 46;
+ OBJECT_TSDICTIONARY = 47;
+ OBJECT_TSPARSER = 48;
+ OBJECT_TSTEMPLATE = 49;
+ OBJECT_TYPE = 50;
+ OBJECT_USER_MAPPING = 51;
+ OBJECT_VIEW = 52;
+}
+
+enum DropBehavior
+{
+ DROP_BEHAVIOR_UNDEFINED = 0;
+ DROP_RESTRICT = 1;
+ DROP_CASCADE = 2;
+}
+
+enum AlterTableType
+{
+ ALTER_TABLE_TYPE_UNDEFINED = 0;
+ AT_AddColumn = 1;
+ AT_AddColumnToView = 2;
+ AT_ColumnDefault = 3;
+ AT_CookedColumnDefault = 4;
+ AT_DropNotNull = 5;
+ AT_SetNotNull = 6;
+ AT_DropExpression = 7;
+ AT_CheckNotNull = 8;
+ AT_SetStatistics = 9;
+ AT_SetOptions = 10;
+ AT_ResetOptions = 11;
+ AT_SetStorage = 12;
+ AT_SetCompression = 13;
+ AT_DropColumn = 14;
+ AT_AddIndex = 15;
+ AT_ReAddIndex = 16;
+ AT_AddConstraint = 17;
+ AT_ReAddConstraint = 18;
+ AT_ReAddDomainConstraint = 19;
+ AT_AlterConstraint = 20;
+ AT_ValidateConstraint = 21;
+ AT_AddIndexConstraint = 22;
+ AT_DropConstraint = 23;
+ AT_ReAddComment = 24;
+ AT_AlterColumnType = 25;
+ AT_AlterColumnGenericOptions = 26;
+ AT_ChangeOwner = 27;
+ AT_ClusterOn = 28;
+ AT_DropCluster = 29;
+ AT_SetLogged = 30;
+ AT_SetUnLogged = 31;
+ AT_DropOids = 32;
+ AT_SetAccessMethod = 33;
+ AT_SetTableSpace = 34;
+ AT_SetRelOptions = 35;
+ AT_ResetRelOptions = 36;
+ AT_ReplaceRelOptions = 37;
+ AT_EnableTrig = 38;
+ AT_EnableAlwaysTrig = 39;
+ AT_EnableReplicaTrig = 40;
+ AT_DisableTrig = 41;
+ AT_EnableTrigAll = 42;
+ AT_DisableTrigAll = 43;
+ AT_EnableTrigUser = 44;
+ AT_DisableTrigUser = 45;
+ AT_EnableRule = 46;
+ AT_EnableAlwaysRule = 47;
+ AT_EnableReplicaRule = 48;
+ AT_DisableRule = 49;
+ AT_AddInherit = 50;
+ AT_DropInherit = 51;
+ AT_AddOf = 52;
+ AT_DropOf = 53;
+ AT_ReplicaIdentity = 54;
+ AT_EnableRowSecurity = 55;
+ AT_DisableRowSecurity = 56;
+ AT_ForceRowSecurity = 57;
+ AT_NoForceRowSecurity = 58;
+ AT_GenericOptions = 59;
+ AT_AttachPartition = 60;
+ AT_DetachPartition = 61;
+ AT_DetachPartitionFinalize = 62;
+ AT_AddIdentity = 63;
+ AT_SetIdentity = 64;
+ AT_DropIdentity = 65;
+ AT_ReAddStatistics = 66;
+}
+
+enum GrantTargetType
+{
+ GRANT_TARGET_TYPE_UNDEFINED = 0;
+ ACL_TARGET_OBJECT = 1;
+ ACL_TARGET_ALL_IN_SCHEMA = 2;
+ ACL_TARGET_DEFAULTS = 3;
+}
+
+enum VariableSetKind
+{
+ VARIABLE_SET_KIND_UNDEFINED = 0;
+ VAR_SET_VALUE = 1;
+ VAR_SET_DEFAULT = 2;
+ VAR_SET_CURRENT = 3;
+ VAR_SET_MULTI = 4;
+ VAR_RESET = 5;
+ VAR_RESET_ALL = 6;
+}
+
+enum ConstrType
+{
+ CONSTR_TYPE_UNDEFINED = 0;
+ CONSTR_NULL = 1;
+ CONSTR_NOTNULL = 2;
+ CONSTR_DEFAULT = 3;
+ CONSTR_IDENTITY = 4;
+ CONSTR_GENERATED = 5;
+ CONSTR_CHECK = 6;
+ CONSTR_PRIMARY = 7;
+ CONSTR_UNIQUE = 8;
+ CONSTR_EXCLUSION = 9;
+ CONSTR_FOREIGN = 10;
+ CONSTR_ATTR_DEFERRABLE = 11;
+ CONSTR_ATTR_NOT_DEFERRABLE = 12;
+ CONSTR_ATTR_DEFERRED = 13;
+ CONSTR_ATTR_IMMEDIATE = 14;
+}
+
+enum ImportForeignSchemaType
+{
+ IMPORT_FOREIGN_SCHEMA_TYPE_UNDEFINED = 0;
+ FDW_IMPORT_SCHEMA_ALL = 1;
+ FDW_IMPORT_SCHEMA_LIMIT_TO = 2;
+ FDW_IMPORT_SCHEMA_EXCEPT = 3;
+}
+
+enum RoleStmtType
+{
+ ROLE_STMT_TYPE_UNDEFINED = 0;
+ ROLESTMT_ROLE = 1;
+ ROLESTMT_USER = 2;
+ ROLESTMT_GROUP = 3;
+}
+
+enum FetchDirection
+{
+ FETCH_DIRECTION_UNDEFINED = 0;
+ FETCH_FORWARD = 1;
+ FETCH_BACKWARD = 2;
+ FETCH_ABSOLUTE = 3;
+ FETCH_RELATIVE = 4;
+}
+
+enum FunctionParameterMode
+{
+ FUNCTION_PARAMETER_MODE_UNDEFINED = 0;
+ FUNC_PARAM_IN = 1;
+ FUNC_PARAM_OUT = 2;
+ FUNC_PARAM_INOUT = 3;
+ FUNC_PARAM_VARIADIC = 4;
+ FUNC_PARAM_TABLE = 5;
+ FUNC_PARAM_DEFAULT = 6;
+}
+
+enum TransactionStmtKind
+{
+ TRANSACTION_STMT_KIND_UNDEFINED = 0;
+ TRANS_STMT_BEGIN = 1;
+ TRANS_STMT_START = 2;
+ TRANS_STMT_COMMIT = 3;
+ TRANS_STMT_ROLLBACK = 4;
+ TRANS_STMT_SAVEPOINT = 5;
+ TRANS_STMT_RELEASE = 6;
+ TRANS_STMT_ROLLBACK_TO = 7;
+ TRANS_STMT_PREPARE = 8;
+ TRANS_STMT_COMMIT_PREPARED = 9;
+ TRANS_STMT_ROLLBACK_PREPARED = 10;
+}
+
+enum ViewCheckOption
+{
+ VIEW_CHECK_OPTION_UNDEFINED = 0;
+ NO_CHECK_OPTION = 1;
+ LOCAL_CHECK_OPTION = 2;
+ CASCADED_CHECK_OPTION = 3;
+}
+
+enum DiscardMode
+{
+ DISCARD_MODE_UNDEFINED = 0;
+ DISCARD_ALL = 1;
+ DISCARD_PLANS = 2;
+ DISCARD_SEQUENCES = 3;
+ DISCARD_TEMP = 4;
+}
+
+enum ReindexObjectType
+{
+ REINDEX_OBJECT_TYPE_UNDEFINED = 0;
+ REINDEX_OBJECT_INDEX = 1;
+ REINDEX_OBJECT_TABLE = 2;
+ REINDEX_OBJECT_SCHEMA = 3;
+ REINDEX_OBJECT_SYSTEM = 4;
+ REINDEX_OBJECT_DATABASE = 5;
+}
+
+enum AlterTSConfigType
+{
+ ALTER_TSCONFIG_TYPE_UNDEFINED = 0;
+ ALTER_TSCONFIG_ADD_MAPPING = 1;
+ ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN = 2;
+ ALTER_TSCONFIG_REPLACE_DICT = 3;
+ ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN = 4;
+ ALTER_TSCONFIG_DROP_MAPPING = 5;
+}
+
+enum PublicationObjSpecType
+{
+ PUBLICATION_OBJ_SPEC_TYPE_UNDEFINED = 0;
+ PUBLICATIONOBJ_TABLE = 1;
+ PUBLICATIONOBJ_TABLES_IN_SCHEMA = 2;
+ PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA = 3;
+ PUBLICATIONOBJ_CONTINUATION = 4;
+}
+
+enum AlterPublicationAction
+{
+ ALTER_PUBLICATION_ACTION_UNDEFINED = 0;
+ AP_AddObjects = 1;
+ AP_DropObjects = 2;
+ AP_SetObjects = 3;
+}
+
+enum AlterSubscriptionType
+{
+ ALTER_SUBSCRIPTION_TYPE_UNDEFINED = 0;
+ ALTER_SUBSCRIPTION_OPTIONS = 1;
+ ALTER_SUBSCRIPTION_CONNECTION = 2;
+ ALTER_SUBSCRIPTION_SET_PUBLICATION = 3;
+ ALTER_SUBSCRIPTION_ADD_PUBLICATION = 4;
+ ALTER_SUBSCRIPTION_DROP_PUBLICATION = 5;
+ ALTER_SUBSCRIPTION_REFRESH = 6;
+ ALTER_SUBSCRIPTION_ENABLED = 7;
+ ALTER_SUBSCRIPTION_SKIP = 8;
+}
+
+enum OnCommitAction
+{
+ ON_COMMIT_ACTION_UNDEFINED = 0;
+ ONCOMMIT_NOOP = 1;
+ ONCOMMIT_PRESERVE_ROWS = 2;
+ ONCOMMIT_DELETE_ROWS = 3;
+ ONCOMMIT_DROP = 4;
+}
+
+enum ParamKind
+{
+ PARAM_KIND_UNDEFINED = 0;
+ PARAM_EXTERN = 1;
+ PARAM_EXEC = 2;
+ PARAM_SUBLINK = 3;
+ PARAM_MULTIEXPR = 4;
+}
+
+enum CoercionContext
+{
+ COERCION_CONTEXT_UNDEFINED = 0;
+ COERCION_IMPLICIT = 1;
+ COERCION_ASSIGNMENT = 2;
+ COERCION_PLPGSQL = 3;
+ COERCION_EXPLICIT = 4;
+}
+
+enum CoercionForm
+{
+ COERCION_FORM_UNDEFINED = 0;
+ COERCE_EXPLICIT_CALL = 1;
+ COERCE_EXPLICIT_CAST = 2;
+ COERCE_IMPLICIT_CAST = 3;
+ COERCE_SQL_SYNTAX = 4;
+}
+
+enum BoolExprType
+{
+ BOOL_EXPR_TYPE_UNDEFINED = 0;
+ AND_EXPR = 1;
+ OR_EXPR = 2;
+ NOT_EXPR = 3;
+}
+
+enum SubLinkType
+{
+ SUB_LINK_TYPE_UNDEFINED = 0;
+ EXISTS_SUBLINK = 1;
+ ALL_SUBLINK = 2;
+ ANY_SUBLINK = 3;
+ ROWCOMPARE_SUBLINK = 4;
+ EXPR_SUBLINK = 5;
+ MULTIEXPR_SUBLINK = 6;
+ ARRAY_SUBLINK = 7;
+ CTE_SUBLINK = 8;
+}
+
+enum RowCompareType
+{
+ ROW_COMPARE_TYPE_UNDEFINED = 0;
+ ROWCOMPARE_LT = 1;
+ ROWCOMPARE_LE = 2;
+ ROWCOMPARE_EQ = 3;
+ ROWCOMPARE_GE = 4;
+ ROWCOMPARE_GT = 5;
+ ROWCOMPARE_NE = 6;
+}
+
+enum MinMaxOp
+{
+ MIN_MAX_OP_UNDEFINED = 0;
+ IS_GREATEST = 1;
+ IS_LEAST = 2;
+}
+
+enum SQLValueFunctionOp
+{
+ SQLVALUE_FUNCTION_OP_UNDEFINED = 0;
+ SVFOP_CURRENT_DATE = 1;
+ SVFOP_CURRENT_TIME = 2;
+ SVFOP_CURRENT_TIME_N = 3;
+ SVFOP_CURRENT_TIMESTAMP = 4;
+ SVFOP_CURRENT_TIMESTAMP_N = 5;
+ SVFOP_LOCALTIME = 6;
+ SVFOP_LOCALTIME_N = 7;
+ SVFOP_LOCALTIMESTAMP = 8;
+ SVFOP_LOCALTIMESTAMP_N = 9;
+ SVFOP_CURRENT_ROLE = 10;
+ SVFOP_CURRENT_USER = 11;
+ SVFOP_USER = 12;
+ SVFOP_SESSION_USER = 13;
+ SVFOP_CURRENT_CATALOG = 14;
+ SVFOP_CURRENT_SCHEMA = 15;
+}
+
+enum XmlExprOp
+{
+ XML_EXPR_OP_UNDEFINED = 0;
+ IS_XMLCONCAT = 1;
+ IS_XMLELEMENT = 2;
+ IS_XMLFOREST = 3;
+ IS_XMLPARSE = 4;
+ IS_XMLPI = 5;
+ IS_XMLROOT = 6;
+ IS_XMLSERIALIZE = 7;
+ IS_DOCUMENT = 8;
+}
+
+enum XmlOptionType
+{
+ XML_OPTION_TYPE_UNDEFINED = 0;
+ XMLOPTION_DOCUMENT = 1;
+ XMLOPTION_CONTENT = 2;
+}
+
+enum JsonEncoding
+{
+ JSON_ENCODING_UNDEFINED = 0;
+ JS_ENC_DEFAULT = 1;
+ JS_ENC_UTF8 = 2;
+ JS_ENC_UTF16 = 3;
+ JS_ENC_UTF32 = 4;
+}
+
+enum JsonFormatType
+{
+ JSON_FORMAT_TYPE_UNDEFINED = 0;
+ JS_FORMAT_DEFAULT = 1;
+ JS_FORMAT_JSON = 2;
+ JS_FORMAT_JSONB = 3;
+}
+
+enum JsonConstructorType
+{
+ JSON_CONSTRUCTOR_TYPE_UNDEFINED = 0;
+ JSCTOR_JSON_OBJECT = 1;
+ JSCTOR_JSON_ARRAY = 2;
+ JSCTOR_JSON_OBJECTAGG = 3;
+ JSCTOR_JSON_ARRAYAGG = 4;
+}
+
+enum JsonValueType
+{
+ JSON_VALUE_TYPE_UNDEFINED = 0;
+ JS_TYPE_ANY = 1;
+ JS_TYPE_OBJECT = 2;
+ JS_TYPE_ARRAY = 3;
+ JS_TYPE_SCALAR = 4;
+}
+
+enum NullTestType
+{
+ NULL_TEST_TYPE_UNDEFINED = 0;
+ IS_NULL = 1;
+ IS_NOT_NULL = 2;
+}
+
+enum BoolTestType
+{
+ BOOL_TEST_TYPE_UNDEFINED = 0;
+ IS_TRUE = 1;
+ IS_NOT_TRUE = 2;
+ IS_FALSE = 3;
+ IS_NOT_FALSE = 4;
+ IS_UNKNOWN = 5;
+ IS_NOT_UNKNOWN = 6;
+}
+
+enum CmdType
+{
+ CMD_TYPE_UNDEFINED = 0;
+ CMD_UNKNOWN = 1;
+ CMD_SELECT = 2;
+ CMD_UPDATE = 3;
+ CMD_INSERT = 4;
+ CMD_DELETE = 5;
+ CMD_MERGE = 6;
+ CMD_UTILITY = 7;
+ CMD_NOTHING = 8;
+}
+
+enum JoinType
+{
+ JOIN_TYPE_UNDEFINED = 0;
+ JOIN_INNER = 1;
+ JOIN_LEFT = 2;
+ JOIN_FULL = 3;
+ JOIN_RIGHT = 4;
+ JOIN_SEMI = 5;
+ JOIN_ANTI = 6;
+ JOIN_RIGHT_ANTI = 7;
+ JOIN_UNIQUE_OUTER = 8;
+ JOIN_UNIQUE_INNER = 9;
+}
+
+enum AggStrategy
+{
+ AGG_STRATEGY_UNDEFINED = 0;
+ AGG_PLAIN = 1;
+ AGG_SORTED = 2;
+ AGG_HASHED = 3;
+ AGG_MIXED = 4;
+}
+
+enum AggSplit
+{
+ AGG_SPLIT_UNDEFINED = 0;
+ AGGSPLIT_SIMPLE = 1;
+ AGGSPLIT_INITIAL_SERIAL = 2;
+ AGGSPLIT_FINAL_DESERIAL = 3;
+}
+
+enum SetOpCmd
+{
+ SET_OP_CMD_UNDEFINED = 0;
+ SETOPCMD_INTERSECT = 1;
+ SETOPCMD_INTERSECT_ALL = 2;
+ SETOPCMD_EXCEPT = 3;
+ SETOPCMD_EXCEPT_ALL = 4;
+}
+
+enum SetOpStrategy
+{
+ SET_OP_STRATEGY_UNDEFINED = 0;
+ SETOP_SORTED = 1;
+ SETOP_HASHED = 2;
+}
+
+enum OnConflictAction
+{
+ ON_CONFLICT_ACTION_UNDEFINED = 0;
+ ONCONFLICT_NONE = 1;
+ ONCONFLICT_NOTHING = 2;
+ ONCONFLICT_UPDATE = 3;
+}
+
+enum LimitOption
+{
+ LIMIT_OPTION_UNDEFINED = 0;
+ LIMIT_OPTION_DEFAULT = 1;
+ LIMIT_OPTION_COUNT = 2;
+ LIMIT_OPTION_WITH_TIES = 3;
+}
+
+enum LockClauseStrength
+{
+ LOCK_CLAUSE_STRENGTH_UNDEFINED = 0;
+ LCS_NONE = 1;
+ LCS_FORKEYSHARE = 2;
+ LCS_FORSHARE = 3;
+ LCS_FORNOKEYUPDATE = 4;
+ LCS_FORUPDATE = 5;
+}
+
+enum LockWaitPolicy
+{
+ LOCK_WAIT_POLICY_UNDEFINED = 0;
+ LockWaitBlock = 1;
+ LockWaitSkip = 2;
+ LockWaitError = 3;
+}
+
+enum LockTupleMode
+{
+ LOCK_TUPLE_MODE_UNDEFINED = 0;
+ LockTupleKeyShare = 1;
+ LockTupleShare = 2;
+ LockTupleNoKeyExclusive = 3;
+ LockTupleExclusive = 4;
+}
+
+message ScanToken {
+ int32 start = 1;
+ int32 end = 2;
+ Token token = 4;
+ KeywordKind keyword_kind = 5;
+}
+
+enum KeywordKind {
+ NO_KEYWORD = 0;
+ UNRESERVED_KEYWORD = 1;
+ COL_NAME_KEYWORD = 2;
+ TYPE_FUNC_NAME_KEYWORD = 3;
+ RESERVED_KEYWORD = 4;
+}
+
+enum Token {
+ NUL = 0;
+ // Single-character tokens that are returned 1:1 (identical with "self" list in scan.l)
+ // Either supporting syntax, or single-character operators (some can be both)
+ // Also see https://www.postgresql.org/docs/12/sql-syntax-lexical.html#SQL-SYNTAX-SPECIAL-CHARS
+ ASCII_36 = 36; // "$"
+ ASCII_37 = 37; // "%"
+ ASCII_40 = 40; // "("
+ ASCII_41 = 41; // ")"
+ ASCII_42 = 42; // "*"
+ ASCII_43 = 43; // "+"
+ ASCII_44 = 44; // ","
+ ASCII_45 = 45; // "-"
+ ASCII_46 = 46; // "."
+ ASCII_47 = 47; // "/"
+ ASCII_58 = 58; // ":"
+ ASCII_59 = 59; // ";"
+ ASCII_60 = 60; // "<"
+ ASCII_61 = 61; // "="
+ ASCII_62 = 62; // ">"
+ ASCII_63 = 63; // "?"
+ ASCII_91 = 91; // "["
+ ASCII_92 = 92; // "\"
+ ASCII_93 = 93; // "]"
+ ASCII_94 = 94; // "^"
+ // Named tokens in scan.l
+ IDENT = 258;
+ UIDENT = 259;
+ FCONST = 260;
+ SCONST = 261;
+ USCONST = 262;
+ BCONST = 263;
+ XCONST = 264;
+ Op = 265;
+ ICONST = 266;
+ PARAM = 267;
+ TYPECAST = 268;
+ DOT_DOT = 269;
+ COLON_EQUALS = 270;
+ EQUALS_GREATER = 271;
+ LESS_EQUALS = 272;
+ GREATER_EQUALS = 273;
+ NOT_EQUALS = 274;
+ SQL_COMMENT = 275;
+ C_COMMENT = 276;
+ ABORT_P = 277;
+ ABSENT = 278;
+ ABSOLUTE_P = 279;
+ ACCESS = 280;
+ ACTION = 281;
+ ADD_P = 282;
+ ADMIN = 283;
+ AFTER = 284;
+ AGGREGATE = 285;
+ ALL = 286;
+ ALSO = 287;
+ ALTER = 288;
+ ALWAYS = 289;
+ ANALYSE = 290;
+ ANALYZE = 291;
+ AND = 292;
+ ANY = 293;
+ ARRAY = 294;
+ AS = 295;
+ ASC = 296;
+ ASENSITIVE = 297;
+ ASSERTION = 298;
+ ASSIGNMENT = 299;
+ ASYMMETRIC = 300;
+ ATOMIC = 301;
+ AT = 302;
+ ATTACH = 303;
+ ATTRIBUTE = 304;
+ AUTHORIZATION = 305;
+ BACKWARD = 306;
+ BEFORE = 307;
+ BEGIN_P = 308;
+ BETWEEN = 309;
+ BIGINT = 310;
+ BINARY = 311;
+ BIT = 312;
+ BOOLEAN_P = 313;
+ BOTH = 314;
+ BREADTH = 315;
+ BY = 316;
+ CACHE = 317;
+ CALL = 318;
+ CALLED = 319;
+ CASCADE = 320;
+ CASCADED = 321;
+ CASE = 322;
+ CAST = 323;
+ CATALOG_P = 324;
+ CHAIN = 325;
+ CHAR_P = 326;
+ CHARACTER = 327;
+ CHARACTERISTICS = 328;
+ CHECK = 329;
+ CHECKPOINT = 330;
+ CLASS = 331;
+ CLOSE = 332;
+ CLUSTER = 333;
+ COALESCE = 334;
+ COLLATE = 335;
+ COLLATION = 336;
+ COLUMN = 337;
+ COLUMNS = 338;
+ COMMENT = 339;
+ COMMENTS = 340;
+ COMMIT = 341;
+ COMMITTED = 342;
+ COMPRESSION = 343;
+ CONCURRENTLY = 344;
+ CONFIGURATION = 345;
+ CONFLICT = 346;
+ CONNECTION = 347;
+ CONSTRAINT = 348;
+ CONSTRAINTS = 349;
+ CONTENT_P = 350;
+ CONTINUE_P = 351;
+ CONVERSION_P = 352;
+ COPY = 353;
+ COST = 354;
+ CREATE = 355;
+ CROSS = 356;
+ CSV = 357;
+ CUBE = 358;
+ CURRENT_P = 359;
+ CURRENT_CATALOG = 360;
+ CURRENT_DATE = 361;
+ CURRENT_ROLE = 362;
+ CURRENT_SCHEMA = 363;
+ CURRENT_TIME = 364;
+ CURRENT_TIMESTAMP = 365;
+ CURRENT_USER = 366;
+ CURSOR = 367;
+ CYCLE = 368;
+ DATA_P = 369;
+ DATABASE = 370;
+ DAY_P = 371;
+ DEALLOCATE = 372;
+ DEC = 373;
+ DECIMAL_P = 374;
+ DECLARE = 375;
+ DEFAULT = 376;
+ DEFAULTS = 377;
+ DEFERRABLE = 378;
+ DEFERRED = 379;
+ DEFINER = 380;
+ DELETE_P = 381;
+ DELIMITER = 382;
+ DELIMITERS = 383;
+ DEPENDS = 384;
+ DEPTH = 385;
+ DESC = 386;
+ DETACH = 387;
+ DICTIONARY = 388;
+ DISABLE_P = 389;
+ DISCARD = 390;
+ DISTINCT = 391;
+ DO = 392;
+ DOCUMENT_P = 393;
+ DOMAIN_P = 394;
+ DOUBLE_P = 395;
+ DROP = 396;
+ EACH = 397;
+ ELSE = 398;
+ ENABLE_P = 399;
+ ENCODING = 400;
+ ENCRYPTED = 401;
+ END_P = 402;
+ ENUM_P = 403;
+ ESCAPE = 404;
+ EVENT = 405;
+ EXCEPT = 406;
+ EXCLUDE = 407;
+ EXCLUDING = 408;
+ EXCLUSIVE = 409;
+ EXECUTE = 410;
+ EXISTS = 411;
+ EXPLAIN = 412;
+ EXPRESSION = 413;
+ EXTENSION = 414;
+ EXTERNAL = 415;
+ EXTRACT = 416;
+ FALSE_P = 417;
+ FAMILY = 418;
+ FETCH = 419;
+ FILTER = 420;
+ FINALIZE = 421;
+ FIRST_P = 422;
+ FLOAT_P = 423;
+ FOLLOWING = 424;
+ FOR = 425;
+ FORCE = 426;
+ FOREIGN = 427;
+ FORMAT = 428;
+ FORWARD = 429;
+ FREEZE = 430;
+ FROM = 431;
+ FULL = 432;
+ FUNCTION = 433;
+ FUNCTIONS = 434;
+ GENERATED = 435;
+ GLOBAL = 436;
+ GRANT = 437;
+ GRANTED = 438;
+ GREATEST = 439;
+ GROUP_P = 440;
+ GROUPING = 441;
+ GROUPS = 442;
+ HANDLER = 443;
+ HAVING = 444;
+ HEADER_P = 445;
+ HOLD = 446;
+ HOUR_P = 447;
+ IDENTITY_P = 448;
+ IF_P = 449;
+ ILIKE = 450;
+ IMMEDIATE = 451;
+ IMMUTABLE = 452;
+ IMPLICIT_P = 453;
+ IMPORT_P = 454;
+ IN_P = 455;
+ INCLUDE = 456;
+ INCLUDING = 457;
+ INCREMENT = 458;
+ INDENT = 459;
+ INDEX = 460;
+ INDEXES = 461;
+ INHERIT = 462;
+ INHERITS = 463;
+ INITIALLY = 464;
+ INLINE_P = 465;
+ INNER_P = 466;
+ INOUT = 467;
+ INPUT_P = 468;
+ INSENSITIVE = 469;
+ INSERT = 470;
+ INSTEAD = 471;
+ INT_P = 472;
+ INTEGER = 473;
+ INTERSECT = 474;
+ INTERVAL = 475;
+ INTO = 476;
+ INVOKER = 477;
+ IS = 478;
+ ISNULL = 479;
+ ISOLATION = 480;
+ JOIN = 481;
+ JSON = 482;
+ JSON_ARRAY = 483;
+ JSON_ARRAYAGG = 484;
+ JSON_OBJECT = 485;
+ JSON_OBJECTAGG = 486;
+ KEY = 487;
+ KEYS = 488;
+ LABEL = 489;
+ LANGUAGE = 490;
+ LARGE_P = 491;
+ LAST_P = 492;
+ LATERAL_P = 493;
+ LEADING = 494;
+ LEAKPROOF = 495;
+ LEAST = 496;
+ LEFT = 497;
+ LEVEL = 498;
+ LIKE = 499;
+ LIMIT = 500;
+ LISTEN = 501;
+ LOAD = 502;
+ LOCAL = 503;
+ LOCALTIME = 504;
+ LOCALTIMESTAMP = 505;
+ LOCATION = 506;
+ LOCK_P = 507;
+ LOCKED = 508;
+ LOGGED = 509;
+ MAPPING = 510;
+ MATCH = 511;
+ MATCHED = 512;
+ MATERIALIZED = 513;
+ MAXVALUE = 514;
+ MERGE = 515;
+ METHOD = 516;
+ MINUTE_P = 517;
+ MINVALUE = 518;
+ MODE = 519;
+ MONTH_P = 520;
+ MOVE = 521;
+ NAME_P = 522;
+ NAMES = 523;
+ NATIONAL = 524;
+ NATURAL = 525;
+ NCHAR = 526;
+ NEW = 527;
+ NEXT = 528;
+ NFC = 529;
+ NFD = 530;
+ NFKC = 531;
+ NFKD = 532;
+ NO = 533;
+ NONE = 534;
+ NORMALIZE = 535;
+ NORMALIZED = 536;
+ NOT = 537;
+ NOTHING = 538;
+ NOTIFY = 539;
+ NOTNULL = 540;
+ NOWAIT = 541;
+ NULL_P = 542;
+ NULLIF = 543;
+ NULLS_P = 544;
+ NUMERIC = 545;
+ OBJECT_P = 546;
+ OF = 547;
+ OFF = 548;
+ OFFSET = 549;
+ OIDS = 550;
+ OLD = 551;
+ ON = 552;
+ ONLY = 553;
+ OPERATOR = 554;
+ OPTION = 555;
+ OPTIONS = 556;
+ OR = 557;
+ ORDER = 558;
+ ORDINALITY = 559;
+ OTHERS = 560;
+ OUT_P = 561;
+ OUTER_P = 562;
+ OVER = 563;
+ OVERLAPS = 564;
+ OVERLAY = 565;
+ OVERRIDING = 566;
+ OWNED = 567;
+ OWNER = 568;
+ PARALLEL = 569;
+ PARAMETER = 570;
+ PARSER = 571;
+ PARTIAL = 572;
+ PARTITION = 573;
+ PASSING = 574;
+ PASSWORD = 575;
+ PLACING = 576;
+ PLANS = 577;
+ POLICY = 578;
+ POSITION = 579;
+ PRECEDING = 580;
+ PRECISION = 581;
+ PRESERVE = 582;
+ PREPARE = 583;
+ PREPARED = 584;
+ PRIMARY = 585;
+ PRIOR = 586;
+ PRIVILEGES = 587;
+ PROCEDURAL = 588;
+ PROCEDURE = 589;
+ PROCEDURES = 590;
+ PROGRAM = 591;
+ PUBLICATION = 592;
+ QUOTE = 593;
+ RANGE = 594;
+ READ = 595;
+ REAL = 596;
+ REASSIGN = 597;
+ RECHECK = 598;
+ RECURSIVE = 599;
+ REF_P = 600;
+ REFERENCES = 601;
+ REFERENCING = 602;
+ REFRESH = 603;
+ REINDEX = 604;
+ RELATIVE_P = 605;
+ RELEASE = 606;
+ RENAME = 607;
+ REPEATABLE = 608;
+ REPLACE = 609;
+ REPLICA = 610;
+ RESET = 611;
+ RESTART = 612;
+ RESTRICT = 613;
+ RETURN = 614;
+ RETURNING = 615;
+ RETURNS = 616;
+ REVOKE = 617;
+ RIGHT = 618;
+ ROLE = 619;
+ ROLLBACK = 620;
+ ROLLUP = 621;
+ ROUTINE = 622;
+ ROUTINES = 623;
+ ROW = 624;
+ ROWS = 625;
+ RULE = 626;
+ SAVEPOINT = 627;
+ SCALAR = 628;
+ SCHEMA = 629;
+ SCHEMAS = 630;
+ SCROLL = 631;
+ SEARCH = 632;
+ SECOND_P = 633;
+ SECURITY = 634;
+ SELECT = 635;
+ SEQUENCE = 636;
+ SEQUENCES = 637;
+ SERIALIZABLE = 638;
+ SERVER = 639;
+ SESSION = 640;
+ SESSION_USER = 641;
+ SET = 642;
+ SETS = 643;
+ SETOF = 644;
+ SHARE = 645;
+ SHOW = 646;
+ SIMILAR = 647;
+ SIMPLE = 648;
+ SKIP = 649;
+ SMALLINT = 650;
+ SNAPSHOT = 651;
+ SOME = 652;
+ SQL_P = 653;
+ STABLE = 654;
+ STANDALONE_P = 655;
+ START = 656;
+ STATEMENT = 657;
+ STATISTICS = 658;
+ STDIN = 659;
+ STDOUT = 660;
+ STORAGE = 661;
+ STORED = 662;
+ STRICT_P = 663;
+ STRIP_P = 664;
+ SUBSCRIPTION = 665;
+ SUBSTRING = 666;
+ SUPPORT = 667;
+ SYMMETRIC = 668;
+ SYSID = 669;
+ SYSTEM_P = 670;
+ SYSTEM_USER = 671;
+ TABLE = 672;
+ TABLES = 673;
+ TABLESAMPLE = 674;
+ TABLESPACE = 675;
+ TEMP = 676;
+ TEMPLATE = 677;
+ TEMPORARY = 678;
+ TEXT_P = 679;
+ THEN = 680;
+ TIES = 681;
+ TIME = 682;
+ TIMESTAMP = 683;
+ TO = 684;
+ TRAILING = 685;
+ TRANSACTION = 686;
+ TRANSFORM = 687;
+ TREAT = 688;
+ TRIGGER = 689;
+ TRIM = 690;
+ TRUE_P = 691;
+ TRUNCATE = 692;
+ TRUSTED = 693;
+ TYPE_P = 694;
+ TYPES_P = 695;
+ UESCAPE = 696;
+ UNBOUNDED = 697;
+ UNCOMMITTED = 698;
+ UNENCRYPTED = 699;
+ UNION = 700;
+ UNIQUE = 701;
+ UNKNOWN = 702;
+ UNLISTEN = 703;
+ UNLOGGED = 704;
+ UNTIL = 705;
+ UPDATE = 706;
+ USER = 707;
+ USING = 708;
+ VACUUM = 709;
+ VALID = 710;
+ VALIDATE = 711;
+ VALIDATOR = 712;
+ VALUE_P = 713;
+ VALUES = 714;
+ VARCHAR = 715;
+ VARIADIC = 716;
+ VARYING = 717;
+ VERBOSE = 718;
+ VERSION_P = 719;
+ VIEW = 720;
+ VIEWS = 721;
+ VOLATILE = 722;
+ WHEN = 723;
+ WHERE = 724;
+ WHITESPACE_P = 725;
+ WINDOW = 726;
+ WITH = 727;
+ WITHIN = 728;
+ WITHOUT = 729;
+ WORK = 730;
+ WRAPPER = 731;
+ WRITE = 732;
+ XML_P = 733;
+ XMLATTRIBUTES = 734;
+ XMLCONCAT = 735;
+ XMLELEMENT = 736;
+ XMLEXISTS = 737;
+ XMLFOREST = 738;
+ XMLNAMESPACES = 739;
+ XMLPARSE = 740;
+ XMLPI = 741;
+ XMLROOT = 742;
+ XMLSERIALIZE = 743;
+ XMLTABLE = 744;
+ YEAR_P = 745;
+ YES_P = 746;
+ ZONE = 747;
+ FORMAT_LA = 748;
+ NOT_LA = 749;
+ NULLS_LA = 750;
+ WITH_LA = 751;
+ WITHOUT_LA = 752;
+ MODE_TYPE_NAME = 753;
+ MODE_PLPGSQL_EXPR = 754;
+ MODE_PLPGSQL_ASSIGN1 = 755;
+ MODE_PLPGSQL_ASSIGN2 = 756;
+ MODE_PLPGSQL_ASSIGN3 = 757;
+ UMINUS = 758;
+}
diff --git a/protos/17/pg_query.proto b/protos/17/pg_query.proto
new file mode 100644
index 00000000..24a8f14c
--- /dev/null
+++ b/protos/17/pg_query.proto
@@ -0,0 +1,4110 @@
+// This file is autogenerated by ./scripts/generate_protobuf_and_funcs.rb
+
+syntax = "proto3";
+
+package pg_query;
+
+message ParseResult {
+ int32 version = 1;
+ repeated RawStmt stmts = 2;
+}
+
+message ScanResult {
+ int32 version = 1;
+ repeated ScanToken tokens = 2;
+}
+
+message Node {
+ oneof node {
+ Alias alias = 1 [json_name="Alias"];
+ RangeVar range_var = 2 [json_name="RangeVar"];
+ TableFunc table_func = 3 [json_name="TableFunc"];
+ IntoClause into_clause = 4 [json_name="IntoClause"];
+ Var var = 5 [json_name="Var"];
+ Param param = 6 [json_name="Param"];
+ Aggref aggref = 7 [json_name="Aggref"];
+ GroupingFunc grouping_func = 8 [json_name="GroupingFunc"];
+ WindowFunc window_func = 9 [json_name="WindowFunc"];
+ WindowFuncRunCondition window_func_run_condition = 10 [json_name="WindowFuncRunCondition"];
+ MergeSupportFunc merge_support_func = 11 [json_name="MergeSupportFunc"];
+ SubscriptingRef subscripting_ref = 12 [json_name="SubscriptingRef"];
+ FuncExpr func_expr = 13 [json_name="FuncExpr"];
+ NamedArgExpr named_arg_expr = 14 [json_name="NamedArgExpr"];
+ OpExpr op_expr = 15 [json_name="OpExpr"];
+ DistinctExpr distinct_expr = 16 [json_name="DistinctExpr"];
+ NullIfExpr null_if_expr = 17 [json_name="NullIfExpr"];
+ ScalarArrayOpExpr scalar_array_op_expr = 18 [json_name="ScalarArrayOpExpr"];
+ BoolExpr bool_expr = 19 [json_name="BoolExpr"];
+ SubLink sub_link = 20 [json_name="SubLink"];
+ SubPlan sub_plan = 21 [json_name="SubPlan"];
+ AlternativeSubPlan alternative_sub_plan = 22 [json_name="AlternativeSubPlan"];
+ FieldSelect field_select = 23 [json_name="FieldSelect"];
+ FieldStore field_store = 24 [json_name="FieldStore"];
+ RelabelType relabel_type = 25 [json_name="RelabelType"];
+ CoerceViaIO coerce_via_io = 26 [json_name="CoerceViaIO"];
+ ArrayCoerceExpr array_coerce_expr = 27 [json_name="ArrayCoerceExpr"];
+ ConvertRowtypeExpr convert_rowtype_expr = 28 [json_name="ConvertRowtypeExpr"];
+ CollateExpr collate_expr = 29 [json_name="CollateExpr"];
+ CaseExpr case_expr = 30 [json_name="CaseExpr"];
+ CaseWhen case_when = 31 [json_name="CaseWhen"];
+ CaseTestExpr case_test_expr = 32 [json_name="CaseTestExpr"];
+ ArrayExpr array_expr = 33 [json_name="ArrayExpr"];
+ RowExpr row_expr = 34 [json_name="RowExpr"];
+ RowCompareExpr row_compare_expr = 35 [json_name="RowCompareExpr"];
+ CoalesceExpr coalesce_expr = 36 [json_name="CoalesceExpr"];
+ MinMaxExpr min_max_expr = 37 [json_name="MinMaxExpr"];
+ SQLValueFunction sqlvalue_function = 38 [json_name="SQLValueFunction"];
+ XmlExpr xml_expr = 39 [json_name="XmlExpr"];
+ JsonFormat json_format = 40 [json_name="JsonFormat"];
+ JsonReturning json_returning = 41 [json_name="JsonReturning"];
+ JsonValueExpr json_value_expr = 42 [json_name="JsonValueExpr"];
+ JsonConstructorExpr json_constructor_expr = 43 [json_name="JsonConstructorExpr"];
+ JsonIsPredicate json_is_predicate = 44 [json_name="JsonIsPredicate"];
+ JsonBehavior json_behavior = 45 [json_name="JsonBehavior"];
+ JsonExpr json_expr = 46 [json_name="JsonExpr"];
+ JsonTablePath json_table_path = 47 [json_name="JsonTablePath"];
+ JsonTablePathScan json_table_path_scan = 48 [json_name="JsonTablePathScan"];
+ JsonTableSiblingJoin json_table_sibling_join = 49 [json_name="JsonTableSiblingJoin"];
+ NullTest null_test = 50 [json_name="NullTest"];
+ BooleanTest boolean_test = 51 [json_name="BooleanTest"];
+ MergeAction merge_action = 52 [json_name="MergeAction"];
+ CoerceToDomain coerce_to_domain = 53 [json_name="CoerceToDomain"];
+ CoerceToDomainValue coerce_to_domain_value = 54 [json_name="CoerceToDomainValue"];
+ SetToDefault set_to_default = 55 [json_name="SetToDefault"];
+ CurrentOfExpr current_of_expr = 56 [json_name="CurrentOfExpr"];
+ NextValueExpr next_value_expr = 57 [json_name="NextValueExpr"];
+ InferenceElem inference_elem = 58 [json_name="InferenceElem"];
+ TargetEntry target_entry = 59 [json_name="TargetEntry"];
+ RangeTblRef range_tbl_ref = 60 [json_name="RangeTblRef"];
+ JoinExpr join_expr = 61 [json_name="JoinExpr"];
+ FromExpr from_expr = 62 [json_name="FromExpr"];
+ OnConflictExpr on_conflict_expr = 63 [json_name="OnConflictExpr"];
+ Query query = 64 [json_name="Query"];
+ TypeName type_name = 65 [json_name="TypeName"];
+ ColumnRef column_ref = 66 [json_name="ColumnRef"];
+ ParamRef param_ref = 67 [json_name="ParamRef"];
+ A_Expr a_expr = 68 [json_name="A_Expr"];
+ TypeCast type_cast = 69 [json_name="TypeCast"];
+ CollateClause collate_clause = 70 [json_name="CollateClause"];
+ RoleSpec role_spec = 71 [json_name="RoleSpec"];
+ FuncCall func_call = 72 [json_name="FuncCall"];
+ A_Star a_star = 73 [json_name="A_Star"];
+ A_Indices a_indices = 74 [json_name="A_Indices"];
+ A_Indirection a_indirection = 75 [json_name="A_Indirection"];
+ A_ArrayExpr a_array_expr = 76 [json_name="A_ArrayExpr"];
+ ResTarget res_target = 77 [json_name="ResTarget"];
+ MultiAssignRef multi_assign_ref = 78 [json_name="MultiAssignRef"];
+ SortBy sort_by = 79 [json_name="SortBy"];
+ WindowDef window_def = 80 [json_name="WindowDef"];
+ RangeSubselect range_subselect = 81 [json_name="RangeSubselect"];
+ RangeFunction range_function = 82 [json_name="RangeFunction"];
+ RangeTableFunc range_table_func = 83 [json_name="RangeTableFunc"];
+ RangeTableFuncCol range_table_func_col = 84 [json_name="RangeTableFuncCol"];
+ RangeTableSample range_table_sample = 85 [json_name="RangeTableSample"];
+ ColumnDef column_def = 86 [json_name="ColumnDef"];
+ TableLikeClause table_like_clause = 87 [json_name="TableLikeClause"];
+ IndexElem index_elem = 88 [json_name="IndexElem"];
+ DefElem def_elem = 89 [json_name="DefElem"];
+ LockingClause locking_clause = 90 [json_name="LockingClause"];
+ XmlSerialize xml_serialize = 91 [json_name="XmlSerialize"];
+ PartitionElem partition_elem = 92 [json_name="PartitionElem"];
+ PartitionSpec partition_spec = 93 [json_name="PartitionSpec"];
+ PartitionBoundSpec partition_bound_spec = 94 [json_name="PartitionBoundSpec"];
+ PartitionRangeDatum partition_range_datum = 95 [json_name="PartitionRangeDatum"];
+ SinglePartitionSpec single_partition_spec = 96 [json_name="SinglePartitionSpec"];
+ PartitionCmd partition_cmd = 97 [json_name="PartitionCmd"];
+ RangeTblEntry range_tbl_entry = 98 [json_name="RangeTblEntry"];
+ RTEPermissionInfo rtepermission_info = 99 [json_name="RTEPermissionInfo"];
+ RangeTblFunction range_tbl_function = 100 [json_name="RangeTblFunction"];
+ TableSampleClause table_sample_clause = 101 [json_name="TableSampleClause"];
+ WithCheckOption with_check_option = 102 [json_name="WithCheckOption"];
+ SortGroupClause sort_group_clause = 103 [json_name="SortGroupClause"];
+ GroupingSet grouping_set = 104 [json_name="GroupingSet"];
+ WindowClause window_clause = 105 [json_name="WindowClause"];
+ RowMarkClause row_mark_clause = 106 [json_name="RowMarkClause"];
+ WithClause with_clause = 107 [json_name="WithClause"];
+ InferClause infer_clause = 108 [json_name="InferClause"];
+ OnConflictClause on_conflict_clause = 109 [json_name="OnConflictClause"];
+ CTESearchClause ctesearch_clause = 110 [json_name="CTESearchClause"];
+ CTECycleClause ctecycle_clause = 111 [json_name="CTECycleClause"];
+ CommonTableExpr common_table_expr = 112 [json_name="CommonTableExpr"];
+ MergeWhenClause merge_when_clause = 113 [json_name="MergeWhenClause"];
+ TriggerTransition trigger_transition = 114 [json_name="TriggerTransition"];
+ JsonOutput json_output = 115 [json_name="JsonOutput"];
+ JsonArgument json_argument = 116 [json_name="JsonArgument"];
+ JsonFuncExpr json_func_expr = 117 [json_name="JsonFuncExpr"];
+ JsonTablePathSpec json_table_path_spec = 118 [json_name="JsonTablePathSpec"];
+ JsonTable json_table = 119 [json_name="JsonTable"];
+ JsonTableColumn json_table_column = 120 [json_name="JsonTableColumn"];
+ JsonKeyValue json_key_value = 121 [json_name="JsonKeyValue"];
+ JsonParseExpr json_parse_expr = 122 [json_name="JsonParseExpr"];
+ JsonScalarExpr json_scalar_expr = 123 [json_name="JsonScalarExpr"];
+ JsonSerializeExpr json_serialize_expr = 124 [json_name="JsonSerializeExpr"];
+ JsonObjectConstructor json_object_constructor = 125 [json_name="JsonObjectConstructor"];
+ JsonArrayConstructor json_array_constructor = 126 [json_name="JsonArrayConstructor"];
+ JsonArrayQueryConstructor json_array_query_constructor = 127 [json_name="JsonArrayQueryConstructor"];
+ JsonAggConstructor json_agg_constructor = 128 [json_name="JsonAggConstructor"];
+ JsonObjectAgg json_object_agg = 129 [json_name="JsonObjectAgg"];
+ JsonArrayAgg json_array_agg = 130 [json_name="JsonArrayAgg"];
+ RawStmt raw_stmt = 131 [json_name="RawStmt"];
+ InsertStmt insert_stmt = 132 [json_name="InsertStmt"];
+ DeleteStmt delete_stmt = 133 [json_name="DeleteStmt"];
+ UpdateStmt update_stmt = 134 [json_name="UpdateStmt"];
+ MergeStmt merge_stmt = 135 [json_name="MergeStmt"];
+ SelectStmt select_stmt = 136 [json_name="SelectStmt"];
+ SetOperationStmt set_operation_stmt = 137 [json_name="SetOperationStmt"];
+ ReturnStmt return_stmt = 138 [json_name="ReturnStmt"];
+ PLAssignStmt plassign_stmt = 139 [json_name="PLAssignStmt"];
+ CreateSchemaStmt create_schema_stmt = 140 [json_name="CreateSchemaStmt"];
+ AlterTableStmt alter_table_stmt = 141 [json_name="AlterTableStmt"];
+ ReplicaIdentityStmt replica_identity_stmt = 142 [json_name="ReplicaIdentityStmt"];
+ AlterTableCmd alter_table_cmd = 143 [json_name="AlterTableCmd"];
+ AlterCollationStmt alter_collation_stmt = 144 [json_name="AlterCollationStmt"];
+ AlterDomainStmt alter_domain_stmt = 145 [json_name="AlterDomainStmt"];
+ GrantStmt grant_stmt = 146 [json_name="GrantStmt"];
+ ObjectWithArgs object_with_args = 147 [json_name="ObjectWithArgs"];
+ AccessPriv access_priv = 148 [json_name="AccessPriv"];
+ GrantRoleStmt grant_role_stmt = 149 [json_name="GrantRoleStmt"];
+ AlterDefaultPrivilegesStmt alter_default_privileges_stmt = 150 [json_name="AlterDefaultPrivilegesStmt"];
+ CopyStmt copy_stmt = 151 [json_name="CopyStmt"];
+ VariableSetStmt variable_set_stmt = 152 [json_name="VariableSetStmt"];
+ VariableShowStmt variable_show_stmt = 153 [json_name="VariableShowStmt"];
+ CreateStmt create_stmt = 154 [json_name="CreateStmt"];
+ Constraint constraint = 155 [json_name="Constraint"];
+ CreateTableSpaceStmt create_table_space_stmt = 156 [json_name="CreateTableSpaceStmt"];
+ DropTableSpaceStmt drop_table_space_stmt = 157 [json_name="DropTableSpaceStmt"];
+ AlterTableSpaceOptionsStmt alter_table_space_options_stmt = 158 [json_name="AlterTableSpaceOptionsStmt"];
+ AlterTableMoveAllStmt alter_table_move_all_stmt = 159 [json_name="AlterTableMoveAllStmt"];
+ CreateExtensionStmt create_extension_stmt = 160 [json_name="CreateExtensionStmt"];
+ AlterExtensionStmt alter_extension_stmt = 161 [json_name="AlterExtensionStmt"];
+ AlterExtensionContentsStmt alter_extension_contents_stmt = 162 [json_name="AlterExtensionContentsStmt"];
+ CreateFdwStmt create_fdw_stmt = 163 [json_name="CreateFdwStmt"];
+ AlterFdwStmt alter_fdw_stmt = 164 [json_name="AlterFdwStmt"];
+ CreateForeignServerStmt create_foreign_server_stmt = 165 [json_name="CreateForeignServerStmt"];
+ AlterForeignServerStmt alter_foreign_server_stmt = 166 [json_name="AlterForeignServerStmt"];
+ CreateForeignTableStmt create_foreign_table_stmt = 167 [json_name="CreateForeignTableStmt"];
+ CreateUserMappingStmt create_user_mapping_stmt = 168 [json_name="CreateUserMappingStmt"];
+ AlterUserMappingStmt alter_user_mapping_stmt = 169 [json_name="AlterUserMappingStmt"];
+ DropUserMappingStmt drop_user_mapping_stmt = 170 [json_name="DropUserMappingStmt"];
+ ImportForeignSchemaStmt import_foreign_schema_stmt = 171 [json_name="ImportForeignSchemaStmt"];
+ CreatePolicyStmt create_policy_stmt = 172 [json_name="CreatePolicyStmt"];
+ AlterPolicyStmt alter_policy_stmt = 173 [json_name="AlterPolicyStmt"];
+ CreateAmStmt create_am_stmt = 174 [json_name="CreateAmStmt"];
+ CreateTrigStmt create_trig_stmt = 175 [json_name="CreateTrigStmt"];
+ CreateEventTrigStmt create_event_trig_stmt = 176 [json_name="CreateEventTrigStmt"];
+ AlterEventTrigStmt alter_event_trig_stmt = 177 [json_name="AlterEventTrigStmt"];
+ CreatePLangStmt create_plang_stmt = 178 [json_name="CreatePLangStmt"];
+ CreateRoleStmt create_role_stmt = 179 [json_name="CreateRoleStmt"];
+ AlterRoleStmt alter_role_stmt = 180 [json_name="AlterRoleStmt"];
+ AlterRoleSetStmt alter_role_set_stmt = 181 [json_name="AlterRoleSetStmt"];
+ DropRoleStmt drop_role_stmt = 182 [json_name="DropRoleStmt"];
+ CreateSeqStmt create_seq_stmt = 183 [json_name="CreateSeqStmt"];
+ AlterSeqStmt alter_seq_stmt = 184 [json_name="AlterSeqStmt"];
+ DefineStmt define_stmt = 185 [json_name="DefineStmt"];
+ CreateDomainStmt create_domain_stmt = 186 [json_name="CreateDomainStmt"];
+ CreateOpClassStmt create_op_class_stmt = 187 [json_name="CreateOpClassStmt"];
+ CreateOpClassItem create_op_class_item = 188 [json_name="CreateOpClassItem"];
+ CreateOpFamilyStmt create_op_family_stmt = 189 [json_name="CreateOpFamilyStmt"];
+ AlterOpFamilyStmt alter_op_family_stmt = 190 [json_name="AlterOpFamilyStmt"];
+ DropStmt drop_stmt = 191 [json_name="DropStmt"];
+ TruncateStmt truncate_stmt = 192 [json_name="TruncateStmt"];
+ CommentStmt comment_stmt = 193 [json_name="CommentStmt"];
+ SecLabelStmt sec_label_stmt = 194 [json_name="SecLabelStmt"];
+ DeclareCursorStmt declare_cursor_stmt = 195 [json_name="DeclareCursorStmt"];
+ ClosePortalStmt close_portal_stmt = 196 [json_name="ClosePortalStmt"];
+ FetchStmt fetch_stmt = 197 [json_name="FetchStmt"];
+ IndexStmt index_stmt = 198 [json_name="IndexStmt"];
+ CreateStatsStmt create_stats_stmt = 199 [json_name="CreateStatsStmt"];
+ StatsElem stats_elem = 200 [json_name="StatsElem"];
+ AlterStatsStmt alter_stats_stmt = 201 [json_name="AlterStatsStmt"];
+ CreateFunctionStmt create_function_stmt = 202 [json_name="CreateFunctionStmt"];
+ FunctionParameter function_parameter = 203 [json_name="FunctionParameter"];
+ AlterFunctionStmt alter_function_stmt = 204 [json_name="AlterFunctionStmt"];
+ DoStmt do_stmt = 205 [json_name="DoStmt"];
+ InlineCodeBlock inline_code_block = 206 [json_name="InlineCodeBlock"];
+ CallStmt call_stmt = 207 [json_name="CallStmt"];
+ CallContext call_context = 208 [json_name="CallContext"];
+ RenameStmt rename_stmt = 209 [json_name="RenameStmt"];
+ AlterObjectDependsStmt alter_object_depends_stmt = 210 [json_name="AlterObjectDependsStmt"];
+ AlterObjectSchemaStmt alter_object_schema_stmt = 211 [json_name="AlterObjectSchemaStmt"];
+ AlterOwnerStmt alter_owner_stmt = 212 [json_name="AlterOwnerStmt"];
+ AlterOperatorStmt alter_operator_stmt = 213 [json_name="AlterOperatorStmt"];
+ AlterTypeStmt alter_type_stmt = 214 [json_name="AlterTypeStmt"];
+ RuleStmt rule_stmt = 215 [json_name="RuleStmt"];
+ NotifyStmt notify_stmt = 216 [json_name="NotifyStmt"];
+ ListenStmt listen_stmt = 217 [json_name="ListenStmt"];
+ UnlistenStmt unlisten_stmt = 218 [json_name="UnlistenStmt"];
+ TransactionStmt transaction_stmt = 219 [json_name="TransactionStmt"];
+ CompositeTypeStmt composite_type_stmt = 220 [json_name="CompositeTypeStmt"];
+ CreateEnumStmt create_enum_stmt = 221 [json_name="CreateEnumStmt"];
+ CreateRangeStmt create_range_stmt = 222 [json_name="CreateRangeStmt"];
+ AlterEnumStmt alter_enum_stmt = 223 [json_name="AlterEnumStmt"];
+ ViewStmt view_stmt = 224 [json_name="ViewStmt"];
+ LoadStmt load_stmt = 225 [json_name="LoadStmt"];
+ CreatedbStmt createdb_stmt = 226 [json_name="CreatedbStmt"];
+ AlterDatabaseStmt alter_database_stmt = 227 [json_name="AlterDatabaseStmt"];
+ AlterDatabaseRefreshCollStmt alter_database_refresh_coll_stmt = 228 [json_name="AlterDatabaseRefreshCollStmt"];
+ AlterDatabaseSetStmt alter_database_set_stmt = 229 [json_name="AlterDatabaseSetStmt"];
+ DropdbStmt dropdb_stmt = 230 [json_name="DropdbStmt"];
+ AlterSystemStmt alter_system_stmt = 231 [json_name="AlterSystemStmt"];
+ ClusterStmt cluster_stmt = 232 [json_name="ClusterStmt"];
+ VacuumStmt vacuum_stmt = 233 [json_name="VacuumStmt"];
+ VacuumRelation vacuum_relation = 234 [json_name="VacuumRelation"];
+ ExplainStmt explain_stmt = 235 [json_name="ExplainStmt"];
+ CreateTableAsStmt create_table_as_stmt = 236 [json_name="CreateTableAsStmt"];
+ RefreshMatViewStmt refresh_mat_view_stmt = 237 [json_name="RefreshMatViewStmt"];
+ CheckPointStmt check_point_stmt = 238 [json_name="CheckPointStmt"];
+ DiscardStmt discard_stmt = 239 [json_name="DiscardStmt"];
+ LockStmt lock_stmt = 240 [json_name="LockStmt"];
+ ConstraintsSetStmt constraints_set_stmt = 241 [json_name="ConstraintsSetStmt"];
+ ReindexStmt reindex_stmt = 242 [json_name="ReindexStmt"];
+ CreateConversionStmt create_conversion_stmt = 243 [json_name="CreateConversionStmt"];
+ CreateCastStmt create_cast_stmt = 244 [json_name="CreateCastStmt"];
+ CreateTransformStmt create_transform_stmt = 245 [json_name="CreateTransformStmt"];
+ PrepareStmt prepare_stmt = 246 [json_name="PrepareStmt"];
+ ExecuteStmt execute_stmt = 247 [json_name="ExecuteStmt"];
+ DeallocateStmt deallocate_stmt = 248 [json_name="DeallocateStmt"];
+ DropOwnedStmt drop_owned_stmt = 249 [json_name="DropOwnedStmt"];
+ ReassignOwnedStmt reassign_owned_stmt = 250 [json_name="ReassignOwnedStmt"];
+ AlterTSDictionaryStmt alter_tsdictionary_stmt = 251 [json_name="AlterTSDictionaryStmt"];
+ AlterTSConfigurationStmt alter_tsconfiguration_stmt = 252 [json_name="AlterTSConfigurationStmt"];
+ PublicationTable publication_table = 253 [json_name="PublicationTable"];
+ PublicationObjSpec publication_obj_spec = 254 [json_name="PublicationObjSpec"];
+ CreatePublicationStmt create_publication_stmt = 255 [json_name="CreatePublicationStmt"];
+ AlterPublicationStmt alter_publication_stmt = 256 [json_name="AlterPublicationStmt"];
+ CreateSubscriptionStmt create_subscription_stmt = 257 [json_name="CreateSubscriptionStmt"];
+ AlterSubscriptionStmt alter_subscription_stmt = 258 [json_name="AlterSubscriptionStmt"];
+ DropSubscriptionStmt drop_subscription_stmt = 259 [json_name="DropSubscriptionStmt"];
+ Integer integer = 260 [json_name="Integer"];
+ Float float = 261 [json_name="Float"];
+ Boolean boolean = 262 [json_name="Boolean"];
+ String string = 263 [json_name="String"];
+ BitString bit_string = 264 [json_name="BitString"];
+ List list = 265 [json_name="List"];
+ IntList int_list = 266 [json_name="IntList"];
+ OidList oid_list = 267 [json_name="OidList"];
+ A_Const a_const = 268 [json_name="A_Const"];
+ }
+}
+
+message Integer
+{
+ int32 ival = 1; /* machine integer */
+}
+
+message Float
+{
+ string fval = 1; /* string */
+}
+
+message Boolean
+{
+ bool boolval = 1;
+}
+
+message String
+{
+ string sval = 1; /* string */
+}
+
+message BitString
+{
+ string bsval = 1; /* string */
+}
+
+message List
+{
+ repeated Node items = 1;
+}
+
+message OidList
+{
+ repeated Node items = 1;
+}
+
+message IntList
+{
+ repeated Node items = 1;
+}
+
+message A_Const
+{
+ oneof val {
+ Integer ival = 1;
+ Float fval = 2;
+ Boolean boolval = 3;
+ String sval = 4;
+ BitString bsval = 5;
+ }
+ bool isnull = 10;
+ int32 location = 11;
+}
+
+message Alias
+{
+ string aliasname = 1 [json_name="aliasname"];
+ repeated Node colnames = 2 [json_name="colnames"];
+}
+
+message RangeVar
+{
+ string catalogname = 1 [json_name="catalogname"];
+ string schemaname = 2 [json_name="schemaname"];
+ string relname = 3 [json_name="relname"];
+ bool inh = 4 [json_name="inh"];
+ string relpersistence = 5 [json_name="relpersistence"];
+ Alias alias = 6 [json_name="alias"];
+ int32 location = 7 [json_name="location"];
+}
+
+message TableFunc
+{
+ TableFuncType functype = 1 [json_name="functype"];
+ repeated Node ns_uris = 2 [json_name="ns_uris"];
+ repeated Node ns_names = 3 [json_name="ns_names"];
+ Node docexpr = 4 [json_name="docexpr"];
+ Node rowexpr = 5 [json_name="rowexpr"];
+ repeated Node colnames = 6 [json_name="colnames"];
+ repeated Node coltypes = 7 [json_name="coltypes"];
+ repeated Node coltypmods = 8 [json_name="coltypmods"];
+ repeated Node colcollations = 9 [json_name="colcollations"];
+ repeated Node colexprs = 10 [json_name="colexprs"];
+ repeated Node coldefexprs = 11 [json_name="coldefexprs"];
+ repeated Node colvalexprs = 12 [json_name="colvalexprs"];
+ repeated Node passingvalexprs = 13 [json_name="passingvalexprs"];
+ repeated uint64 notnulls = 14 [json_name="notnulls"];
+ Node plan = 15 [json_name="plan"];
+ int32 ordinalitycol = 16 [json_name="ordinalitycol"];
+ int32 location = 17 [json_name="location"];
+}
+
+message IntoClause
+{
+ RangeVar rel = 1 [json_name="rel"];
+ repeated Node col_names = 2 [json_name="colNames"];
+ string access_method = 3 [json_name="accessMethod"];
+ repeated Node options = 4 [json_name="options"];
+ OnCommitAction on_commit = 5 [json_name="onCommit"];
+ string table_space_name = 6 [json_name="tableSpaceName"];
+ Node view_query = 7 [json_name="viewQuery"];
+ bool skip_data = 8 [json_name="skipData"];
+}
+
+message Var
+{
+ Node xpr = 1 [json_name="xpr"];
+ int32 varno = 2 [json_name="varno"];
+ int32 varattno = 3 [json_name="varattno"];
+ uint32 vartype = 4 [json_name="vartype"];
+ int32 vartypmod = 5 [json_name="vartypmod"];
+ uint32 varcollid = 6 [json_name="varcollid"];
+ repeated uint64 varnullingrels = 7 [json_name="varnullingrels"];
+ uint32 varlevelsup = 8 [json_name="varlevelsup"];
+ int32 location = 9 [json_name="location"];
+}
+
+message Param
+{
+ Node xpr = 1 [json_name="xpr"];
+ ParamKind paramkind = 2 [json_name="paramkind"];
+ int32 paramid = 3 [json_name="paramid"];
+ uint32 paramtype = 4 [json_name="paramtype"];
+ int32 paramtypmod = 5 [json_name="paramtypmod"];
+ uint32 paramcollid = 6 [json_name="paramcollid"];
+ int32 location = 7 [json_name="location"];
+}
+
+message Aggref
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 aggfnoid = 2 [json_name="aggfnoid"];
+ uint32 aggtype = 3 [json_name="aggtype"];
+ uint32 aggcollid = 4 [json_name="aggcollid"];
+ uint32 inputcollid = 5 [json_name="inputcollid"];
+ repeated Node aggargtypes = 6 [json_name="aggargtypes"];
+ repeated Node aggdirectargs = 7 [json_name="aggdirectargs"];
+ repeated Node args = 8 [json_name="args"];
+ repeated Node aggorder = 9 [json_name="aggorder"];
+ repeated Node aggdistinct = 10 [json_name="aggdistinct"];
+ Node aggfilter = 11 [json_name="aggfilter"];
+ bool aggstar = 12 [json_name="aggstar"];
+ bool aggvariadic = 13 [json_name="aggvariadic"];
+ string aggkind = 14 [json_name="aggkind"];
+ uint32 agglevelsup = 15 [json_name="agglevelsup"];
+ AggSplit aggsplit = 16 [json_name="aggsplit"];
+ int32 aggno = 17 [json_name="aggno"];
+ int32 aggtransno = 18 [json_name="aggtransno"];
+ int32 location = 19 [json_name="location"];
+}
+
+message GroupingFunc
+{
+ Node xpr = 1 [json_name="xpr"];
+ repeated Node args = 2 [json_name="args"];
+ repeated Node refs = 3 [json_name="refs"];
+ uint32 agglevelsup = 4 [json_name="agglevelsup"];
+ int32 location = 5 [json_name="location"];
+}
+
+message WindowFunc
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 winfnoid = 2 [json_name="winfnoid"];
+ uint32 wintype = 3 [json_name="wintype"];
+ uint32 wincollid = 4 [json_name="wincollid"];
+ uint32 inputcollid = 5 [json_name="inputcollid"];
+ repeated Node args = 6 [json_name="args"];
+ Node aggfilter = 7 [json_name="aggfilter"];
+ repeated Node run_condition = 8 [json_name="runCondition"];
+ uint32 winref = 9 [json_name="winref"];
+ bool winstar = 10 [json_name="winstar"];
+ bool winagg = 11 [json_name="winagg"];
+ int32 location = 12 [json_name="location"];
+}
+
+message WindowFuncRunCondition
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 opno = 2 [json_name="opno"];
+ uint32 inputcollid = 3 [json_name="inputcollid"];
+ bool wfunc_left = 4 [json_name="wfunc_left"];
+ Node arg = 5 [json_name="arg"];
+}
+
+message MergeSupportFunc
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 msftype = 2 [json_name="msftype"];
+ uint32 msfcollid = 3 [json_name="msfcollid"];
+ int32 location = 4 [json_name="location"];
+}
+
+message SubscriptingRef
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 refcontainertype = 2 [json_name="refcontainertype"];
+ uint32 refelemtype = 3 [json_name="refelemtype"];
+ uint32 refrestype = 4 [json_name="refrestype"];
+ int32 reftypmod = 5 [json_name="reftypmod"];
+ uint32 refcollid = 6 [json_name="refcollid"];
+ repeated Node refupperindexpr = 7 [json_name="refupperindexpr"];
+ repeated Node reflowerindexpr = 8 [json_name="reflowerindexpr"];
+ Node refexpr = 9 [json_name="refexpr"];
+ Node refassgnexpr = 10 [json_name="refassgnexpr"];
+}
+
+message FuncExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 funcid = 2 [json_name="funcid"];
+ uint32 funcresulttype = 3 [json_name="funcresulttype"];
+ bool funcretset = 4 [json_name="funcretset"];
+ bool funcvariadic = 5 [json_name="funcvariadic"];
+ CoercionForm funcformat = 6 [json_name="funcformat"];
+ uint32 funccollid = 7 [json_name="funccollid"];
+ uint32 inputcollid = 8 [json_name="inputcollid"];
+ repeated Node args = 9 [json_name="args"];
+ int32 location = 10 [json_name="location"];
+}
+
+message NamedArgExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ string name = 3 [json_name="name"];
+ int32 argnumber = 4 [json_name="argnumber"];
+ int32 location = 5 [json_name="location"];
+}
+
+message OpExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 opno = 2 [json_name="opno"];
+ uint32 opresulttype = 3 [json_name="opresulttype"];
+ bool opretset = 4 [json_name="opretset"];
+ uint32 opcollid = 5 [json_name="opcollid"];
+ uint32 inputcollid = 6 [json_name="inputcollid"];
+ repeated Node args = 7 [json_name="args"];
+ int32 location = 8 [json_name="location"];
+}
+
+message DistinctExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 opno = 2 [json_name="opno"];
+ uint32 opresulttype = 3 [json_name="opresulttype"];
+ bool opretset = 4 [json_name="opretset"];
+ uint32 opcollid = 5 [json_name="opcollid"];
+ uint32 inputcollid = 6 [json_name="inputcollid"];
+ repeated Node args = 7 [json_name="args"];
+ int32 location = 8 [json_name="location"];
+}
+
+message NullIfExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 opno = 2 [json_name="opno"];
+ uint32 opresulttype = 3 [json_name="opresulttype"];
+ bool opretset = 4 [json_name="opretset"];
+ uint32 opcollid = 5 [json_name="opcollid"];
+ uint32 inputcollid = 6 [json_name="inputcollid"];
+ repeated Node args = 7 [json_name="args"];
+ int32 location = 8 [json_name="location"];
+}
+
+message ScalarArrayOpExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 opno = 2 [json_name="opno"];
+ bool use_or = 3 [json_name="useOr"];
+ uint32 inputcollid = 4 [json_name="inputcollid"];
+ repeated Node args = 5 [json_name="args"];
+ int32 location = 6 [json_name="location"];
+}
+
+message BoolExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ BoolExprType boolop = 2 [json_name="boolop"];
+ repeated Node args = 3 [json_name="args"];
+ int32 location = 4 [json_name="location"];
+}
+
+message SubLink
+{
+ Node xpr = 1 [json_name="xpr"];
+ SubLinkType sub_link_type = 2 [json_name="subLinkType"];
+ int32 sub_link_id = 3 [json_name="subLinkId"];
+ Node testexpr = 4 [json_name="testexpr"];
+ repeated Node oper_name = 5 [json_name="operName"];
+ Node subselect = 6 [json_name="subselect"];
+ int32 location = 7 [json_name="location"];
+}
+
+message SubPlan
+{
+ Node xpr = 1 [json_name="xpr"];
+ SubLinkType sub_link_type = 2 [json_name="subLinkType"];
+ Node testexpr = 3 [json_name="testexpr"];
+ repeated Node param_ids = 4 [json_name="paramIds"];
+ int32 plan_id = 5 [json_name="plan_id"];
+ string plan_name = 6 [json_name="plan_name"];
+ uint32 first_col_type = 7 [json_name="firstColType"];
+ int32 first_col_typmod = 8 [json_name="firstColTypmod"];
+ uint32 first_col_collation = 9 [json_name="firstColCollation"];
+ bool use_hash_table = 10 [json_name="useHashTable"];
+ bool unknown_eq_false = 11 [json_name="unknownEqFalse"];
+ bool parallel_safe = 12 [json_name="parallel_safe"];
+ repeated Node set_param = 13 [json_name="setParam"];
+ repeated Node par_param = 14 [json_name="parParam"];
+ repeated Node args = 15 [json_name="args"];
+ double startup_cost = 16 [json_name="startup_cost"];
+ double per_call_cost = 17 [json_name="per_call_cost"];
+}
+
+message AlternativeSubPlan
+{
+ Node xpr = 1 [json_name="xpr"];
+ repeated Node subplans = 2 [json_name="subplans"];
+}
+
+message FieldSelect
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ int32 fieldnum = 3 [json_name="fieldnum"];
+ uint32 resulttype = 4 [json_name="resulttype"];
+ int32 resulttypmod = 5 [json_name="resulttypmod"];
+ uint32 resultcollid = 6 [json_name="resultcollid"];
+}
+
+message FieldStore
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ repeated Node newvals = 3 [json_name="newvals"];
+ repeated Node fieldnums = 4 [json_name="fieldnums"];
+ uint32 resulttype = 5 [json_name="resulttype"];
+}
+
+message RelabelType
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ uint32 resulttype = 3 [json_name="resulttype"];
+ int32 resulttypmod = 4 [json_name="resulttypmod"];
+ uint32 resultcollid = 5 [json_name="resultcollid"];
+ CoercionForm relabelformat = 6 [json_name="relabelformat"];
+ int32 location = 7 [json_name="location"];
+}
+
+message CoerceViaIO
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ uint32 resulttype = 3 [json_name="resulttype"];
+ uint32 resultcollid = 4 [json_name="resultcollid"];
+ CoercionForm coerceformat = 5 [json_name="coerceformat"];
+ int32 location = 6 [json_name="location"];
+}
+
+message ArrayCoerceExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ Node elemexpr = 3 [json_name="elemexpr"];
+ uint32 resulttype = 4 [json_name="resulttype"];
+ int32 resulttypmod = 5 [json_name="resulttypmod"];
+ uint32 resultcollid = 6 [json_name="resultcollid"];
+ CoercionForm coerceformat = 7 [json_name="coerceformat"];
+ int32 location = 8 [json_name="location"];
+}
+
+message ConvertRowtypeExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ uint32 resulttype = 3 [json_name="resulttype"];
+ CoercionForm convertformat = 4 [json_name="convertformat"];
+ int32 location = 5 [json_name="location"];
+}
+
+message CollateExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ uint32 coll_oid = 3 [json_name="collOid"];
+ int32 location = 4 [json_name="location"];
+}
+
+message CaseExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 casetype = 2 [json_name="casetype"];
+ uint32 casecollid = 3 [json_name="casecollid"];
+ Node arg = 4 [json_name="arg"];
+ repeated Node args = 5 [json_name="args"];
+ Node defresult = 6 [json_name="defresult"];
+ int32 location = 7 [json_name="location"];
+}
+
+message CaseWhen
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node expr = 2 [json_name="expr"];
+ Node result = 3 [json_name="result"];
+ int32 location = 4 [json_name="location"];
+}
+
+message CaseTestExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 type_id = 2 [json_name="typeId"];
+ int32 type_mod = 3 [json_name="typeMod"];
+ uint32 collation = 4 [json_name="collation"];
+}
+
+message ArrayExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 array_typeid = 2 [json_name="array_typeid"];
+ uint32 array_collid = 3 [json_name="array_collid"];
+ uint32 element_typeid = 4 [json_name="element_typeid"];
+ repeated Node elements = 5 [json_name="elements"];
+ bool multidims = 6 [json_name="multidims"];
+ int32 location = 7 [json_name="location"];
+}
+
+message RowExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ repeated Node args = 2 [json_name="args"];
+ uint32 row_typeid = 3 [json_name="row_typeid"];
+ CoercionForm row_format = 4 [json_name="row_format"];
+ repeated Node colnames = 5 [json_name="colnames"];
+ int32 location = 6 [json_name="location"];
+}
+
+message RowCompareExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ RowCompareType rctype = 2 [json_name="rctype"];
+ repeated Node opnos = 3 [json_name="opnos"];
+ repeated Node opfamilies = 4 [json_name="opfamilies"];
+ repeated Node inputcollids = 5 [json_name="inputcollids"];
+ repeated Node largs = 6 [json_name="largs"];
+ repeated Node rargs = 7 [json_name="rargs"];
+}
+
+message CoalesceExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 coalescetype = 2 [json_name="coalescetype"];
+ uint32 coalescecollid = 3 [json_name="coalescecollid"];
+ repeated Node args = 4 [json_name="args"];
+ int32 location = 5 [json_name="location"];
+}
+
+message MinMaxExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 minmaxtype = 2 [json_name="minmaxtype"];
+ uint32 minmaxcollid = 3 [json_name="minmaxcollid"];
+ uint32 inputcollid = 4 [json_name="inputcollid"];
+ MinMaxOp op = 5 [json_name="op"];
+ repeated Node args = 6 [json_name="args"];
+ int32 location = 7 [json_name="location"];
+}
+
+message SQLValueFunction
+{
+ Node xpr = 1 [json_name="xpr"];
+ SQLValueFunctionOp op = 2 [json_name="op"];
+ uint32 type = 3 [json_name="type"];
+ int32 typmod = 4 [json_name="typmod"];
+ int32 location = 5 [json_name="location"];
+}
+
+message XmlExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ XmlExprOp op = 2 [json_name="op"];
+ string name = 3 [json_name="name"];
+ repeated Node named_args = 4 [json_name="named_args"];
+ repeated Node arg_names = 5 [json_name="arg_names"];
+ repeated Node args = 6 [json_name="args"];
+ XmlOptionType xmloption = 7 [json_name="xmloption"];
+ bool indent = 8 [json_name="indent"];
+ uint32 type = 9 [json_name="type"];
+ int32 typmod = 10 [json_name="typmod"];
+ int32 location = 11 [json_name="location"];
+}
+
+message JsonFormat
+{
+ JsonFormatType format_type = 1 [json_name="format_type"];
+ JsonEncoding encoding = 2 [json_name="encoding"];
+ int32 location = 3 [json_name="location"];
+}
+
+message JsonReturning
+{
+ JsonFormat format = 1 [json_name="format"];
+ uint32 typid = 2 [json_name="typid"];
+ int32 typmod = 3 [json_name="typmod"];
+}
+
+message JsonValueExpr
+{
+ Node raw_expr = 1 [json_name="raw_expr"];
+ Node formatted_expr = 2 [json_name="formatted_expr"];
+ JsonFormat format = 3 [json_name="format"];
+}
+
+message JsonConstructorExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ JsonConstructorType type = 2 [json_name="type"];
+ repeated Node args = 3 [json_name="args"];
+ Node func = 4 [json_name="func"];
+ Node coercion = 5 [json_name="coercion"];
+ JsonReturning returning = 6 [json_name="returning"];
+ bool absent_on_null = 7 [json_name="absent_on_null"];
+ bool unique = 8 [json_name="unique"];
+ int32 location = 9 [json_name="location"];
+}
+
+message JsonIsPredicate
+{
+ Node expr = 1 [json_name="expr"];
+ JsonFormat format = 2 [json_name="format"];
+ JsonValueType item_type = 3 [json_name="item_type"];
+ bool unique_keys = 4 [json_name="unique_keys"];
+ int32 location = 5 [json_name="location"];
+}
+
+message JsonBehavior
+{
+ JsonBehaviorType btype = 1 [json_name="btype"];
+ Node expr = 2 [json_name="expr"];
+ bool coerce = 3 [json_name="coerce"];
+ int32 location = 4 [json_name="location"];
+}
+
+message JsonExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ JsonExprOp op = 2 [json_name="op"];
+ string column_name = 3 [json_name="column_name"];
+ Node formatted_expr = 4 [json_name="formatted_expr"];
+ JsonFormat format = 5 [json_name="format"];
+ Node path_spec = 6 [json_name="path_spec"];
+ JsonReturning returning = 7 [json_name="returning"];
+ repeated Node passing_names = 8 [json_name="passing_names"];
+ repeated Node passing_values = 9 [json_name="passing_values"];
+ JsonBehavior on_empty = 10 [json_name="on_empty"];
+ JsonBehavior on_error = 11 [json_name="on_error"];
+ bool use_io_coercion = 12 [json_name="use_io_coercion"];
+ bool use_json_coercion = 13 [json_name="use_json_coercion"];
+ JsonWrapper wrapper = 14 [json_name="wrapper"];
+ bool omit_quotes = 15 [json_name="omit_quotes"];
+ uint32 collation = 16 [json_name="collation"];
+ int32 location = 17 [json_name="location"];
+}
+
+message JsonTablePath
+{
+ string name = 1 [json_name="name"];
+}
+
+message JsonTablePathScan
+{
+ Node plan = 1 [json_name="plan"];
+ JsonTablePath path = 2 [json_name="path"];
+ bool error_on_error = 3 [json_name="errorOnError"];
+ Node child = 4 [json_name="child"];
+ int32 col_min = 5 [json_name="colMin"];
+ int32 col_max = 6 [json_name="colMax"];
+}
+
+message JsonTableSiblingJoin
+{
+ Node plan = 1 [json_name="plan"];
+ Node lplan = 2 [json_name="lplan"];
+ Node rplan = 3 [json_name="rplan"];
+}
+
+message NullTest
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ NullTestType nulltesttype = 3 [json_name="nulltesttype"];
+ bool argisrow = 4 [json_name="argisrow"];
+ int32 location = 5 [json_name="location"];
+}
+
+message BooleanTest
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ BoolTestType booltesttype = 3 [json_name="booltesttype"];
+ int32 location = 4 [json_name="location"];
+}
+
+message MergeAction
+{
+ MergeMatchKind match_kind = 1 [json_name="matchKind"];
+ CmdType command_type = 2 [json_name="commandType"];
+ OverridingKind override = 3 [json_name="override"];
+ Node qual = 4 [json_name="qual"];
+ repeated Node target_list = 5 [json_name="targetList"];
+ repeated Node update_colnos = 6 [json_name="updateColnos"];
+}
+
+message CoerceToDomain
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node arg = 2 [json_name="arg"];
+ uint32 resulttype = 3 [json_name="resulttype"];
+ int32 resulttypmod = 4 [json_name="resulttypmod"];
+ uint32 resultcollid = 5 [json_name="resultcollid"];
+ CoercionForm coercionformat = 6 [json_name="coercionformat"];
+ int32 location = 7 [json_name="location"];
+}
+
+message CoerceToDomainValue
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 type_id = 2 [json_name="typeId"];
+ int32 type_mod = 3 [json_name="typeMod"];
+ uint32 collation = 4 [json_name="collation"];
+ int32 location = 5 [json_name="location"];
+}
+
+message SetToDefault
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 type_id = 2 [json_name="typeId"];
+ int32 type_mod = 3 [json_name="typeMod"];
+ uint32 collation = 4 [json_name="collation"];
+ int32 location = 5 [json_name="location"];
+}
+
+message CurrentOfExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 cvarno = 2 [json_name="cvarno"];
+ string cursor_name = 3 [json_name="cursor_name"];
+ int32 cursor_param = 4 [json_name="cursor_param"];
+}
+
+message NextValueExpr
+{
+ Node xpr = 1 [json_name="xpr"];
+ uint32 seqid = 2 [json_name="seqid"];
+ uint32 type_id = 3 [json_name="typeId"];
+}
+
+message InferenceElem
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node expr = 2 [json_name="expr"];
+ uint32 infercollid = 3 [json_name="infercollid"];
+ uint32 inferopclass = 4 [json_name="inferopclass"];
+}
+
+message TargetEntry
+{
+ Node xpr = 1 [json_name="xpr"];
+ Node expr = 2 [json_name="expr"];
+ int32 resno = 3 [json_name="resno"];
+ string resname = 4 [json_name="resname"];
+ uint32 ressortgroupref = 5 [json_name="ressortgroupref"];
+ uint32 resorigtbl = 6 [json_name="resorigtbl"];
+ int32 resorigcol = 7 [json_name="resorigcol"];
+ bool resjunk = 8 [json_name="resjunk"];
+}
+
+message RangeTblRef
+{
+ int32 rtindex = 1 [json_name="rtindex"];
+}
+
+message JoinExpr
+{
+ JoinType jointype = 1 [json_name="jointype"];
+ bool is_natural = 2 [json_name="isNatural"];
+ Node larg = 3 [json_name="larg"];
+ Node rarg = 4 [json_name="rarg"];
+ repeated Node using_clause = 5 [json_name="usingClause"];
+ Alias join_using_alias = 6 [json_name="join_using_alias"];
+ Node quals = 7 [json_name="quals"];
+ Alias alias = 8 [json_name="alias"];
+ int32 rtindex = 9 [json_name="rtindex"];
+}
+
+message FromExpr
+{
+ repeated Node fromlist = 1 [json_name="fromlist"];
+ Node quals = 2 [json_name="quals"];
+}
+
+message OnConflictExpr
+{
+ OnConflictAction action = 1 [json_name="action"];
+ repeated Node arbiter_elems = 2 [json_name="arbiterElems"];
+ Node arbiter_where = 3 [json_name="arbiterWhere"];
+ uint32 constraint = 4 [json_name="constraint"];
+ repeated Node on_conflict_set = 5 [json_name="onConflictSet"];
+ Node on_conflict_where = 6 [json_name="onConflictWhere"];
+ int32 excl_rel_index = 7 [json_name="exclRelIndex"];
+ repeated Node excl_rel_tlist = 8 [json_name="exclRelTlist"];
+}
+
+message Query
+{
+ CmdType command_type = 1 [json_name="commandType"];
+ QuerySource query_source = 2 [json_name="querySource"];
+ bool can_set_tag = 3 [json_name="canSetTag"];
+ Node utility_stmt = 4 [json_name="utilityStmt"];
+ int32 result_relation = 5 [json_name="resultRelation"];
+ bool has_aggs = 6 [json_name="hasAggs"];
+ bool has_window_funcs = 7 [json_name="hasWindowFuncs"];
+ bool has_target_srfs = 8 [json_name="hasTargetSRFs"];
+ bool has_sub_links = 9 [json_name="hasSubLinks"];
+ bool has_distinct_on = 10 [json_name="hasDistinctOn"];
+ bool has_recursive = 11 [json_name="hasRecursive"];
+ bool has_modifying_cte = 12 [json_name="hasModifyingCTE"];
+ bool has_for_update = 13 [json_name="hasForUpdate"];
+ bool has_row_security = 14 [json_name="hasRowSecurity"];
+ bool is_return = 15 [json_name="isReturn"];
+ repeated Node cte_list = 16 [json_name="cteList"];
+ repeated Node rtable = 17 [json_name="rtable"];
+ repeated Node rteperminfos = 18 [json_name="rteperminfos"];
+ FromExpr jointree = 19 [json_name="jointree"];
+ repeated Node merge_action_list = 20 [json_name="mergeActionList"];
+ int32 merge_target_relation = 21 [json_name="mergeTargetRelation"];
+ Node merge_join_condition = 22 [json_name="mergeJoinCondition"];
+ repeated Node target_list = 23 [json_name="targetList"];
+ OverridingKind override = 24 [json_name="override"];
+ OnConflictExpr on_conflict = 25 [json_name="onConflict"];
+ repeated Node returning_list = 26 [json_name="returningList"];
+ repeated Node group_clause = 27 [json_name="groupClause"];
+ bool group_distinct = 28 [json_name="groupDistinct"];
+ repeated Node grouping_sets = 29 [json_name="groupingSets"];
+ Node having_qual = 30 [json_name="havingQual"];
+ repeated Node window_clause = 31 [json_name="windowClause"];
+ repeated Node distinct_clause = 32 [json_name="distinctClause"];
+ repeated Node sort_clause = 33 [json_name="sortClause"];
+ Node limit_offset = 34 [json_name="limitOffset"];
+ Node limit_count = 35 [json_name="limitCount"];
+ LimitOption limit_option = 36 [json_name="limitOption"];
+ repeated Node row_marks = 37 [json_name="rowMarks"];
+ Node set_operations = 38 [json_name="setOperations"];
+ repeated Node constraint_deps = 39 [json_name="constraintDeps"];
+ repeated Node with_check_options = 40 [json_name="withCheckOptions"];
+ int32 stmt_location = 41 [json_name="stmt_location"];
+ int32 stmt_len = 42 [json_name="stmt_len"];
+}
+
+message TypeName
+{
+ repeated Node names = 1 [json_name="names"];
+ uint32 type_oid = 2 [json_name="typeOid"];
+ bool setof = 3 [json_name="setof"];
+ bool pct_type = 4 [json_name="pct_type"];
+ repeated Node typmods = 5 [json_name="typmods"];
+ int32 typemod = 6 [json_name="typemod"];
+ repeated Node array_bounds = 7 [json_name="arrayBounds"];
+ int32 location = 8 [json_name="location"];
+}
+
+message ColumnRef
+{
+ repeated Node fields = 1 [json_name="fields"];
+ int32 location = 2 [json_name="location"];
+}
+
+message ParamRef
+{
+ int32 number = 1 [json_name="number"];
+ int32 location = 2 [json_name="location"];
+}
+
+message A_Expr
+{
+ A_Expr_Kind kind = 1 [json_name="kind"];
+ repeated Node name = 2 [json_name="name"];
+ Node lexpr = 3 [json_name="lexpr"];
+ Node rexpr = 4 [json_name="rexpr"];
+ int32 location = 5 [json_name="location"];
+}
+
+message TypeCast
+{
+ Node arg = 1 [json_name="arg"];
+ TypeName type_name = 2 [json_name="typeName"];
+ int32 location = 3 [json_name="location"];
+}
+
+message CollateClause
+{
+ Node arg = 1 [json_name="arg"];
+ repeated Node collname = 2 [json_name="collname"];
+ int32 location = 3 [json_name="location"];
+}
+
+message RoleSpec
+{
+ RoleSpecType roletype = 1 [json_name="roletype"];
+ string rolename = 2 [json_name="rolename"];
+ int32 location = 3 [json_name="location"];
+}
+
+message FuncCall
+{
+ repeated Node funcname = 1 [json_name="funcname"];
+ repeated Node args = 2 [json_name="args"];
+ repeated Node agg_order = 3 [json_name="agg_order"];
+ Node agg_filter = 4 [json_name="agg_filter"];
+ WindowDef over = 5 [json_name="over"];
+ bool agg_within_group = 6 [json_name="agg_within_group"];
+ bool agg_star = 7 [json_name="agg_star"];
+ bool agg_distinct = 8 [json_name="agg_distinct"];
+ bool func_variadic = 9 [json_name="func_variadic"];
+ CoercionForm funcformat = 10 [json_name="funcformat"];
+ int32 location = 11 [json_name="location"];
+}
+
+message A_Star
+{
+}
+
+message A_Indices
+{
+ bool is_slice = 1 [json_name="is_slice"];
+ Node lidx = 2 [json_name="lidx"];
+ Node uidx = 3 [json_name="uidx"];
+}
+
+message A_Indirection
+{
+ Node arg = 1 [json_name="arg"];
+ repeated Node indirection = 2 [json_name="indirection"];
+}
+
+message A_ArrayExpr
+{
+ repeated Node elements = 1 [json_name="elements"];
+ int32 location = 2 [json_name="location"];
+}
+
+message ResTarget
+{
+ string name = 1 [json_name="name"];
+ repeated Node indirection = 2 [json_name="indirection"];
+ Node val = 3 [json_name="val"];
+ int32 location = 4 [json_name="location"];
+}
+
+message MultiAssignRef
+{
+ Node source = 1 [json_name="source"];
+ int32 colno = 2 [json_name="colno"];
+ int32 ncolumns = 3 [json_name="ncolumns"];
+}
+
+message SortBy
+{
+ Node node = 1 [json_name="node"];
+ SortByDir sortby_dir = 2 [json_name="sortby_dir"];
+ SortByNulls sortby_nulls = 3 [json_name="sortby_nulls"];
+ repeated Node use_op = 4 [json_name="useOp"];
+ int32 location = 5 [json_name="location"];
+}
+
+message WindowDef
+{
+ string name = 1 [json_name="name"];
+ string refname = 2 [json_name="refname"];
+ repeated Node partition_clause = 3 [json_name="partitionClause"];
+ repeated Node order_clause = 4 [json_name="orderClause"];
+ int32 frame_options = 5 [json_name="frameOptions"];
+ Node start_offset = 6 [json_name="startOffset"];
+ Node end_offset = 7 [json_name="endOffset"];
+ int32 location = 8 [json_name="location"];
+}
+
+message RangeSubselect
+{
+ bool lateral = 1 [json_name="lateral"];
+ Node subquery = 2 [json_name="subquery"];
+ Alias alias = 3 [json_name="alias"];
+}
+
+message RangeFunction
+{
+ bool lateral = 1 [json_name="lateral"];
+ bool ordinality = 2 [json_name="ordinality"];
+ bool is_rowsfrom = 3 [json_name="is_rowsfrom"];
+ repeated Node functions = 4 [json_name="functions"];
+ Alias alias = 5 [json_name="alias"];
+ repeated Node coldeflist = 6 [json_name="coldeflist"];
+}
+
+message RangeTableFunc
+{
+ bool lateral = 1 [json_name="lateral"];
+ Node docexpr = 2 [json_name="docexpr"];
+ Node rowexpr = 3 [json_name="rowexpr"];
+ repeated Node namespaces = 4 [json_name="namespaces"];
+ repeated Node columns = 5 [json_name="columns"];
+ Alias alias = 6 [json_name="alias"];
+ int32 location = 7 [json_name="location"];
+}
+
+message RangeTableFuncCol
+{
+ string colname = 1 [json_name="colname"];
+ TypeName type_name = 2 [json_name="typeName"];
+ bool for_ordinality = 3 [json_name="for_ordinality"];
+ bool is_not_null = 4 [json_name="is_not_null"];
+ Node colexpr = 5 [json_name="colexpr"];
+ Node coldefexpr = 6 [json_name="coldefexpr"];
+ int32 location = 7 [json_name="location"];
+}
+
+message RangeTableSample
+{
+ Node relation = 1 [json_name="relation"];
+ repeated Node method = 2 [json_name="method"];
+ repeated Node args = 3 [json_name="args"];
+ Node repeatable = 4 [json_name="repeatable"];
+ int32 location = 5 [json_name="location"];
+}
+
+message ColumnDef
+{
+ string colname = 1 [json_name="colname"];
+ TypeName type_name = 2 [json_name="typeName"];
+ string compression = 3 [json_name="compression"];
+ int32 inhcount = 4 [json_name="inhcount"];
+ bool is_local = 5 [json_name="is_local"];
+ bool is_not_null = 6 [json_name="is_not_null"];
+ bool is_from_type = 7 [json_name="is_from_type"];
+ string storage = 8 [json_name="storage"];
+ string storage_name = 9 [json_name="storage_name"];
+ Node raw_default = 10 [json_name="raw_default"];
+ Node cooked_default = 11 [json_name="cooked_default"];
+ string identity = 12 [json_name="identity"];
+ RangeVar identity_sequence = 13 [json_name="identitySequence"];
+ string generated = 14 [json_name="generated"];
+ CollateClause coll_clause = 15 [json_name="collClause"];
+ uint32 coll_oid = 16 [json_name="collOid"];
+ repeated Node constraints = 17 [json_name="constraints"];
+ repeated Node fdwoptions = 18 [json_name="fdwoptions"];
+ int32 location = 19 [json_name="location"];
+}
+
+message TableLikeClause
+{
+ RangeVar relation = 1 [json_name="relation"];
+ uint32 options = 2 [json_name="options"];
+ uint32 relation_oid = 3 [json_name="relationOid"];
+}
+
+message IndexElem
+{
+ string name = 1 [json_name="name"];
+ Node expr = 2 [json_name="expr"];
+ string indexcolname = 3 [json_name="indexcolname"];
+ repeated Node collation = 4 [json_name="collation"];
+ repeated Node opclass = 5 [json_name="opclass"];
+ repeated Node opclassopts = 6 [json_name="opclassopts"];
+ SortByDir ordering = 7 [json_name="ordering"];
+ SortByNulls nulls_ordering = 8 [json_name="nulls_ordering"];
+}
+
+message DefElem
+{
+ string defnamespace = 1 [json_name="defnamespace"];
+ string defname = 2 [json_name="defname"];
+ Node arg = 3 [json_name="arg"];
+ DefElemAction defaction = 4 [json_name="defaction"];
+ int32 location = 5 [json_name="location"];
+}
+
+message LockingClause
+{
+ repeated Node locked_rels = 1 [json_name="lockedRels"];
+ LockClauseStrength strength = 2 [json_name="strength"];
+ LockWaitPolicy wait_policy = 3 [json_name="waitPolicy"];
+}
+
+message XmlSerialize
+{
+ XmlOptionType xmloption = 1 [json_name="xmloption"];
+ Node expr = 2 [json_name="expr"];
+ TypeName type_name = 3 [json_name="typeName"];
+ bool indent = 4 [json_name="indent"];
+ int32 location = 5 [json_name="location"];
+}
+
+message PartitionElem
+{
+ string name = 1 [json_name="name"];
+ Node expr = 2 [json_name="expr"];
+ repeated Node collation = 3 [json_name="collation"];
+ repeated Node opclass = 4 [json_name="opclass"];
+ int32 location = 5 [json_name="location"];
+}
+
+message PartitionSpec
+{
+ PartitionStrategy strategy = 1 [json_name="strategy"];
+ repeated Node part_params = 2 [json_name="partParams"];
+ int32 location = 3 [json_name="location"];
+}
+
+message PartitionBoundSpec
+{
+ string strategy = 1 [json_name="strategy"];
+ bool is_default = 2 [json_name="is_default"];
+ int32 modulus = 3 [json_name="modulus"];
+ int32 remainder = 4 [json_name="remainder"];
+ repeated Node listdatums = 5 [json_name="listdatums"];
+ repeated Node lowerdatums = 6 [json_name="lowerdatums"];
+ repeated Node upperdatums = 7 [json_name="upperdatums"];
+ int32 location = 8 [json_name="location"];
+}
+
+message PartitionRangeDatum
+{
+ PartitionRangeDatumKind kind = 1 [json_name="kind"];
+ Node value = 2 [json_name="value"];
+ int32 location = 3 [json_name="location"];
+}
+
+message SinglePartitionSpec
+{
+}
+
+message PartitionCmd
+{
+ RangeVar name = 1 [json_name="name"];
+ PartitionBoundSpec bound = 2 [json_name="bound"];
+ bool concurrent = 3 [json_name="concurrent"];
+}
+
+message RangeTblEntry
+{
+ Alias alias = 1 [json_name="alias"];
+ Alias eref = 2 [json_name="eref"];
+ RTEKind rtekind = 3 [json_name="rtekind"];
+ uint32 relid = 4 [json_name="relid"];
+ bool inh = 5 [json_name="inh"];
+ string relkind = 6 [json_name="relkind"];
+ int32 rellockmode = 7 [json_name="rellockmode"];
+ uint32 perminfoindex = 8 [json_name="perminfoindex"];
+ TableSampleClause tablesample = 9 [json_name="tablesample"];
+ Query subquery = 10 [json_name="subquery"];
+ bool security_barrier = 11 [json_name="security_barrier"];
+ JoinType jointype = 12 [json_name="jointype"];
+ int32 joinmergedcols = 13 [json_name="joinmergedcols"];
+ repeated Node joinaliasvars = 14 [json_name="joinaliasvars"];
+ repeated Node joinleftcols = 15 [json_name="joinleftcols"];
+ repeated Node joinrightcols = 16 [json_name="joinrightcols"];
+ Alias join_using_alias = 17 [json_name="join_using_alias"];
+ repeated Node functions = 18 [json_name="functions"];
+ bool funcordinality = 19 [json_name="funcordinality"];
+ TableFunc tablefunc = 20 [json_name="tablefunc"];
+ repeated Node values_lists = 21 [json_name="values_lists"];
+ string ctename = 22 [json_name="ctename"];
+ uint32 ctelevelsup = 23 [json_name="ctelevelsup"];
+ bool self_reference = 24 [json_name="self_reference"];
+ repeated Node coltypes = 25 [json_name="coltypes"];
+ repeated Node coltypmods = 26 [json_name="coltypmods"];
+ repeated Node colcollations = 27 [json_name="colcollations"];
+ string enrname = 28 [json_name="enrname"];
+ double enrtuples = 29 [json_name="enrtuples"];
+ bool lateral = 30 [json_name="lateral"];
+ bool in_from_cl = 31 [json_name="inFromCl"];
+ repeated Node security_quals = 32 [json_name="securityQuals"];
+}
+
+message RTEPermissionInfo
+{
+ uint32 relid = 1 [json_name="relid"];
+ bool inh = 2 [json_name="inh"];
+ uint64 required_perms = 3 [json_name="requiredPerms"];
+ uint32 check_as_user = 4 [json_name="checkAsUser"];
+ repeated uint64 selected_cols = 5 [json_name="selectedCols"];
+ repeated uint64 inserted_cols = 6 [json_name="insertedCols"];
+ repeated uint64 updated_cols = 7 [json_name="updatedCols"];
+}
+
+message RangeTblFunction
+{
+ Node funcexpr = 1 [json_name="funcexpr"];
+ int32 funccolcount = 2 [json_name="funccolcount"];
+ repeated Node funccolnames = 3 [json_name="funccolnames"];
+ repeated Node funccoltypes = 4 [json_name="funccoltypes"];
+ repeated Node funccoltypmods = 5 [json_name="funccoltypmods"];
+ repeated Node funccolcollations = 6 [json_name="funccolcollations"];
+ repeated uint64 funcparams = 7 [json_name="funcparams"];
+}
+
+message TableSampleClause
+{
+ uint32 tsmhandler = 1 [json_name="tsmhandler"];
+ repeated Node args = 2 [json_name="args"];
+ Node repeatable = 3 [json_name="repeatable"];
+}
+
+message WithCheckOption
+{
+ WCOKind kind = 1 [json_name="kind"];
+ string relname = 2 [json_name="relname"];
+ string polname = 3 [json_name="polname"];
+ Node qual = 4 [json_name="qual"];
+ bool cascaded = 5 [json_name="cascaded"];
+}
+
+message SortGroupClause
+{
+ uint32 tle_sort_group_ref = 1 [json_name="tleSortGroupRef"];
+ uint32 eqop = 2 [json_name="eqop"];
+ uint32 sortop = 3 [json_name="sortop"];
+ bool nulls_first = 4 [json_name="nulls_first"];
+ bool hashable = 5 [json_name="hashable"];
+}
+
+message GroupingSet
+{
+ GroupingSetKind kind = 1 [json_name="kind"];
+ repeated Node content = 2 [json_name="content"];
+ int32 location = 3 [json_name="location"];
+}
+
+message WindowClause
+{
+ string name = 1 [json_name="name"];
+ string refname = 2 [json_name="refname"];
+ repeated Node partition_clause = 3 [json_name="partitionClause"];
+ repeated Node order_clause = 4 [json_name="orderClause"];
+ int32 frame_options = 5 [json_name="frameOptions"];
+ Node start_offset = 6 [json_name="startOffset"];
+ Node end_offset = 7 [json_name="endOffset"];
+ uint32 start_in_range_func = 8 [json_name="startInRangeFunc"];
+ uint32 end_in_range_func = 9 [json_name="endInRangeFunc"];
+ uint32 in_range_coll = 10 [json_name="inRangeColl"];
+ bool in_range_asc = 11 [json_name="inRangeAsc"];
+ bool in_range_nulls_first = 12 [json_name="inRangeNullsFirst"];
+ uint32 winref = 13 [json_name="winref"];
+ bool copied_order = 14 [json_name="copiedOrder"];
+}
+
+message RowMarkClause
+{
+ uint32 rti = 1 [json_name="rti"];
+ LockClauseStrength strength = 2 [json_name="strength"];
+ LockWaitPolicy wait_policy = 3 [json_name="waitPolicy"];
+ bool pushed_down = 4 [json_name="pushedDown"];
+}
+
+message WithClause
+{
+ repeated Node ctes = 1 [json_name="ctes"];
+ bool recursive = 2 [json_name="recursive"];
+ int32 location = 3 [json_name="location"];
+}
+
+message InferClause
+{
+ repeated Node index_elems = 1 [json_name="indexElems"];
+ Node where_clause = 2 [json_name="whereClause"];
+ string conname = 3 [json_name="conname"];
+ int32 location = 4 [json_name="location"];
+}
+
+message OnConflictClause
+{
+ OnConflictAction action = 1 [json_name="action"];
+ InferClause infer = 2 [json_name="infer"];
+ repeated Node target_list = 3 [json_name="targetList"];
+ Node where_clause = 4 [json_name="whereClause"];
+ int32 location = 5 [json_name="location"];
+}
+
+message CTESearchClause
+{
+ repeated Node search_col_list = 1 [json_name="search_col_list"];
+ bool search_breadth_first = 2 [json_name="search_breadth_first"];
+ string search_seq_column = 3 [json_name="search_seq_column"];
+ int32 location = 4 [json_name="location"];
+}
+
+message CTECycleClause
+{
+ repeated Node cycle_col_list = 1 [json_name="cycle_col_list"];
+ string cycle_mark_column = 2 [json_name="cycle_mark_column"];
+ Node cycle_mark_value = 3 [json_name="cycle_mark_value"];
+ Node cycle_mark_default = 4 [json_name="cycle_mark_default"];
+ string cycle_path_column = 5 [json_name="cycle_path_column"];
+ int32 location = 6 [json_name="location"];
+ uint32 cycle_mark_type = 7 [json_name="cycle_mark_type"];
+ int32 cycle_mark_typmod = 8 [json_name="cycle_mark_typmod"];
+ uint32 cycle_mark_collation = 9 [json_name="cycle_mark_collation"];
+ uint32 cycle_mark_neop = 10 [json_name="cycle_mark_neop"];
+}
+
+message CommonTableExpr
+{
+ string ctename = 1 [json_name="ctename"];
+ repeated Node aliascolnames = 2 [json_name="aliascolnames"];
+ CTEMaterialize ctematerialized = 3 [json_name="ctematerialized"];
+ Node ctequery = 4 [json_name="ctequery"];
+ CTESearchClause search_clause = 5 [json_name="search_clause"];
+ CTECycleClause cycle_clause = 6 [json_name="cycle_clause"];
+ int32 location = 7 [json_name="location"];
+ bool cterecursive = 8 [json_name="cterecursive"];
+ int32 cterefcount = 9 [json_name="cterefcount"];
+ repeated Node ctecolnames = 10 [json_name="ctecolnames"];
+ repeated Node ctecoltypes = 11 [json_name="ctecoltypes"];
+ repeated Node ctecoltypmods = 12 [json_name="ctecoltypmods"];
+ repeated Node ctecolcollations = 13 [json_name="ctecolcollations"];
+}
+
+message MergeWhenClause
+{
+ MergeMatchKind match_kind = 1 [json_name="matchKind"];
+ CmdType command_type = 2 [json_name="commandType"];
+ OverridingKind override = 3 [json_name="override"];
+ Node condition = 4 [json_name="condition"];
+ repeated Node target_list = 5 [json_name="targetList"];
+ repeated Node values = 6 [json_name="values"];
+}
+
+message TriggerTransition
+{
+ string name = 1 [json_name="name"];
+ bool is_new = 2 [json_name="isNew"];
+ bool is_table = 3 [json_name="isTable"];
+}
+
+message JsonOutput
+{
+ TypeName type_name = 1 [json_name="typeName"];
+ JsonReturning returning = 2 [json_name="returning"];
+}
+
+message JsonArgument
+{
+ JsonValueExpr val = 1 [json_name="val"];
+ string name = 2 [json_name="name"];
+}
+
+message JsonFuncExpr
+{
+ JsonExprOp op = 1 [json_name="op"];
+ string column_name = 2 [json_name="column_name"];
+ JsonValueExpr context_item = 3 [json_name="context_item"];
+ Node pathspec = 4 [json_name="pathspec"];
+ repeated Node passing = 5 [json_name="passing"];
+ JsonOutput output = 6 [json_name="output"];
+ JsonBehavior on_empty = 7 [json_name="on_empty"];
+ JsonBehavior on_error = 8 [json_name="on_error"];
+ JsonWrapper wrapper = 9 [json_name="wrapper"];
+ JsonQuotes quotes = 10 [json_name="quotes"];
+ int32 location = 11 [json_name="location"];
+}
+
+message JsonTablePathSpec
+{
+ Node string = 1 [json_name="string"];
+ string name = 2 [json_name="name"];
+ int32 name_location = 3 [json_name="name_location"];
+ int32 location = 4 [json_name="location"];
+}
+
+message JsonTable
+{
+ JsonValueExpr context_item = 1 [json_name="context_item"];
+ JsonTablePathSpec pathspec = 2 [json_name="pathspec"];
+ repeated Node passing = 3 [json_name="passing"];
+ repeated Node columns = 4 [json_name="columns"];
+ JsonBehavior on_error = 5 [json_name="on_error"];
+ Alias alias = 6 [json_name="alias"];
+ bool lateral = 7 [json_name="lateral"];
+ int32 location = 8 [json_name="location"];
+}
+
+message JsonTableColumn
+{
+ JsonTableColumnType coltype = 1 [json_name="coltype"];
+ string name = 2 [json_name="name"];
+ TypeName type_name = 3 [json_name="typeName"];
+ JsonTablePathSpec pathspec = 4 [json_name="pathspec"];
+ JsonFormat format = 5 [json_name="format"];
+ JsonWrapper wrapper = 6 [json_name="wrapper"];
+ JsonQuotes quotes = 7 [json_name="quotes"];
+ repeated Node columns = 8 [json_name="columns"];
+ JsonBehavior on_empty = 9 [json_name="on_empty"];
+ JsonBehavior on_error = 10 [json_name="on_error"];
+ int32 location = 11 [json_name="location"];
+}
+
+message JsonKeyValue
+{
+ Node key = 1 [json_name="key"];
+ JsonValueExpr value = 2 [json_name="value"];
+}
+
+message JsonParseExpr
+{
+ JsonValueExpr expr = 1 [json_name="expr"];
+ JsonOutput output = 2 [json_name="output"];
+ bool unique_keys = 3 [json_name="unique_keys"];
+ int32 location = 4 [json_name="location"];
+}
+
+message JsonScalarExpr
+{
+ Node expr = 1 [json_name="expr"];
+ JsonOutput output = 2 [json_name="output"];
+ int32 location = 3 [json_name="location"];
+}
+
+message JsonSerializeExpr
+{
+ JsonValueExpr expr = 1 [json_name="expr"];
+ JsonOutput output = 2 [json_name="output"];
+ int32 location = 3 [json_name="location"];
+}
+
+message JsonObjectConstructor
+{
+ repeated Node exprs = 1 [json_name="exprs"];
+ JsonOutput output = 2 [json_name="output"];
+ bool absent_on_null = 3 [json_name="absent_on_null"];
+ bool unique = 4 [json_name="unique"];
+ int32 location = 5 [json_name="location"];
+}
+
+message JsonArrayConstructor
+{
+ repeated Node exprs = 1 [json_name="exprs"];
+ JsonOutput output = 2 [json_name="output"];
+ bool absent_on_null = 3 [json_name="absent_on_null"];
+ int32 location = 4 [json_name="location"];
+}
+
+message JsonArrayQueryConstructor
+{
+ Node query = 1 [json_name="query"];
+ JsonOutput output = 2 [json_name="output"];
+ JsonFormat format = 3 [json_name="format"];
+ bool absent_on_null = 4 [json_name="absent_on_null"];
+ int32 location = 5 [json_name="location"];
+}
+
+message JsonAggConstructor
+{
+ JsonOutput output = 1 [json_name="output"];
+ Node agg_filter = 2 [json_name="agg_filter"];
+ repeated Node agg_order = 3 [json_name="agg_order"];
+ WindowDef over = 4 [json_name="over"];
+ int32 location = 5 [json_name="location"];
+}
+
+message JsonObjectAgg
+{
+ JsonAggConstructor constructor = 1 [json_name="constructor"];
+ JsonKeyValue arg = 2 [json_name="arg"];
+ bool absent_on_null = 3 [json_name="absent_on_null"];
+ bool unique = 4 [json_name="unique"];
+}
+
+message JsonArrayAgg
+{
+ JsonAggConstructor constructor = 1 [json_name="constructor"];
+ JsonValueExpr arg = 2 [json_name="arg"];
+ bool absent_on_null = 3 [json_name="absent_on_null"];
+}
+
+message RawStmt
+{
+ Node stmt = 1 [json_name="stmt"];
+ int32 stmt_location = 2 [json_name="stmt_location"];
+ int32 stmt_len = 3 [json_name="stmt_len"];
+}
+
+message InsertStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ repeated Node cols = 2 [json_name="cols"];
+ Node select_stmt = 3 [json_name="selectStmt"];
+ OnConflictClause on_conflict_clause = 4 [json_name="onConflictClause"];
+ repeated Node returning_list = 5 [json_name="returningList"];
+ WithClause with_clause = 6 [json_name="withClause"];
+ OverridingKind override = 7 [json_name="override"];
+}
+
+message DeleteStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ repeated Node using_clause = 2 [json_name="usingClause"];
+ Node where_clause = 3 [json_name="whereClause"];
+ repeated Node returning_list = 4 [json_name="returningList"];
+ WithClause with_clause = 5 [json_name="withClause"];
+}
+
+message UpdateStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ repeated Node target_list = 2 [json_name="targetList"];
+ Node where_clause = 3 [json_name="whereClause"];
+ repeated Node from_clause = 4 [json_name="fromClause"];
+ repeated Node returning_list = 5 [json_name="returningList"];
+ WithClause with_clause = 6 [json_name="withClause"];
+}
+
+message MergeStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ Node source_relation = 2 [json_name="sourceRelation"];
+ Node join_condition = 3 [json_name="joinCondition"];
+ repeated Node merge_when_clauses = 4 [json_name="mergeWhenClauses"];
+ repeated Node returning_list = 5 [json_name="returningList"];
+ WithClause with_clause = 6 [json_name="withClause"];
+}
+
+message SelectStmt
+{
+ repeated Node distinct_clause = 1 [json_name="distinctClause"];
+ IntoClause into_clause = 2 [json_name="intoClause"];
+ repeated Node target_list = 3 [json_name="targetList"];
+ repeated Node from_clause = 4 [json_name="fromClause"];
+ Node where_clause = 5 [json_name="whereClause"];
+ repeated Node group_clause = 6 [json_name="groupClause"];
+ bool group_distinct = 7 [json_name="groupDistinct"];
+ Node having_clause = 8 [json_name="havingClause"];
+ repeated Node window_clause = 9 [json_name="windowClause"];
+ repeated Node values_lists = 10 [json_name="valuesLists"];
+ repeated Node sort_clause = 11 [json_name="sortClause"];
+ Node limit_offset = 12 [json_name="limitOffset"];
+ Node limit_count = 13 [json_name="limitCount"];
+ LimitOption limit_option = 14 [json_name="limitOption"];
+ repeated Node locking_clause = 15 [json_name="lockingClause"];
+ WithClause with_clause = 16 [json_name="withClause"];
+ SetOperation op = 17 [json_name="op"];
+ bool all = 18 [json_name="all"];
+ SelectStmt larg = 19 [json_name="larg"];
+ SelectStmt rarg = 20 [json_name="rarg"];
+}
+
+message SetOperationStmt
+{
+ SetOperation op = 1 [json_name="op"];
+ bool all = 2 [json_name="all"];
+ Node larg = 3 [json_name="larg"];
+ Node rarg = 4 [json_name="rarg"];
+ repeated Node col_types = 5 [json_name="colTypes"];
+ repeated Node col_typmods = 6 [json_name="colTypmods"];
+ repeated Node col_collations = 7 [json_name="colCollations"];
+ repeated Node group_clauses = 8 [json_name="groupClauses"];
+}
+
+message ReturnStmt
+{
+ Node returnval = 1 [json_name="returnval"];
+}
+
+message PLAssignStmt
+{
+ string name = 1 [json_name="name"];
+ repeated Node indirection = 2 [json_name="indirection"];
+ int32 nnames = 3 [json_name="nnames"];
+ SelectStmt val = 4 [json_name="val"];
+ int32 location = 5 [json_name="location"];
+}
+
+message CreateSchemaStmt
+{
+ string schemaname = 1 [json_name="schemaname"];
+ RoleSpec authrole = 2 [json_name="authrole"];
+ repeated Node schema_elts = 3 [json_name="schemaElts"];
+ bool if_not_exists = 4 [json_name="if_not_exists"];
+}
+
+message AlterTableStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ repeated Node cmds = 2 [json_name="cmds"];
+ ObjectType objtype = 3 [json_name="objtype"];
+ bool missing_ok = 4 [json_name="missing_ok"];
+}
+
+message ReplicaIdentityStmt
+{
+ string identity_type = 1 [json_name="identity_type"];
+ string name = 2 [json_name="name"];
+}
+
+message AlterTableCmd
+{
+ AlterTableType subtype = 1 [json_name="subtype"];
+ string name = 2 [json_name="name"];
+ int32 num = 3 [json_name="num"];
+ RoleSpec newowner = 4 [json_name="newowner"];
+ Node def = 5 [json_name="def"];
+ DropBehavior behavior = 6 [json_name="behavior"];
+ bool missing_ok = 7 [json_name="missing_ok"];
+ bool recurse = 8 [json_name="recurse"];
+}
+
+message AlterCollationStmt
+{
+ repeated Node collname = 1 [json_name="collname"];
+}
+
+message AlterDomainStmt
+{
+ string subtype = 1 [json_name="subtype"];
+ repeated Node type_name = 2 [json_name="typeName"];
+ string name = 3 [json_name="name"];
+ Node def = 4 [json_name="def"];
+ DropBehavior behavior = 5 [json_name="behavior"];
+ bool missing_ok = 6 [json_name="missing_ok"];
+}
+
+message GrantStmt
+{
+ bool is_grant = 1 [json_name="is_grant"];
+ GrantTargetType targtype = 2 [json_name="targtype"];
+ ObjectType objtype = 3 [json_name="objtype"];
+ repeated Node objects = 4 [json_name="objects"];
+ repeated Node privileges = 5 [json_name="privileges"];
+ repeated Node grantees = 6 [json_name="grantees"];
+ bool grant_option = 7 [json_name="grant_option"];
+ RoleSpec grantor = 8 [json_name="grantor"];
+ DropBehavior behavior = 9 [json_name="behavior"];
+}
+
+message ObjectWithArgs
+{
+ repeated Node objname = 1 [json_name="objname"];
+ repeated Node objargs = 2 [json_name="objargs"];
+ repeated Node objfuncargs = 3 [json_name="objfuncargs"];
+ bool args_unspecified = 4 [json_name="args_unspecified"];
+}
+
+message AccessPriv
+{
+ string priv_name = 1 [json_name="priv_name"];
+ repeated Node cols = 2 [json_name="cols"];
+}
+
+message GrantRoleStmt
+{
+ repeated Node granted_roles = 1 [json_name="granted_roles"];
+ repeated Node grantee_roles = 2 [json_name="grantee_roles"];
+ bool is_grant = 3 [json_name="is_grant"];
+ repeated Node opt = 4 [json_name="opt"];
+ RoleSpec grantor = 5 [json_name="grantor"];
+ DropBehavior behavior = 6 [json_name="behavior"];
+}
+
+message AlterDefaultPrivilegesStmt
+{
+ repeated Node options = 1 [json_name="options"];
+ GrantStmt action = 2 [json_name="action"];
+}
+
+message CopyStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ Node query = 2 [json_name="query"];
+ repeated Node attlist = 3 [json_name="attlist"];
+ bool is_from = 4 [json_name="is_from"];
+ bool is_program = 5 [json_name="is_program"];
+ string filename = 6 [json_name="filename"];
+ repeated Node options = 7 [json_name="options"];
+ Node where_clause = 8 [json_name="whereClause"];
+}
+
+message VariableSetStmt
+{
+ VariableSetKind kind = 1 [json_name="kind"];
+ string name = 2 [json_name="name"];
+ repeated Node args = 3 [json_name="args"];
+ bool is_local = 4 [json_name="is_local"];
+}
+
+message VariableShowStmt
+{
+ string name = 1 [json_name="name"];
+}
+
+message CreateStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ repeated Node table_elts = 2 [json_name="tableElts"];
+ repeated Node inh_relations = 3 [json_name="inhRelations"];
+ PartitionBoundSpec partbound = 4 [json_name="partbound"];
+ PartitionSpec partspec = 5 [json_name="partspec"];
+ TypeName of_typename = 6 [json_name="ofTypename"];
+ repeated Node constraints = 7 [json_name="constraints"];
+ repeated Node options = 8 [json_name="options"];
+ OnCommitAction oncommit = 9 [json_name="oncommit"];
+ string tablespacename = 10 [json_name="tablespacename"];
+ string access_method = 11 [json_name="accessMethod"];
+ bool if_not_exists = 12 [json_name="if_not_exists"];
+}
+
+message Constraint
+{
+ ConstrType contype = 1 [json_name="contype"];
+ string conname = 2 [json_name="conname"];
+ bool deferrable = 3 [json_name="deferrable"];
+ bool initdeferred = 4 [json_name="initdeferred"];
+ bool skip_validation = 5 [json_name="skip_validation"];
+ bool initially_valid = 6 [json_name="initially_valid"];
+ bool is_no_inherit = 7 [json_name="is_no_inherit"];
+ Node raw_expr = 8 [json_name="raw_expr"];
+ string cooked_expr = 9 [json_name="cooked_expr"];
+ string generated_when = 10 [json_name="generated_when"];
+ int32 inhcount = 11 [json_name="inhcount"];
+ bool nulls_not_distinct = 12 [json_name="nulls_not_distinct"];
+ repeated Node keys = 13 [json_name="keys"];
+ repeated Node including = 14 [json_name="including"];
+ repeated Node exclusions = 15 [json_name="exclusions"];
+ repeated Node options = 16 [json_name="options"];
+ string indexname = 17 [json_name="indexname"];
+ string indexspace = 18 [json_name="indexspace"];
+ bool reset_default_tblspc = 19 [json_name="reset_default_tblspc"];
+ string access_method = 20 [json_name="access_method"];
+ Node where_clause = 21 [json_name="where_clause"];
+ RangeVar pktable = 22 [json_name="pktable"];
+ repeated Node fk_attrs = 23 [json_name="fk_attrs"];
+ repeated Node pk_attrs = 24 [json_name="pk_attrs"];
+ string fk_matchtype = 25 [json_name="fk_matchtype"];
+ string fk_upd_action = 26 [json_name="fk_upd_action"];
+ string fk_del_action = 27 [json_name="fk_del_action"];
+ repeated Node fk_del_set_cols = 28 [json_name="fk_del_set_cols"];
+ repeated Node old_conpfeqop = 29 [json_name="old_conpfeqop"];
+ uint32 old_pktable_oid = 30 [json_name="old_pktable_oid"];
+ int32 location = 31 [json_name="location"];
+}
+
+message CreateTableSpaceStmt
+{
+ string tablespacename = 1 [json_name="tablespacename"];
+ RoleSpec owner = 2 [json_name="owner"];
+ string location = 3 [json_name="location"];
+ repeated Node options = 4 [json_name="options"];
+}
+
+message DropTableSpaceStmt
+{
+ string tablespacename = 1 [json_name="tablespacename"];
+ bool missing_ok = 2 [json_name="missing_ok"];
+}
+
+message AlterTableSpaceOptionsStmt
+{
+ string tablespacename = 1 [json_name="tablespacename"];
+ repeated Node options = 2 [json_name="options"];
+ bool is_reset = 3 [json_name="isReset"];
+}
+
+message AlterTableMoveAllStmt
+{
+ string orig_tablespacename = 1 [json_name="orig_tablespacename"];
+ ObjectType objtype = 2 [json_name="objtype"];
+ repeated Node roles = 3 [json_name="roles"];
+ string new_tablespacename = 4 [json_name="new_tablespacename"];
+ bool nowait = 5 [json_name="nowait"];
+}
+
+message CreateExtensionStmt
+{
+ string extname = 1 [json_name="extname"];
+ bool if_not_exists = 2 [json_name="if_not_exists"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message AlterExtensionStmt
+{
+ string extname = 1 [json_name="extname"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message AlterExtensionContentsStmt
+{
+ string extname = 1 [json_name="extname"];
+ int32 action = 2 [json_name="action"];
+ ObjectType objtype = 3 [json_name="objtype"];
+ Node object = 4 [json_name="object"];
+}
+
+message CreateFdwStmt
+{
+ string fdwname = 1 [json_name="fdwname"];
+ repeated Node func_options = 2 [json_name="func_options"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message AlterFdwStmt
+{
+ string fdwname = 1 [json_name="fdwname"];
+ repeated Node func_options = 2 [json_name="func_options"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message CreateForeignServerStmt
+{
+ string servername = 1 [json_name="servername"];
+ string servertype = 2 [json_name="servertype"];
+ string version = 3 [json_name="version"];
+ string fdwname = 4 [json_name="fdwname"];
+ bool if_not_exists = 5 [json_name="if_not_exists"];
+ repeated Node options = 6 [json_name="options"];
+}
+
+message AlterForeignServerStmt
+{
+ string servername = 1 [json_name="servername"];
+ string version = 2 [json_name="version"];
+ repeated Node options = 3 [json_name="options"];
+ bool has_version = 4 [json_name="has_version"];
+}
+
+message CreateForeignTableStmt
+{
+ CreateStmt base_stmt = 1 [json_name="base"];
+ string servername = 2 [json_name="servername"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message CreateUserMappingStmt
+{
+ RoleSpec user = 1 [json_name="user"];
+ string servername = 2 [json_name="servername"];
+ bool if_not_exists = 3 [json_name="if_not_exists"];
+ repeated Node options = 4 [json_name="options"];
+}
+
+message AlterUserMappingStmt
+{
+ RoleSpec user = 1 [json_name="user"];
+ string servername = 2 [json_name="servername"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message DropUserMappingStmt
+{
+ RoleSpec user = 1 [json_name="user"];
+ string servername = 2 [json_name="servername"];
+ bool missing_ok = 3 [json_name="missing_ok"];
+}
+
+message ImportForeignSchemaStmt
+{
+ string server_name = 1 [json_name="server_name"];
+ string remote_schema = 2 [json_name="remote_schema"];
+ string local_schema = 3 [json_name="local_schema"];
+ ImportForeignSchemaType list_type = 4 [json_name="list_type"];
+ repeated Node table_list = 5 [json_name="table_list"];
+ repeated Node options = 6 [json_name="options"];
+}
+
+message CreatePolicyStmt
+{
+ string policy_name = 1 [json_name="policy_name"];
+ RangeVar table = 2 [json_name="table"];
+ string cmd_name = 3 [json_name="cmd_name"];
+ bool permissive = 4 [json_name="permissive"];
+ repeated Node roles = 5 [json_name="roles"];
+ Node qual = 6 [json_name="qual"];
+ Node with_check = 7 [json_name="with_check"];
+}
+
+message AlterPolicyStmt
+{
+ string policy_name = 1 [json_name="policy_name"];
+ RangeVar table = 2 [json_name="table"];
+ repeated Node roles = 3 [json_name="roles"];
+ Node qual = 4 [json_name="qual"];
+ Node with_check = 5 [json_name="with_check"];
+}
+
+message CreateAmStmt
+{
+ string amname = 1 [json_name="amname"];
+ repeated Node handler_name = 2 [json_name="handler_name"];
+ string amtype = 3 [json_name="amtype"];
+}
+
+message CreateTrigStmt
+{
+ bool replace = 1 [json_name="replace"];
+ bool isconstraint = 2 [json_name="isconstraint"];
+ string trigname = 3 [json_name="trigname"];
+ RangeVar relation = 4 [json_name="relation"];
+ repeated Node funcname = 5 [json_name="funcname"];
+ repeated Node args = 6 [json_name="args"];
+ bool row = 7 [json_name="row"];
+ int32 timing = 8 [json_name="timing"];
+ int32 events = 9 [json_name="events"];
+ repeated Node columns = 10 [json_name="columns"];
+ Node when_clause = 11 [json_name="whenClause"];
+ repeated Node transition_rels = 12 [json_name="transitionRels"];
+ bool deferrable = 13 [json_name="deferrable"];
+ bool initdeferred = 14 [json_name="initdeferred"];
+ RangeVar constrrel = 15 [json_name="constrrel"];
+}
+
+message CreateEventTrigStmt
+{
+ string trigname = 1 [json_name="trigname"];
+ string eventname = 2 [json_name="eventname"];
+ repeated Node whenclause = 3 [json_name="whenclause"];
+ repeated Node funcname = 4 [json_name="funcname"];
+}
+
+message AlterEventTrigStmt
+{
+ string trigname = 1 [json_name="trigname"];
+ string tgenabled = 2 [json_name="tgenabled"];
+}
+
+message CreatePLangStmt
+{
+ bool replace = 1 [json_name="replace"];
+ string plname = 2 [json_name="plname"];
+ repeated Node plhandler = 3 [json_name="plhandler"];
+ repeated Node plinline = 4 [json_name="plinline"];
+ repeated Node plvalidator = 5 [json_name="plvalidator"];
+ bool pltrusted = 6 [json_name="pltrusted"];
+}
+
+message CreateRoleStmt
+{
+ RoleStmtType stmt_type = 1 [json_name="stmt_type"];
+ string role = 2 [json_name="role"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message AlterRoleStmt
+{
+ RoleSpec role = 1 [json_name="role"];
+ repeated Node options = 2 [json_name="options"];
+ int32 action = 3 [json_name="action"];
+}
+
+message AlterRoleSetStmt
+{
+ RoleSpec role = 1 [json_name="role"];
+ string database = 2 [json_name="database"];
+ VariableSetStmt setstmt = 3 [json_name="setstmt"];
+}
+
+message DropRoleStmt
+{
+ repeated Node roles = 1 [json_name="roles"];
+ bool missing_ok = 2 [json_name="missing_ok"];
+}
+
+message CreateSeqStmt
+{
+ RangeVar sequence = 1 [json_name="sequence"];
+ repeated Node options = 2 [json_name="options"];
+ uint32 owner_id = 3 [json_name="ownerId"];
+ bool for_identity = 4 [json_name="for_identity"];
+ bool if_not_exists = 5 [json_name="if_not_exists"];
+}
+
+message AlterSeqStmt
+{
+ RangeVar sequence = 1 [json_name="sequence"];
+ repeated Node options = 2 [json_name="options"];
+ bool for_identity = 3 [json_name="for_identity"];
+ bool missing_ok = 4 [json_name="missing_ok"];
+}
+
+message DefineStmt
+{
+ ObjectType kind = 1 [json_name="kind"];
+ bool oldstyle = 2 [json_name="oldstyle"];
+ repeated Node defnames = 3 [json_name="defnames"];
+ repeated Node args = 4 [json_name="args"];
+ repeated Node definition = 5 [json_name="definition"];
+ bool if_not_exists = 6 [json_name="if_not_exists"];
+ bool replace = 7 [json_name="replace"];
+}
+
+message CreateDomainStmt
+{
+ repeated Node domainname = 1 [json_name="domainname"];
+ TypeName type_name = 2 [json_name="typeName"];
+ CollateClause coll_clause = 3 [json_name="collClause"];
+ repeated Node constraints = 4 [json_name="constraints"];
+}
+
+message CreateOpClassStmt
+{
+ repeated Node opclassname = 1 [json_name="opclassname"];
+ repeated Node opfamilyname = 2 [json_name="opfamilyname"];
+ string amname = 3 [json_name="amname"];
+ TypeName datatype = 4 [json_name="datatype"];
+ repeated Node items = 5 [json_name="items"];
+ bool is_default = 6 [json_name="isDefault"];
+}
+
+message CreateOpClassItem
+{
+ int32 itemtype = 1 [json_name="itemtype"];
+ ObjectWithArgs name = 2 [json_name="name"];
+ int32 number = 3 [json_name="number"];
+ repeated Node order_family = 4 [json_name="order_family"];
+ repeated Node class_args = 5 [json_name="class_args"];
+ TypeName storedtype = 6 [json_name="storedtype"];
+}
+
+message CreateOpFamilyStmt
+{
+ repeated Node opfamilyname = 1 [json_name="opfamilyname"];
+ string amname = 2 [json_name="amname"];
+}
+
+message AlterOpFamilyStmt
+{
+ repeated Node opfamilyname = 1 [json_name="opfamilyname"];
+ string amname = 2 [json_name="amname"];
+ bool is_drop = 3 [json_name="isDrop"];
+ repeated Node items = 4 [json_name="items"];
+}
+
+message DropStmt
+{
+ repeated Node objects = 1 [json_name="objects"];
+ ObjectType remove_type = 2 [json_name="removeType"];
+ DropBehavior behavior = 3 [json_name="behavior"];
+ bool missing_ok = 4 [json_name="missing_ok"];
+ bool concurrent = 5 [json_name="concurrent"];
+}
+
+message TruncateStmt
+{
+ repeated Node relations = 1 [json_name="relations"];
+ bool restart_seqs = 2 [json_name="restart_seqs"];
+ DropBehavior behavior = 3 [json_name="behavior"];
+}
+
+message CommentStmt
+{
+ ObjectType objtype = 1 [json_name="objtype"];
+ Node object = 2 [json_name="object"];
+ string comment = 3 [json_name="comment"];
+}
+
+message SecLabelStmt
+{
+ ObjectType objtype = 1 [json_name="objtype"];
+ Node object = 2 [json_name="object"];
+ string provider = 3 [json_name="provider"];
+ string label = 4 [json_name="label"];
+}
+
+message DeclareCursorStmt
+{
+ string portalname = 1 [json_name="portalname"];
+ int32 options = 2 [json_name="options"];
+ Node query = 3 [json_name="query"];
+}
+
+message ClosePortalStmt
+{
+ string portalname = 1 [json_name="portalname"];
+}
+
+message FetchStmt
+{
+ FetchDirection direction = 1 [json_name="direction"];
+ int64 how_many = 2 [json_name="howMany"];
+ string portalname = 3 [json_name="portalname"];
+ bool ismove = 4 [json_name="ismove"];
+}
+
+message IndexStmt
+{
+ string idxname = 1 [json_name="idxname"];
+ RangeVar relation = 2 [json_name="relation"];
+ string access_method = 3 [json_name="accessMethod"];
+ string table_space = 4 [json_name="tableSpace"];
+ repeated Node index_params = 5 [json_name="indexParams"];
+ repeated Node index_including_params = 6 [json_name="indexIncludingParams"];
+ repeated Node options = 7 [json_name="options"];
+ Node where_clause = 8 [json_name="whereClause"];
+ repeated Node exclude_op_names = 9 [json_name="excludeOpNames"];
+ string idxcomment = 10 [json_name="idxcomment"];
+ uint32 index_oid = 11 [json_name="indexOid"];
+ uint32 old_number = 12 [json_name="oldNumber"];
+ uint32 old_create_subid = 13 [json_name="oldCreateSubid"];
+ uint32 old_first_relfilelocator_subid = 14 [json_name="oldFirstRelfilelocatorSubid"];
+ bool unique = 15 [json_name="unique"];
+ bool nulls_not_distinct = 16 [json_name="nulls_not_distinct"];
+ bool primary = 17 [json_name="primary"];
+ bool isconstraint = 18 [json_name="isconstraint"];
+ bool deferrable = 19 [json_name="deferrable"];
+ bool initdeferred = 20 [json_name="initdeferred"];
+ bool transformed = 21 [json_name="transformed"];
+ bool concurrent = 22 [json_name="concurrent"];
+ bool if_not_exists = 23 [json_name="if_not_exists"];
+ bool reset_default_tblspc = 24 [json_name="reset_default_tblspc"];
+}
+
+message CreateStatsStmt
+{
+ repeated Node defnames = 1 [json_name="defnames"];
+ repeated Node stat_types = 2 [json_name="stat_types"];
+ repeated Node exprs = 3 [json_name="exprs"];
+ repeated Node relations = 4 [json_name="relations"];
+ string stxcomment = 5 [json_name="stxcomment"];
+ bool transformed = 6 [json_name="transformed"];
+ bool if_not_exists = 7 [json_name="if_not_exists"];
+}
+
+message StatsElem
+{
+ string name = 1 [json_name="name"];
+ Node expr = 2 [json_name="expr"];
+}
+
+message AlterStatsStmt
+{
+ repeated Node defnames = 1 [json_name="defnames"];
+ Node stxstattarget = 2 [json_name="stxstattarget"];
+ bool missing_ok = 3 [json_name="missing_ok"];
+}
+
+message CreateFunctionStmt
+{
+ bool is_procedure = 1 [json_name="is_procedure"];
+ bool replace = 2 [json_name="replace"];
+ repeated Node funcname = 3 [json_name="funcname"];
+ repeated Node parameters = 4 [json_name="parameters"];
+ TypeName return_type = 5 [json_name="returnType"];
+ repeated Node options = 6 [json_name="options"];
+ Node sql_body = 7 [json_name="sql_body"];
+}
+
+message FunctionParameter
+{
+ string name = 1 [json_name="name"];
+ TypeName arg_type = 2 [json_name="argType"];
+ FunctionParameterMode mode = 3 [json_name="mode"];
+ Node defexpr = 4 [json_name="defexpr"];
+}
+
+message AlterFunctionStmt
+{
+ ObjectType objtype = 1 [json_name="objtype"];
+ ObjectWithArgs func = 2 [json_name="func"];
+ repeated Node actions = 3 [json_name="actions"];
+}
+
+message DoStmt
+{
+ repeated Node args = 1 [json_name="args"];
+}
+
+message InlineCodeBlock
+{
+ string source_text = 1 [json_name="source_text"];
+ uint32 lang_oid = 2 [json_name="langOid"];
+ bool lang_is_trusted = 3 [json_name="langIsTrusted"];
+ bool atomic = 4 [json_name="atomic"];
+}
+
+message CallStmt
+{
+ FuncCall funccall = 1 [json_name="funccall"];
+ FuncExpr funcexpr = 2 [json_name="funcexpr"];
+ repeated Node outargs = 3 [json_name="outargs"];
+}
+
+message CallContext
+{
+ bool atomic = 1 [json_name="atomic"];
+}
+
+message RenameStmt
+{
+ ObjectType rename_type = 1 [json_name="renameType"];
+ ObjectType relation_type = 2 [json_name="relationType"];
+ RangeVar relation = 3 [json_name="relation"];
+ Node object = 4 [json_name="object"];
+ string subname = 5 [json_name="subname"];
+ string newname = 6 [json_name="newname"];
+ DropBehavior behavior = 7 [json_name="behavior"];
+ bool missing_ok = 8 [json_name="missing_ok"];
+}
+
+message AlterObjectDependsStmt
+{
+ ObjectType object_type = 1 [json_name="objectType"];
+ RangeVar relation = 2 [json_name="relation"];
+ Node object = 3 [json_name="object"];
+ String extname = 4 [json_name="extname"];
+ bool remove = 5 [json_name="remove"];
+}
+
+message AlterObjectSchemaStmt
+{
+ ObjectType object_type = 1 [json_name="objectType"];
+ RangeVar relation = 2 [json_name="relation"];
+ Node object = 3 [json_name="object"];
+ string newschema = 4 [json_name="newschema"];
+ bool missing_ok = 5 [json_name="missing_ok"];
+}
+
+message AlterOwnerStmt
+{
+ ObjectType object_type = 1 [json_name="objectType"];
+ RangeVar relation = 2 [json_name="relation"];
+ Node object = 3 [json_name="object"];
+ RoleSpec newowner = 4 [json_name="newowner"];
+}
+
+message AlterOperatorStmt
+{
+ ObjectWithArgs opername = 1 [json_name="opername"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message AlterTypeStmt
+{
+ repeated Node type_name = 1 [json_name="typeName"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message RuleStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ string rulename = 2 [json_name="rulename"];
+ Node where_clause = 3 [json_name="whereClause"];
+ CmdType event = 4 [json_name="event"];
+ bool instead = 5 [json_name="instead"];
+ repeated Node actions = 6 [json_name="actions"];
+ bool replace = 7 [json_name="replace"];
+}
+
+message NotifyStmt
+{
+ string conditionname = 1 [json_name="conditionname"];
+ string payload = 2 [json_name="payload"];
+}
+
+message ListenStmt
+{
+ string conditionname = 1 [json_name="conditionname"];
+}
+
+message UnlistenStmt
+{
+ string conditionname = 1 [json_name="conditionname"];
+}
+
+message TransactionStmt
+{
+ TransactionStmtKind kind = 1 [json_name="kind"];
+ repeated Node options = 2 [json_name="options"];
+ string savepoint_name = 3 [json_name="savepoint_name"];
+ string gid = 4 [json_name="gid"];
+ bool chain = 5 [json_name="chain"];
+ int32 location = 6 [json_name="location"];
+}
+
+message CompositeTypeStmt
+{
+ RangeVar typevar = 1 [json_name="typevar"];
+ repeated Node coldeflist = 2 [json_name="coldeflist"];
+}
+
+message CreateEnumStmt
+{
+ repeated Node type_name = 1 [json_name="typeName"];
+ repeated Node vals = 2 [json_name="vals"];
+}
+
+message CreateRangeStmt
+{
+ repeated Node type_name = 1 [json_name="typeName"];
+ repeated Node params = 2 [json_name="params"];
+}
+
+message AlterEnumStmt
+{
+ repeated Node type_name = 1 [json_name="typeName"];
+ string old_val = 2 [json_name="oldVal"];
+ string new_val = 3 [json_name="newVal"];
+ string new_val_neighbor = 4 [json_name="newValNeighbor"];
+ bool new_val_is_after = 5 [json_name="newValIsAfter"];
+ bool skip_if_new_val_exists = 6 [json_name="skipIfNewValExists"];
+}
+
+message ViewStmt
+{
+ RangeVar view = 1 [json_name="view"];
+ repeated Node aliases = 2 [json_name="aliases"];
+ Node query = 3 [json_name="query"];
+ bool replace = 4 [json_name="replace"];
+ repeated Node options = 5 [json_name="options"];
+ ViewCheckOption with_check_option = 6 [json_name="withCheckOption"];
+}
+
+message LoadStmt
+{
+ string filename = 1 [json_name="filename"];
+}
+
+message CreatedbStmt
+{
+ string dbname = 1 [json_name="dbname"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message AlterDatabaseStmt
+{
+ string dbname = 1 [json_name="dbname"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message AlterDatabaseRefreshCollStmt
+{
+ string dbname = 1 [json_name="dbname"];
+}
+
+message AlterDatabaseSetStmt
+{
+ string dbname = 1 [json_name="dbname"];
+ VariableSetStmt setstmt = 2 [json_name="setstmt"];
+}
+
+message DropdbStmt
+{
+ string dbname = 1 [json_name="dbname"];
+ bool missing_ok = 2 [json_name="missing_ok"];
+ repeated Node options = 3 [json_name="options"];
+}
+
+message AlterSystemStmt
+{
+ VariableSetStmt setstmt = 1 [json_name="setstmt"];
+}
+
+message ClusterStmt
+{
+ RangeVar relation = 1 [json_name="relation"];
+ string indexname = 2 [json_name="indexname"];
+ repeated Node params = 3 [json_name="params"];
+}
+
+message VacuumStmt
+{
+ repeated Node options = 1 [json_name="options"];
+ repeated Node rels = 2 [json_name="rels"];
+ bool is_vacuumcmd = 3 [json_name="is_vacuumcmd"];
+}
+
+message VacuumRelation
+{
+ RangeVar relation = 1 [json_name="relation"];
+ uint32 oid = 2 [json_name="oid"];
+ repeated Node va_cols = 3 [json_name="va_cols"];
+}
+
+message ExplainStmt
+{
+ Node query = 1 [json_name="query"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message CreateTableAsStmt
+{
+ Node query = 1 [json_name="query"];
+ IntoClause into = 2 [json_name="into"];
+ ObjectType objtype = 3 [json_name="objtype"];
+ bool is_select_into = 4 [json_name="is_select_into"];
+ bool if_not_exists = 5 [json_name="if_not_exists"];
+}
+
+message RefreshMatViewStmt
+{
+ bool concurrent = 1 [json_name="concurrent"];
+ bool skip_data = 2 [json_name="skipData"];
+ RangeVar relation = 3 [json_name="relation"];
+}
+
+message CheckPointStmt
+{
+}
+
+message DiscardStmt
+{
+ DiscardMode target = 1 [json_name="target"];
+}
+
+message LockStmt
+{
+ repeated Node relations = 1 [json_name="relations"];
+ int32 mode = 2 [json_name="mode"];
+ bool nowait = 3 [json_name="nowait"];
+}
+
+message ConstraintsSetStmt
+{
+ repeated Node constraints = 1 [json_name="constraints"];
+ bool deferred = 2 [json_name="deferred"];
+}
+
+message ReindexStmt
+{
+ ReindexObjectType kind = 1 [json_name="kind"];
+ RangeVar relation = 2 [json_name="relation"];
+ string name = 3 [json_name="name"];
+ repeated Node params = 4 [json_name="params"];
+}
+
+message CreateConversionStmt
+{
+ repeated Node conversion_name = 1 [json_name="conversion_name"];
+ string for_encoding_name = 2 [json_name="for_encoding_name"];
+ string to_encoding_name = 3 [json_name="to_encoding_name"];
+ repeated Node func_name = 4 [json_name="func_name"];
+ bool def = 5 [json_name="def"];
+}
+
+message CreateCastStmt
+{
+ TypeName sourcetype = 1 [json_name="sourcetype"];
+ TypeName targettype = 2 [json_name="targettype"];
+ ObjectWithArgs func = 3 [json_name="func"];
+ CoercionContext context = 4 [json_name="context"];
+ bool inout = 5 [json_name="inout"];
+}
+
+message CreateTransformStmt
+{
+ bool replace = 1 [json_name="replace"];
+ TypeName type_name = 2 [json_name="type_name"];
+ string lang = 3 [json_name="lang"];
+ ObjectWithArgs fromsql = 4 [json_name="fromsql"];
+ ObjectWithArgs tosql = 5 [json_name="tosql"];
+}
+
+message PrepareStmt
+{
+ string name = 1 [json_name="name"];
+ repeated Node argtypes = 2 [json_name="argtypes"];
+ Node query = 3 [json_name="query"];
+}
+
+message ExecuteStmt
+{
+ string name = 1 [json_name="name"];
+ repeated Node params = 2 [json_name="params"];
+}
+
+message DeallocateStmt
+{
+ string name = 1 [json_name="name"];
+ bool isall = 2 [json_name="isall"];
+ int32 location = 3 [json_name="location"];
+}
+
+message DropOwnedStmt
+{
+ repeated Node roles = 1 [json_name="roles"];
+ DropBehavior behavior = 2 [json_name="behavior"];
+}
+
+message ReassignOwnedStmt
+{
+ repeated Node roles = 1 [json_name="roles"];
+ RoleSpec newrole = 2 [json_name="newrole"];
+}
+
+message AlterTSDictionaryStmt
+{
+ repeated Node dictname = 1 [json_name="dictname"];
+ repeated Node options = 2 [json_name="options"];
+}
+
+message AlterTSConfigurationStmt
+{
+ AlterTSConfigType kind = 1 [json_name="kind"];
+ repeated Node cfgname = 2 [json_name="cfgname"];
+ repeated Node tokentype = 3 [json_name="tokentype"];
+ repeated Node dicts = 4 [json_name="dicts"];
+ bool override = 5 [json_name="override"];
+ bool replace = 6 [json_name="replace"];
+ bool missing_ok = 7 [json_name="missing_ok"];
+}
+
+message PublicationTable
+{
+ RangeVar relation = 1 [json_name="relation"];
+ Node where_clause = 2 [json_name="whereClause"];
+ repeated Node columns = 3 [json_name="columns"];
+}
+
+message PublicationObjSpec
+{
+ PublicationObjSpecType pubobjtype = 1 [json_name="pubobjtype"];
+ string name = 2 [json_name="name"];
+ PublicationTable pubtable = 3 [json_name="pubtable"];
+ int32 location = 4 [json_name="location"];
+}
+
+message CreatePublicationStmt
+{
+ string pubname = 1 [json_name="pubname"];
+ repeated Node options = 2 [json_name="options"];
+ repeated Node pubobjects = 3 [json_name="pubobjects"];
+ bool for_all_tables = 4 [json_name="for_all_tables"];
+}
+
+message AlterPublicationStmt
+{
+ string pubname = 1 [json_name="pubname"];
+ repeated Node options = 2 [json_name="options"];
+ repeated Node pubobjects = 3 [json_name="pubobjects"];
+ bool for_all_tables = 4 [json_name="for_all_tables"];
+ AlterPublicationAction action = 5 [json_name="action"];
+}
+
+message CreateSubscriptionStmt
+{
+ string subname = 1 [json_name="subname"];
+ string conninfo = 2 [json_name="conninfo"];
+ repeated Node publication = 3 [json_name="publication"];
+ repeated Node options = 4 [json_name="options"];
+}
+
+message AlterSubscriptionStmt
+{
+ AlterSubscriptionType kind = 1 [json_name="kind"];
+ string subname = 2 [json_name="subname"];
+ string conninfo = 3 [json_name="conninfo"];
+ repeated Node publication = 4 [json_name="publication"];
+ repeated Node options = 5 [json_name="options"];
+}
+
+message DropSubscriptionStmt
+{
+ string subname = 1 [json_name="subname"];
+ bool missing_ok = 2 [json_name="missing_ok"];
+ DropBehavior behavior = 3 [json_name="behavior"];
+}
+
+enum QuerySource
+{
+ QUERY_SOURCE_UNDEFINED = 0;
+ QSRC_ORIGINAL = 1;
+ QSRC_PARSER = 2;
+ QSRC_INSTEAD_RULE = 3;
+ QSRC_QUAL_INSTEAD_RULE = 4;
+ QSRC_NON_INSTEAD_RULE = 5;
+}
+
+enum SortByDir
+{
+ SORT_BY_DIR_UNDEFINED = 0;
+ SORTBY_DEFAULT = 1;
+ SORTBY_ASC = 2;
+ SORTBY_DESC = 3;
+ SORTBY_USING = 4;
+}
+
+enum SortByNulls
+{
+ SORT_BY_NULLS_UNDEFINED = 0;
+ SORTBY_NULLS_DEFAULT = 1;
+ SORTBY_NULLS_FIRST = 2;
+ SORTBY_NULLS_LAST = 3;
+}
+
+enum SetQuantifier
+{
+ SET_QUANTIFIER_UNDEFINED = 0;
+ SET_QUANTIFIER_DEFAULT = 1;
+ SET_QUANTIFIER_ALL = 2;
+ SET_QUANTIFIER_DISTINCT = 3;
+}
+
+enum A_Expr_Kind
+{
+ A_EXPR_KIND_UNDEFINED = 0;
+ AEXPR_OP = 1;
+ AEXPR_OP_ANY = 2;
+ AEXPR_OP_ALL = 3;
+ AEXPR_DISTINCT = 4;
+ AEXPR_NOT_DISTINCT = 5;
+ AEXPR_NULLIF = 6;
+ AEXPR_IN = 7;
+ AEXPR_LIKE = 8;
+ AEXPR_ILIKE = 9;
+ AEXPR_SIMILAR = 10;
+ AEXPR_BETWEEN = 11;
+ AEXPR_NOT_BETWEEN = 12;
+ AEXPR_BETWEEN_SYM = 13;
+ AEXPR_NOT_BETWEEN_SYM = 14;
+}
+
+enum RoleSpecType
+{
+ ROLE_SPEC_TYPE_UNDEFINED = 0;
+ ROLESPEC_CSTRING = 1;
+ ROLESPEC_CURRENT_ROLE = 2;
+ ROLESPEC_CURRENT_USER = 3;
+ ROLESPEC_SESSION_USER = 4;
+ ROLESPEC_PUBLIC = 5;
+}
+
+enum TableLikeOption
+{
+ TABLE_LIKE_OPTION_UNDEFINED = 0;
+ CREATE_TABLE_LIKE_COMMENTS = 1;
+ CREATE_TABLE_LIKE_COMPRESSION = 2;
+ CREATE_TABLE_LIKE_CONSTRAINTS = 3;
+ CREATE_TABLE_LIKE_DEFAULTS = 4;
+ CREATE_TABLE_LIKE_GENERATED = 5;
+ CREATE_TABLE_LIKE_IDENTITY = 6;
+ CREATE_TABLE_LIKE_INDEXES = 7;
+ CREATE_TABLE_LIKE_STATISTICS = 8;
+ CREATE_TABLE_LIKE_STORAGE = 9;
+ CREATE_TABLE_LIKE_ALL = 10;
+}
+
+enum DefElemAction
+{
+ DEF_ELEM_ACTION_UNDEFINED = 0;
+ DEFELEM_UNSPEC = 1;
+ DEFELEM_SET = 2;
+ DEFELEM_ADD = 3;
+ DEFELEM_DROP = 4;
+}
+
+enum PartitionStrategy
+{
+ PARTITION_STRATEGY_UNDEFINED = 0;
+ PARTITION_STRATEGY_LIST = 1;
+ PARTITION_STRATEGY_RANGE = 2;
+ PARTITION_STRATEGY_HASH = 3;
+}
+
+enum PartitionRangeDatumKind
+{
+ PARTITION_RANGE_DATUM_KIND_UNDEFINED = 0;
+ PARTITION_RANGE_DATUM_MINVALUE = 1;
+ PARTITION_RANGE_DATUM_VALUE = 2;
+ PARTITION_RANGE_DATUM_MAXVALUE = 3;
+}
+
+enum RTEKind
+{
+ RTEKIND_UNDEFINED = 0;
+ RTE_RELATION = 1;
+ RTE_SUBQUERY = 2;
+ RTE_JOIN = 3;
+ RTE_FUNCTION = 4;
+ RTE_TABLEFUNC = 5;
+ RTE_VALUES = 6;
+ RTE_CTE = 7;
+ RTE_NAMEDTUPLESTORE = 8;
+ RTE_RESULT = 9;
+}
+
+enum WCOKind
+{
+ WCOKIND_UNDEFINED = 0;
+ WCO_VIEW_CHECK = 1;
+ WCO_RLS_INSERT_CHECK = 2;
+ WCO_RLS_UPDATE_CHECK = 3;
+ WCO_RLS_CONFLICT_CHECK = 4;
+ WCO_RLS_MERGE_UPDATE_CHECK = 5;
+ WCO_RLS_MERGE_DELETE_CHECK = 6;
+}
+
+enum GroupingSetKind
+{
+ GROUPING_SET_KIND_UNDEFINED = 0;
+ GROUPING_SET_EMPTY = 1;
+ GROUPING_SET_SIMPLE = 2;
+ GROUPING_SET_ROLLUP = 3;
+ GROUPING_SET_CUBE = 4;
+ GROUPING_SET_SETS = 5;
+}
+
+enum CTEMaterialize
+{
+ CTEMATERIALIZE_UNDEFINED = 0;
+ CTEMaterializeDefault = 1;
+ CTEMaterializeAlways = 2;
+ CTEMaterializeNever = 3;
+}
+
+enum JsonQuotes
+{
+ JSON_QUOTES_UNDEFINED = 0;
+ JS_QUOTES_UNSPEC = 1;
+ JS_QUOTES_KEEP = 2;
+ JS_QUOTES_OMIT = 3;
+}
+
+enum JsonTableColumnType
+{
+ JSON_TABLE_COLUMN_TYPE_UNDEFINED = 0;
+ JTC_FOR_ORDINALITY = 1;
+ JTC_REGULAR = 2;
+ JTC_EXISTS = 3;
+ JTC_FORMATTED = 4;
+ JTC_NESTED = 5;
+}
+
+enum SetOperation
+{
+ SET_OPERATION_UNDEFINED = 0;
+ SETOP_NONE = 1;
+ SETOP_UNION = 2;
+ SETOP_INTERSECT = 3;
+ SETOP_EXCEPT = 4;
+}
+
+enum ObjectType
+{
+ OBJECT_TYPE_UNDEFINED = 0;
+ OBJECT_ACCESS_METHOD = 1;
+ OBJECT_AGGREGATE = 2;
+ OBJECT_AMOP = 3;
+ OBJECT_AMPROC = 4;
+ OBJECT_ATTRIBUTE = 5;
+ OBJECT_CAST = 6;
+ OBJECT_COLUMN = 7;
+ OBJECT_COLLATION = 8;
+ OBJECT_CONVERSION = 9;
+ OBJECT_DATABASE = 10;
+ OBJECT_DEFAULT = 11;
+ OBJECT_DEFACL = 12;
+ OBJECT_DOMAIN = 13;
+ OBJECT_DOMCONSTRAINT = 14;
+ OBJECT_EVENT_TRIGGER = 15;
+ OBJECT_EXTENSION = 16;
+ OBJECT_FDW = 17;
+ OBJECT_FOREIGN_SERVER = 18;
+ OBJECT_FOREIGN_TABLE = 19;
+ OBJECT_FUNCTION = 20;
+ OBJECT_INDEX = 21;
+ OBJECT_LANGUAGE = 22;
+ OBJECT_LARGEOBJECT = 23;
+ OBJECT_MATVIEW = 24;
+ OBJECT_OPCLASS = 25;
+ OBJECT_OPERATOR = 26;
+ OBJECT_OPFAMILY = 27;
+ OBJECT_PARAMETER_ACL = 28;
+ OBJECT_POLICY = 29;
+ OBJECT_PROCEDURE = 30;
+ OBJECT_PUBLICATION = 31;
+ OBJECT_PUBLICATION_NAMESPACE = 32;
+ OBJECT_PUBLICATION_REL = 33;
+ OBJECT_ROLE = 34;
+ OBJECT_ROUTINE = 35;
+ OBJECT_RULE = 36;
+ OBJECT_SCHEMA = 37;
+ OBJECT_SEQUENCE = 38;
+ OBJECT_SUBSCRIPTION = 39;
+ OBJECT_STATISTIC_EXT = 40;
+ OBJECT_TABCONSTRAINT = 41;
+ OBJECT_TABLE = 42;
+ OBJECT_TABLESPACE = 43;
+ OBJECT_TRANSFORM = 44;
+ OBJECT_TRIGGER = 45;
+ OBJECT_TSCONFIGURATION = 46;
+ OBJECT_TSDICTIONARY = 47;
+ OBJECT_TSPARSER = 48;
+ OBJECT_TSTEMPLATE = 49;
+ OBJECT_TYPE = 50;
+ OBJECT_USER_MAPPING = 51;
+ OBJECT_VIEW = 52;
+}
+
+enum DropBehavior
+{
+ DROP_BEHAVIOR_UNDEFINED = 0;
+ DROP_RESTRICT = 1;
+ DROP_CASCADE = 2;
+}
+
+enum AlterTableType
+{
+ ALTER_TABLE_TYPE_UNDEFINED = 0;
+ AT_AddColumn = 1;
+ AT_AddColumnToView = 2;
+ AT_ColumnDefault = 3;
+ AT_CookedColumnDefault = 4;
+ AT_DropNotNull = 5;
+ AT_SetNotNull = 6;
+ AT_SetExpression = 7;
+ AT_DropExpression = 8;
+ AT_CheckNotNull = 9;
+ AT_SetStatistics = 10;
+ AT_SetOptions = 11;
+ AT_ResetOptions = 12;
+ AT_SetStorage = 13;
+ AT_SetCompression = 14;
+ AT_DropColumn = 15;
+ AT_AddIndex = 16;
+ AT_ReAddIndex = 17;
+ AT_AddConstraint = 18;
+ AT_ReAddConstraint = 19;
+ AT_ReAddDomainConstraint = 20;
+ AT_AlterConstraint = 21;
+ AT_ValidateConstraint = 22;
+ AT_AddIndexConstraint = 23;
+ AT_DropConstraint = 24;
+ AT_ReAddComment = 25;
+ AT_AlterColumnType = 26;
+ AT_AlterColumnGenericOptions = 27;
+ AT_ChangeOwner = 28;
+ AT_ClusterOn = 29;
+ AT_DropCluster = 30;
+ AT_SetLogged = 31;
+ AT_SetUnLogged = 32;
+ AT_DropOids = 33;
+ AT_SetAccessMethod = 34;
+ AT_SetTableSpace = 35;
+ AT_SetRelOptions = 36;
+ AT_ResetRelOptions = 37;
+ AT_ReplaceRelOptions = 38;
+ AT_EnableTrig = 39;
+ AT_EnableAlwaysTrig = 40;
+ AT_EnableReplicaTrig = 41;
+ AT_DisableTrig = 42;
+ AT_EnableTrigAll = 43;
+ AT_DisableTrigAll = 44;
+ AT_EnableTrigUser = 45;
+ AT_DisableTrigUser = 46;
+ AT_EnableRule = 47;
+ AT_EnableAlwaysRule = 48;
+ AT_EnableReplicaRule = 49;
+ AT_DisableRule = 50;
+ AT_AddInherit = 51;
+ AT_DropInherit = 52;
+ AT_AddOf = 53;
+ AT_DropOf = 54;
+ AT_ReplicaIdentity = 55;
+ AT_EnableRowSecurity = 56;
+ AT_DisableRowSecurity = 57;
+ AT_ForceRowSecurity = 58;
+ AT_NoForceRowSecurity = 59;
+ AT_GenericOptions = 60;
+ AT_AttachPartition = 61;
+ AT_DetachPartition = 62;
+ AT_DetachPartitionFinalize = 63;
+ AT_AddIdentity = 64;
+ AT_SetIdentity = 65;
+ AT_DropIdentity = 66;
+ AT_ReAddStatistics = 67;
+}
+
+enum GrantTargetType
+{
+ GRANT_TARGET_TYPE_UNDEFINED = 0;
+ ACL_TARGET_OBJECT = 1;
+ ACL_TARGET_ALL_IN_SCHEMA = 2;
+ ACL_TARGET_DEFAULTS = 3;
+}
+
+enum VariableSetKind
+{
+ VARIABLE_SET_KIND_UNDEFINED = 0;
+ VAR_SET_VALUE = 1;
+ VAR_SET_DEFAULT = 2;
+ VAR_SET_CURRENT = 3;
+ VAR_SET_MULTI = 4;
+ VAR_RESET = 5;
+ VAR_RESET_ALL = 6;
+}
+
+enum ConstrType
+{
+ CONSTR_TYPE_UNDEFINED = 0;
+ CONSTR_NULL = 1;
+ CONSTR_NOTNULL = 2;
+ CONSTR_DEFAULT = 3;
+ CONSTR_IDENTITY = 4;
+ CONSTR_GENERATED = 5;
+ CONSTR_CHECK = 6;
+ CONSTR_PRIMARY = 7;
+ CONSTR_UNIQUE = 8;
+ CONSTR_EXCLUSION = 9;
+ CONSTR_FOREIGN = 10;
+ CONSTR_ATTR_DEFERRABLE = 11;
+ CONSTR_ATTR_NOT_DEFERRABLE = 12;
+ CONSTR_ATTR_DEFERRED = 13;
+ CONSTR_ATTR_IMMEDIATE = 14;
+}
+
+enum ImportForeignSchemaType
+{
+ IMPORT_FOREIGN_SCHEMA_TYPE_UNDEFINED = 0;
+ FDW_IMPORT_SCHEMA_ALL = 1;
+ FDW_IMPORT_SCHEMA_LIMIT_TO = 2;
+ FDW_IMPORT_SCHEMA_EXCEPT = 3;
+}
+
+enum RoleStmtType
+{
+ ROLE_STMT_TYPE_UNDEFINED = 0;
+ ROLESTMT_ROLE = 1;
+ ROLESTMT_USER = 2;
+ ROLESTMT_GROUP = 3;
+}
+
+enum FetchDirection
+{
+ FETCH_DIRECTION_UNDEFINED = 0;
+ FETCH_FORWARD = 1;
+ FETCH_BACKWARD = 2;
+ FETCH_ABSOLUTE = 3;
+ FETCH_RELATIVE = 4;
+}
+
+enum FunctionParameterMode
+{
+ FUNCTION_PARAMETER_MODE_UNDEFINED = 0;
+ FUNC_PARAM_IN = 1;
+ FUNC_PARAM_OUT = 2;
+ FUNC_PARAM_INOUT = 3;
+ FUNC_PARAM_VARIADIC = 4;
+ FUNC_PARAM_TABLE = 5;
+ FUNC_PARAM_DEFAULT = 6;
+}
+
+enum TransactionStmtKind
+{
+ TRANSACTION_STMT_KIND_UNDEFINED = 0;
+ TRANS_STMT_BEGIN = 1;
+ TRANS_STMT_START = 2;
+ TRANS_STMT_COMMIT = 3;
+ TRANS_STMT_ROLLBACK = 4;
+ TRANS_STMT_SAVEPOINT = 5;
+ TRANS_STMT_RELEASE = 6;
+ TRANS_STMT_ROLLBACK_TO = 7;
+ TRANS_STMT_PREPARE = 8;
+ TRANS_STMT_COMMIT_PREPARED = 9;
+ TRANS_STMT_ROLLBACK_PREPARED = 10;
+}
+
+enum ViewCheckOption
+{
+ VIEW_CHECK_OPTION_UNDEFINED = 0;
+ NO_CHECK_OPTION = 1;
+ LOCAL_CHECK_OPTION = 2;
+ CASCADED_CHECK_OPTION = 3;
+}
+
+enum DiscardMode
+{
+ DISCARD_MODE_UNDEFINED = 0;
+ DISCARD_ALL = 1;
+ DISCARD_PLANS = 2;
+ DISCARD_SEQUENCES = 3;
+ DISCARD_TEMP = 4;
+}
+
+enum ReindexObjectType
+{
+ REINDEX_OBJECT_TYPE_UNDEFINED = 0;
+ REINDEX_OBJECT_INDEX = 1;
+ REINDEX_OBJECT_TABLE = 2;
+ REINDEX_OBJECT_SCHEMA = 3;
+ REINDEX_OBJECT_SYSTEM = 4;
+ REINDEX_OBJECT_DATABASE = 5;
+}
+
+enum AlterTSConfigType
+{
+ ALTER_TSCONFIG_TYPE_UNDEFINED = 0;
+ ALTER_TSCONFIG_ADD_MAPPING = 1;
+ ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN = 2;
+ ALTER_TSCONFIG_REPLACE_DICT = 3;
+ ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN = 4;
+ ALTER_TSCONFIG_DROP_MAPPING = 5;
+}
+
+enum PublicationObjSpecType
+{
+ PUBLICATION_OBJ_SPEC_TYPE_UNDEFINED = 0;
+ PUBLICATIONOBJ_TABLE = 1;
+ PUBLICATIONOBJ_TABLES_IN_SCHEMA = 2;
+ PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA = 3;
+ PUBLICATIONOBJ_CONTINUATION = 4;
+}
+
+enum AlterPublicationAction
+{
+ ALTER_PUBLICATION_ACTION_UNDEFINED = 0;
+ AP_AddObjects = 1;
+ AP_DropObjects = 2;
+ AP_SetObjects = 3;
+}
+
+enum AlterSubscriptionType
+{
+ ALTER_SUBSCRIPTION_TYPE_UNDEFINED = 0;
+ ALTER_SUBSCRIPTION_OPTIONS = 1;
+ ALTER_SUBSCRIPTION_CONNECTION = 2;
+ ALTER_SUBSCRIPTION_SET_PUBLICATION = 3;
+ ALTER_SUBSCRIPTION_ADD_PUBLICATION = 4;
+ ALTER_SUBSCRIPTION_DROP_PUBLICATION = 5;
+ ALTER_SUBSCRIPTION_REFRESH = 6;
+ ALTER_SUBSCRIPTION_ENABLED = 7;
+ ALTER_SUBSCRIPTION_SKIP = 8;
+}
+
+enum OverridingKind
+{
+ OVERRIDING_KIND_UNDEFINED = 0;
+ OVERRIDING_NOT_SET = 1;
+ OVERRIDING_USER_VALUE = 2;
+ OVERRIDING_SYSTEM_VALUE = 3;
+}
+
+enum OnCommitAction
+{
+ ON_COMMIT_ACTION_UNDEFINED = 0;
+ ONCOMMIT_NOOP = 1;
+ ONCOMMIT_PRESERVE_ROWS = 2;
+ ONCOMMIT_DELETE_ROWS = 3;
+ ONCOMMIT_DROP = 4;
+}
+
+enum TableFuncType
+{
+ TABLE_FUNC_TYPE_UNDEFINED = 0;
+ TFT_XMLTABLE = 1;
+ TFT_JSON_TABLE = 2;
+}
+
+enum ParamKind
+{
+ PARAM_KIND_UNDEFINED = 0;
+ PARAM_EXTERN = 1;
+ PARAM_EXEC = 2;
+ PARAM_SUBLINK = 3;
+ PARAM_MULTIEXPR = 4;
+}
+
+enum CoercionContext
+{
+ COERCION_CONTEXT_UNDEFINED = 0;
+ COERCION_IMPLICIT = 1;
+ COERCION_ASSIGNMENT = 2;
+ COERCION_PLPGSQL = 3;
+ COERCION_EXPLICIT = 4;
+}
+
+enum CoercionForm
+{
+ COERCION_FORM_UNDEFINED = 0;
+ COERCE_EXPLICIT_CALL = 1;
+ COERCE_EXPLICIT_CAST = 2;
+ COERCE_IMPLICIT_CAST = 3;
+ COERCE_SQL_SYNTAX = 4;
+}
+
+enum BoolExprType
+{
+ BOOL_EXPR_TYPE_UNDEFINED = 0;
+ AND_EXPR = 1;
+ OR_EXPR = 2;
+ NOT_EXPR = 3;
+}
+
+enum SubLinkType
+{
+ SUB_LINK_TYPE_UNDEFINED = 0;
+ EXISTS_SUBLINK = 1;
+ ALL_SUBLINK = 2;
+ ANY_SUBLINK = 3;
+ ROWCOMPARE_SUBLINK = 4;
+ EXPR_SUBLINK = 5;
+ MULTIEXPR_SUBLINK = 6;
+ ARRAY_SUBLINK = 7;
+ CTE_SUBLINK = 8;
+}
+
+enum RowCompareType
+{
+ ROW_COMPARE_TYPE_UNDEFINED = 0;
+ ROWCOMPARE_LT = 1;
+ ROWCOMPARE_LE = 2;
+ ROWCOMPARE_EQ = 3;
+ ROWCOMPARE_GE = 4;
+ ROWCOMPARE_GT = 5;
+ ROWCOMPARE_NE = 6;
+}
+
+enum MinMaxOp
+{
+ MIN_MAX_OP_UNDEFINED = 0;
+ IS_GREATEST = 1;
+ IS_LEAST = 2;
+}
+
+enum SQLValueFunctionOp
+{
+ SQLVALUE_FUNCTION_OP_UNDEFINED = 0;
+ SVFOP_CURRENT_DATE = 1;
+ SVFOP_CURRENT_TIME = 2;
+ SVFOP_CURRENT_TIME_N = 3;
+ SVFOP_CURRENT_TIMESTAMP = 4;
+ SVFOP_CURRENT_TIMESTAMP_N = 5;
+ SVFOP_LOCALTIME = 6;
+ SVFOP_LOCALTIME_N = 7;
+ SVFOP_LOCALTIMESTAMP = 8;
+ SVFOP_LOCALTIMESTAMP_N = 9;
+ SVFOP_CURRENT_ROLE = 10;
+ SVFOP_CURRENT_USER = 11;
+ SVFOP_USER = 12;
+ SVFOP_SESSION_USER = 13;
+ SVFOP_CURRENT_CATALOG = 14;
+ SVFOP_CURRENT_SCHEMA = 15;
+}
+
+enum XmlExprOp
+{
+ XML_EXPR_OP_UNDEFINED = 0;
+ IS_XMLCONCAT = 1;
+ IS_XMLELEMENT = 2;
+ IS_XMLFOREST = 3;
+ IS_XMLPARSE = 4;
+ IS_XMLPI = 5;
+ IS_XMLROOT = 6;
+ IS_XMLSERIALIZE = 7;
+ IS_DOCUMENT = 8;
+}
+
+enum XmlOptionType
+{
+ XML_OPTION_TYPE_UNDEFINED = 0;
+ XMLOPTION_DOCUMENT = 1;
+ XMLOPTION_CONTENT = 2;
+}
+
+enum JsonEncoding
+{
+ JSON_ENCODING_UNDEFINED = 0;
+ JS_ENC_DEFAULT = 1;
+ JS_ENC_UTF8 = 2;
+ JS_ENC_UTF16 = 3;
+ JS_ENC_UTF32 = 4;
+}
+
+enum JsonFormatType
+{
+ JSON_FORMAT_TYPE_UNDEFINED = 0;
+ JS_FORMAT_DEFAULT = 1;
+ JS_FORMAT_JSON = 2;
+ JS_FORMAT_JSONB = 3;
+}
+
+enum JsonConstructorType
+{
+ JSON_CONSTRUCTOR_TYPE_UNDEFINED = 0;
+ JSCTOR_JSON_OBJECT = 1;
+ JSCTOR_JSON_ARRAY = 2;
+ JSCTOR_JSON_OBJECTAGG = 3;
+ JSCTOR_JSON_ARRAYAGG = 4;
+ JSCTOR_JSON_PARSE = 5;
+ JSCTOR_JSON_SCALAR = 6;
+ JSCTOR_JSON_SERIALIZE = 7;
+}
+
+enum JsonValueType
+{
+ JSON_VALUE_TYPE_UNDEFINED = 0;
+ JS_TYPE_ANY = 1;
+ JS_TYPE_OBJECT = 2;
+ JS_TYPE_ARRAY = 3;
+ JS_TYPE_SCALAR = 4;
+}
+
+enum JsonWrapper
+{
+ JSON_WRAPPER_UNDEFINED = 0;
+ JSW_UNSPEC = 1;
+ JSW_NONE = 2;
+ JSW_CONDITIONAL = 3;
+ JSW_UNCONDITIONAL = 4;
+}
+
+enum JsonBehaviorType
+{
+ JSON_BEHAVIOR_TYPE_UNDEFINED = 0;
+ JSON_BEHAVIOR_NULL = 1;
+ JSON_BEHAVIOR_ERROR = 2;
+ JSON_BEHAVIOR_EMPTY = 3;
+ JSON_BEHAVIOR_TRUE = 4;
+ JSON_BEHAVIOR_FALSE = 5;
+ JSON_BEHAVIOR_UNKNOWN = 6;
+ JSON_BEHAVIOR_EMPTY_ARRAY = 7;
+ JSON_BEHAVIOR_EMPTY_OBJECT = 8;
+ JSON_BEHAVIOR_DEFAULT = 9;
+}
+
+enum JsonExprOp
+{
+ JSON_EXPR_OP_UNDEFINED = 0;
+ JSON_EXISTS_OP = 1;
+ JSON_QUERY_OP = 2;
+ JSON_VALUE_OP = 3;
+ JSON_TABLE_OP = 4;
+}
+
+enum NullTestType
+{
+ NULL_TEST_TYPE_UNDEFINED = 0;
+ IS_NULL = 1;
+ IS_NOT_NULL = 2;
+}
+
+enum BoolTestType
+{
+ BOOL_TEST_TYPE_UNDEFINED = 0;
+ IS_TRUE = 1;
+ IS_NOT_TRUE = 2;
+ IS_FALSE = 3;
+ IS_NOT_FALSE = 4;
+ IS_UNKNOWN = 5;
+ IS_NOT_UNKNOWN = 6;
+}
+
+enum MergeMatchKind
+{
+ MERGE_MATCH_KIND_UNDEFINED = 0;
+ MERGE_WHEN_MATCHED = 1;
+ MERGE_WHEN_NOT_MATCHED_BY_SOURCE = 2;
+ MERGE_WHEN_NOT_MATCHED_BY_TARGET = 3;
+}
+
+enum CmdType
+{
+ CMD_TYPE_UNDEFINED = 0;
+ CMD_UNKNOWN = 1;
+ CMD_SELECT = 2;
+ CMD_UPDATE = 3;
+ CMD_INSERT = 4;
+ CMD_DELETE = 5;
+ CMD_MERGE = 6;
+ CMD_UTILITY = 7;
+ CMD_NOTHING = 8;
+}
+
+enum JoinType
+{
+ JOIN_TYPE_UNDEFINED = 0;
+ JOIN_INNER = 1;
+ JOIN_LEFT = 2;
+ JOIN_FULL = 3;
+ JOIN_RIGHT = 4;
+ JOIN_SEMI = 5;
+ JOIN_ANTI = 6;
+ JOIN_RIGHT_ANTI = 7;
+ JOIN_UNIQUE_OUTER = 8;
+ JOIN_UNIQUE_INNER = 9;
+}
+
+enum AggStrategy
+{
+ AGG_STRATEGY_UNDEFINED = 0;
+ AGG_PLAIN = 1;
+ AGG_SORTED = 2;
+ AGG_HASHED = 3;
+ AGG_MIXED = 4;
+}
+
+enum AggSplit
+{
+ AGG_SPLIT_UNDEFINED = 0;
+ AGGSPLIT_SIMPLE = 1;
+ AGGSPLIT_INITIAL_SERIAL = 2;
+ AGGSPLIT_FINAL_DESERIAL = 3;
+}
+
+enum SetOpCmd
+{
+ SET_OP_CMD_UNDEFINED = 0;
+ SETOPCMD_INTERSECT = 1;
+ SETOPCMD_INTERSECT_ALL = 2;
+ SETOPCMD_EXCEPT = 3;
+ SETOPCMD_EXCEPT_ALL = 4;
+}
+
+enum SetOpStrategy
+{
+ SET_OP_STRATEGY_UNDEFINED = 0;
+ SETOP_SORTED = 1;
+ SETOP_HASHED = 2;
+}
+
+enum OnConflictAction
+{
+ ON_CONFLICT_ACTION_UNDEFINED = 0;
+ ONCONFLICT_NONE = 1;
+ ONCONFLICT_NOTHING = 2;
+ ONCONFLICT_UPDATE = 3;
+}
+
+enum LimitOption
+{
+ LIMIT_OPTION_UNDEFINED = 0;
+ LIMIT_OPTION_DEFAULT = 1;
+ LIMIT_OPTION_COUNT = 2;
+ LIMIT_OPTION_WITH_TIES = 3;
+}
+
+enum LockClauseStrength
+{
+ LOCK_CLAUSE_STRENGTH_UNDEFINED = 0;
+ LCS_NONE = 1;
+ LCS_FORKEYSHARE = 2;
+ LCS_FORSHARE = 3;
+ LCS_FORNOKEYUPDATE = 4;
+ LCS_FORUPDATE = 5;
+}
+
+enum LockWaitPolicy
+{
+ LOCK_WAIT_POLICY_UNDEFINED = 0;
+ LockWaitBlock = 1;
+ LockWaitSkip = 2;
+ LockWaitError = 3;
+}
+
+enum LockTupleMode
+{
+ LOCK_TUPLE_MODE_UNDEFINED = 0;
+ LockTupleKeyShare = 1;
+ LockTupleShare = 2;
+ LockTupleNoKeyExclusive = 3;
+ LockTupleExclusive = 4;
+}
+
+message ScanToken {
+ int32 start = 1;
+ int32 end = 2;
+ Token token = 4;
+ KeywordKind keyword_kind = 5;
+}
+
+enum KeywordKind {
+ NO_KEYWORD = 0;
+ UNRESERVED_KEYWORD = 1;
+ COL_NAME_KEYWORD = 2;
+ TYPE_FUNC_NAME_KEYWORD = 3;
+ RESERVED_KEYWORD = 4;
+}
+
+enum Token {
+ NUL = 0;
+ // Single-character tokens that are returned 1:1 (identical with "self" list in scan.l)
+ // Either supporting syntax, or single-character operators (some can be both)
+ // Also see https://www.postgresql.org/docs/12/sql-syntax-lexical.html#SQL-SYNTAX-SPECIAL-CHARS
+ ASCII_36 = 36; // "$"
+ ASCII_37 = 37; // "%"
+ ASCII_40 = 40; // "("
+ ASCII_41 = 41; // ")"
+ ASCII_42 = 42; // "*"
+ ASCII_43 = 43; // "+"
+ ASCII_44 = 44; // ","
+ ASCII_45 = 45; // "-"
+ ASCII_46 = 46; // "."
+ ASCII_47 = 47; // "/"
+ ASCII_58 = 58; // ":"
+ ASCII_59 = 59; // ";"
+ ASCII_60 = 60; // "<"
+ ASCII_61 = 61; // "="
+ ASCII_62 = 62; // ">"
+ ASCII_63 = 63; // "?"
+ ASCII_91 = 91; // "["
+ ASCII_92 = 92; // "\"
+ ASCII_93 = 93; // "]"
+ ASCII_94 = 94; // "^"
+ // Named tokens in scan.l
+ IDENT = 258;
+ UIDENT = 259;
+ FCONST = 260;
+ SCONST = 261;
+ USCONST = 262;
+ BCONST = 263;
+ XCONST = 264;
+ Op = 265;
+ ICONST = 266;
+ PARAM = 267;
+ TYPECAST = 268;
+ DOT_DOT = 269;
+ COLON_EQUALS = 270;
+ EQUALS_GREATER = 271;
+ LESS_EQUALS = 272;
+ GREATER_EQUALS = 273;
+ NOT_EQUALS = 274;
+ SQL_COMMENT = 275;
+ C_COMMENT = 276;
+ ABORT_P = 277;
+ ABSENT = 278;
+ ABSOLUTE_P = 279;
+ ACCESS = 280;
+ ACTION = 281;
+ ADD_P = 282;
+ ADMIN = 283;
+ AFTER = 284;
+ AGGREGATE = 285;
+ ALL = 286;
+ ALSO = 287;
+ ALTER = 288;
+ ALWAYS = 289;
+ ANALYSE = 290;
+ ANALYZE = 291;
+ AND = 292;
+ ANY = 293;
+ ARRAY = 294;
+ AS = 295;
+ ASC = 296;
+ ASENSITIVE = 297;
+ ASSERTION = 298;
+ ASSIGNMENT = 299;
+ ASYMMETRIC = 300;
+ ATOMIC = 301;
+ AT = 302;
+ ATTACH = 303;
+ ATTRIBUTE = 304;
+ AUTHORIZATION = 305;
+ BACKWARD = 306;
+ BEFORE = 307;
+ BEGIN_P = 308;
+ BETWEEN = 309;
+ BIGINT = 310;
+ BINARY = 311;
+ BIT = 312;
+ BOOLEAN_P = 313;
+ BOTH = 314;
+ BREADTH = 315;
+ BY = 316;
+ CACHE = 317;
+ CALL = 318;
+ CALLED = 319;
+ CASCADE = 320;
+ CASCADED = 321;
+ CASE = 322;
+ CAST = 323;
+ CATALOG_P = 324;
+ CHAIN = 325;
+ CHAR_P = 326;
+ CHARACTER = 327;
+ CHARACTERISTICS = 328;
+ CHECK = 329;
+ CHECKPOINT = 330;
+ CLASS = 331;
+ CLOSE = 332;
+ CLUSTER = 333;
+ COALESCE = 334;
+ COLLATE = 335;
+ COLLATION = 336;
+ COLUMN = 337;
+ COLUMNS = 338;
+ COMMENT = 339;
+ COMMENTS = 340;
+ COMMIT = 341;
+ COMMITTED = 342;
+ COMPRESSION = 343;
+ CONCURRENTLY = 344;
+ CONDITIONAL = 345;
+ CONFIGURATION = 346;
+ CONFLICT = 347;
+ CONNECTION = 348;
+ CONSTRAINT = 349;
+ CONSTRAINTS = 350;
+ CONTENT_P = 351;
+ CONTINUE_P = 352;
+ CONVERSION_P = 353;
+ COPY = 354;
+ COST = 355;
+ CREATE = 356;
+ CROSS = 357;
+ CSV = 358;
+ CUBE = 359;
+ CURRENT_P = 360;
+ CURRENT_CATALOG = 361;
+ CURRENT_DATE = 362;
+ CURRENT_ROLE = 363;
+ CURRENT_SCHEMA = 364;
+ CURRENT_TIME = 365;
+ CURRENT_TIMESTAMP = 366;
+ CURRENT_USER = 367;
+ CURSOR = 368;
+ CYCLE = 369;
+ DATA_P = 370;
+ DATABASE = 371;
+ DAY_P = 372;
+ DEALLOCATE = 373;
+ DEC = 374;
+ DECIMAL_P = 375;
+ DECLARE = 376;
+ DEFAULT = 377;
+ DEFAULTS = 378;
+ DEFERRABLE = 379;
+ DEFERRED = 380;
+ DEFINER = 381;
+ DELETE_P = 382;
+ DELIMITER = 383;
+ DELIMITERS = 384;
+ DEPENDS = 385;
+ DEPTH = 386;
+ DESC = 387;
+ DETACH = 388;
+ DICTIONARY = 389;
+ DISABLE_P = 390;
+ DISCARD = 391;
+ DISTINCT = 392;
+ DO = 393;
+ DOCUMENT_P = 394;
+ DOMAIN_P = 395;
+ DOUBLE_P = 396;
+ DROP = 397;
+ EACH = 398;
+ ELSE = 399;
+ EMPTY_P = 400;
+ ENABLE_P = 401;
+ ENCODING = 402;
+ ENCRYPTED = 403;
+ END_P = 404;
+ ENUM_P = 405;
+ ERROR_P = 406;
+ ESCAPE = 407;
+ EVENT = 408;
+ EXCEPT = 409;
+ EXCLUDE = 410;
+ EXCLUDING = 411;
+ EXCLUSIVE = 412;
+ EXECUTE = 413;
+ EXISTS = 414;
+ EXPLAIN = 415;
+ EXPRESSION = 416;
+ EXTENSION = 417;
+ EXTERNAL = 418;
+ EXTRACT = 419;
+ FALSE_P = 420;
+ FAMILY = 421;
+ FETCH = 422;
+ FILTER = 423;
+ FINALIZE = 424;
+ FIRST_P = 425;
+ FLOAT_P = 426;
+ FOLLOWING = 427;
+ FOR = 428;
+ FORCE = 429;
+ FOREIGN = 430;
+ FORMAT = 431;
+ FORWARD = 432;
+ FREEZE = 433;
+ FROM = 434;
+ FULL = 435;
+ FUNCTION = 436;
+ FUNCTIONS = 437;
+ GENERATED = 438;
+ GLOBAL = 439;
+ GRANT = 440;
+ GRANTED = 441;
+ GREATEST = 442;
+ GROUP_P = 443;
+ GROUPING = 444;
+ GROUPS = 445;
+ HANDLER = 446;
+ HAVING = 447;
+ HEADER_P = 448;
+ HOLD = 449;
+ HOUR_P = 450;
+ IDENTITY_P = 451;
+ IF_P = 452;
+ ILIKE = 453;
+ IMMEDIATE = 454;
+ IMMUTABLE = 455;
+ IMPLICIT_P = 456;
+ IMPORT_P = 457;
+ IN_P = 458;
+ INCLUDE = 459;
+ INCLUDING = 460;
+ INCREMENT = 461;
+ INDENT = 462;
+ INDEX = 463;
+ INDEXES = 464;
+ INHERIT = 465;
+ INHERITS = 466;
+ INITIALLY = 467;
+ INLINE_P = 468;
+ INNER_P = 469;
+ INOUT = 470;
+ INPUT_P = 471;
+ INSENSITIVE = 472;
+ INSERT = 473;
+ INSTEAD = 474;
+ INT_P = 475;
+ INTEGER = 476;
+ INTERSECT = 477;
+ INTERVAL = 478;
+ INTO = 479;
+ INVOKER = 480;
+ IS = 481;
+ ISNULL = 482;
+ ISOLATION = 483;
+ JOIN = 484;
+ JSON = 485;
+ JSON_ARRAY = 486;
+ JSON_ARRAYAGG = 487;
+ JSON_EXISTS = 488;
+ JSON_OBJECT = 489;
+ JSON_OBJECTAGG = 490;
+ JSON_QUERY = 491;
+ JSON_SCALAR = 492;
+ JSON_SERIALIZE = 493;
+ JSON_TABLE = 494;
+ JSON_VALUE = 495;
+ KEEP = 496;
+ KEY = 497;
+ KEYS = 498;
+ LABEL = 499;
+ LANGUAGE = 500;
+ LARGE_P = 501;
+ LAST_P = 502;
+ LATERAL_P = 503;
+ LEADING = 504;
+ LEAKPROOF = 505;
+ LEAST = 506;
+ LEFT = 507;
+ LEVEL = 508;
+ LIKE = 509;
+ LIMIT = 510;
+ LISTEN = 511;
+ LOAD = 512;
+ LOCAL = 513;
+ LOCALTIME = 514;
+ LOCALTIMESTAMP = 515;
+ LOCATION = 516;
+ LOCK_P = 517;
+ LOCKED = 518;
+ LOGGED = 519;
+ MAPPING = 520;
+ MATCH = 521;
+ MATCHED = 522;
+ MATERIALIZED = 523;
+ MAXVALUE = 524;
+ MERGE = 525;
+ MERGE_ACTION = 526;
+ METHOD = 527;
+ MINUTE_P = 528;
+ MINVALUE = 529;
+ MODE = 530;
+ MONTH_P = 531;
+ MOVE = 532;
+ NAME_P = 533;
+ NAMES = 534;
+ NATIONAL = 535;
+ NATURAL = 536;
+ NCHAR = 537;
+ NESTED = 538;
+ NEW = 539;
+ NEXT = 540;
+ NFC = 541;
+ NFD = 542;
+ NFKC = 543;
+ NFKD = 544;
+ NO = 545;
+ NONE = 546;
+ NORMALIZE = 547;
+ NORMALIZED = 548;
+ NOT = 549;
+ NOTHING = 550;
+ NOTIFY = 551;
+ NOTNULL = 552;
+ NOWAIT = 553;
+ NULL_P = 554;
+ NULLIF = 555;
+ NULLS_P = 556;
+ NUMERIC = 557;
+ OBJECT_P = 558;
+ OF = 559;
+ OFF = 560;
+ OFFSET = 561;
+ OIDS = 562;
+ OLD = 563;
+ OMIT = 564;
+ ON = 565;
+ ONLY = 566;
+ OPERATOR = 567;
+ OPTION = 568;
+ OPTIONS = 569;
+ OR = 570;
+ ORDER = 571;
+ ORDINALITY = 572;
+ OTHERS = 573;
+ OUT_P = 574;
+ OUTER_P = 575;
+ OVER = 576;
+ OVERLAPS = 577;
+ OVERLAY = 578;
+ OVERRIDING = 579;
+ OWNED = 580;
+ OWNER = 581;
+ PARALLEL = 582;
+ PARAMETER = 583;
+ PARSER = 584;
+ PARTIAL = 585;
+ PARTITION = 586;
+ PASSING = 587;
+ PASSWORD = 588;
+ PATH = 589;
+ PLACING = 590;
+ PLAN = 591;
+ PLANS = 592;
+ POLICY = 593;
+ POSITION = 594;
+ PRECEDING = 595;
+ PRECISION = 596;
+ PRESERVE = 597;
+ PREPARE = 598;
+ PREPARED = 599;
+ PRIMARY = 600;
+ PRIOR = 601;
+ PRIVILEGES = 602;
+ PROCEDURAL = 603;
+ PROCEDURE = 604;
+ PROCEDURES = 605;
+ PROGRAM = 606;
+ PUBLICATION = 607;
+ QUOTE = 608;
+ QUOTES = 609;
+ RANGE = 610;
+ READ = 611;
+ REAL = 612;
+ REASSIGN = 613;
+ RECHECK = 614;
+ RECURSIVE = 615;
+ REF_P = 616;
+ REFERENCES = 617;
+ REFERENCING = 618;
+ REFRESH = 619;
+ REINDEX = 620;
+ RELATIVE_P = 621;
+ RELEASE = 622;
+ RENAME = 623;
+ REPEATABLE = 624;
+ REPLACE = 625;
+ REPLICA = 626;
+ RESET = 627;
+ RESTART = 628;
+ RESTRICT = 629;
+ RETURN = 630;
+ RETURNING = 631;
+ RETURNS = 632;
+ REVOKE = 633;
+ RIGHT = 634;
+ ROLE = 635;
+ ROLLBACK = 636;
+ ROLLUP = 637;
+ ROUTINE = 638;
+ ROUTINES = 639;
+ ROW = 640;
+ ROWS = 641;
+ RULE = 642;
+ SAVEPOINT = 643;
+ SCALAR = 644;
+ SCHEMA = 645;
+ SCHEMAS = 646;
+ SCROLL = 647;
+ SEARCH = 648;
+ SECOND_P = 649;
+ SECURITY = 650;
+ SELECT = 651;
+ SEQUENCE = 652;
+ SEQUENCES = 653;
+ SERIALIZABLE = 654;
+ SERVER = 655;
+ SESSION = 656;
+ SESSION_USER = 657;
+ SET = 658;
+ SETS = 659;
+ SETOF = 660;
+ SHARE = 661;
+ SHOW = 662;
+ SIMILAR = 663;
+ SIMPLE = 664;
+ SKIP = 665;
+ SMALLINT = 666;
+ SNAPSHOT = 667;
+ SOME = 668;
+ SOURCE = 669;
+ SQL_P = 670;
+ STABLE = 671;
+ STANDALONE_P = 672;
+ START = 673;
+ STATEMENT = 674;
+ STATISTICS = 675;
+ STDIN = 676;
+ STDOUT = 677;
+ STORAGE = 678;
+ STORED = 679;
+ STRICT_P = 680;
+ STRING_P = 681;
+ STRIP_P = 682;
+ SUBSCRIPTION = 683;
+ SUBSTRING = 684;
+ SUPPORT = 685;
+ SYMMETRIC = 686;
+ SYSID = 687;
+ SYSTEM_P = 688;
+ SYSTEM_USER = 689;
+ TABLE = 690;
+ TABLES = 691;
+ TABLESAMPLE = 692;
+ TABLESPACE = 693;
+ TARGET = 694;
+ TEMP = 695;
+ TEMPLATE = 696;
+ TEMPORARY = 697;
+ TEXT_P = 698;
+ THEN = 699;
+ TIES = 700;
+ TIME = 701;
+ TIMESTAMP = 702;
+ TO = 703;
+ TRAILING = 704;
+ TRANSACTION = 705;
+ TRANSFORM = 706;
+ TREAT = 707;
+ TRIGGER = 708;
+ TRIM = 709;
+ TRUE_P = 710;
+ TRUNCATE = 711;
+ TRUSTED = 712;
+ TYPE_P = 713;
+ TYPES_P = 714;
+ UESCAPE = 715;
+ UNBOUNDED = 716;
+ UNCONDITIONAL = 717;
+ UNCOMMITTED = 718;
+ UNENCRYPTED = 719;
+ UNION = 720;
+ UNIQUE = 721;
+ UNKNOWN = 722;
+ UNLISTEN = 723;
+ UNLOGGED = 724;
+ UNTIL = 725;
+ UPDATE = 726;
+ USER = 727;
+ USING = 728;
+ VACUUM = 729;
+ VALID = 730;
+ VALIDATE = 731;
+ VALIDATOR = 732;
+ VALUE_P = 733;
+ VALUES = 734;
+ VARCHAR = 735;
+ VARIADIC = 736;
+ VARYING = 737;
+ VERBOSE = 738;
+ VERSION_P = 739;
+ VIEW = 740;
+ VIEWS = 741;
+ VOLATILE = 742;
+ WHEN = 743;
+ WHERE = 744;
+ WHITESPACE_P = 745;
+ WINDOW = 746;
+ WITH = 747;
+ WITHIN = 748;
+ WITHOUT = 749;
+ WORK = 750;
+ WRAPPER = 751;
+ WRITE = 752;
+ XML_P = 753;
+ XMLATTRIBUTES = 754;
+ XMLCONCAT = 755;
+ XMLELEMENT = 756;
+ XMLEXISTS = 757;
+ XMLFOREST = 758;
+ XMLNAMESPACES = 759;
+ XMLPARSE = 760;
+ XMLPI = 761;
+ XMLROOT = 762;
+ XMLSERIALIZE = 763;
+ XMLTABLE = 764;
+ YEAR_P = 765;
+ YES_P = 766;
+ ZONE = 767;
+ FORMAT_LA = 768;
+ NOT_LA = 769;
+ NULLS_LA = 770;
+ WITH_LA = 771;
+ WITHOUT_LA = 772;
+ MODE_TYPE_NAME = 773;
+ MODE_PLPGSQL_EXPR = 774;
+ MODE_PLPGSQL_ASSIGN1 = 775;
+ MODE_PLPGSQL_ASSIGN2 = 776;
+ MODE_PLPGSQL_ASSIGN3 = 777;
+ UMINUS = 778;
+}
diff --git a/scripts/analyze-sizes.js b/scripts/analyze-sizes.js
new file mode 100644
index 00000000..4d381c2e
--- /dev/null
+++ b/scripts/analyze-sizes.js
@@ -0,0 +1,192 @@
+const fs = require('fs');
+const path = require('path');
+const { execSync } = require('child_process');
+
+// Helper to format bytes to human readable
+function formatBytes(bytes, decimals = 2) {
+ if (bytes === 0) return '0 Bytes';
+ const k = 1024;
+ const dm = decimals < 0 ? 0 : decimals;
+ const sizes = ['Bytes', 'KB', 'MB', 'GB'];
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
+}
+
+// Helper to get file size
+function getFileSize(filePath) {
+ try {
+ const stats = fs.statSync(filePath);
+ return stats.size;
+ } catch (e) {
+ return 0;
+ }
+}
+
+// Helper to get gzipped size
+function getGzippedSize(filePath) {
+ try {
+ const result = execSync(`gzip -c "${filePath}" | wc -c`).toString().trim();
+ return parseInt(result);
+ } catch (e) {
+ return 0;
+ }
+}
+
+// Analyze a package
+function analyzePackage(packagePath, packageName) {
+ const wasmPath = path.join(packagePath, 'wasm');
+ const files = {
+ 'WASM Binary': 'libpg-query.wasm',
+ 'WASM Loader': 'libpg-query.js',
+ 'ES Module': 'index.js',
+ 'CommonJS': 'index.cjs'
+ };
+
+ const results = {
+ name: packageName,
+ files: {}
+ };
+
+ let totalSize = 0;
+ let totalGzipped = 0;
+
+ for (const [label, filename] of Object.entries(files)) {
+ const filePath = path.join(wasmPath, filename);
+ const size = getFileSize(filePath);
+ const gzipped = getGzippedSize(filePath);
+
+ results.files[label] = {
+ size,
+ gzipped,
+ exists: size > 0
+ };
+
+ totalSize += size;
+ totalGzipped += gzipped;
+ }
+
+ results.totalSize = totalSize;
+ results.totalGzipped = totalGzipped;
+
+ return results;
+}
+
+// Get all version packages dynamically
+function getVersionPackages() {
+ const versionsDir = './versions';
+ const packages = [
+ { path: './libpg-query', name: 'libpg-query (Original)', version: 'original' }
+ ];
+
+ if (fs.existsSync(versionsDir)) {
+ const versions = fs.readdirSync(versionsDir)
+ .filter(dir => fs.statSync(path.join(versionsDir, dir)).isDirectory())
+ .sort((a, b) => parseInt(b) - parseInt(a)); // Sort versions descending
+
+ versions.forEach(version => {
+ const packageJsonPath = path.join(versionsDir, version, 'package.json');
+ if (fs.existsSync(packageJsonPath)) {
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
+ packages.push({
+ path: path.join(versionsDir, version),
+ name: packageJson.name || `v${version}`,
+ version: version
+ });
+ }
+ });
+ }
+
+ return packages;
+}
+
+// Main analysis
+function analyze() {
+ const packages = getVersionPackages();
+ const results = packages.map(pkg => analyzePackage(pkg.path, pkg.name));
+
+ // Generate markdown report
+ let markdown = `# Build Size Analysis Report
+
+Generated on: ${new Date().toISOString()}
+
+## Summary
+
+| Package | Total Size | Total Gzipped | Reduction |
+|---------|------------|---------------|-----------|
+`;
+
+ const original = results.find(r => r.name.includes('Original'));
+
+ results.forEach(result => {
+ const reduction = original && result !== original
+ ? `${((1 - result.totalSize / original.totalSize) * 100).toFixed(1)}%`
+ : 'Baseline';
+
+ markdown += `| ${result.name} | ${formatBytes(result.totalSize)} | ${formatBytes(result.totalGzipped)} | ${reduction} |\n`;
+ });
+
+ markdown += `\n## Detailed Breakdown\n\n`;
+
+ results.forEach(result => {
+ markdown += `### ${result.name}\n\n`;
+ markdown += `| File | Size | Gzipped | Gzip Ratio |\n`;
+ markdown += `|------|------|---------|------------|\n`;
+
+ for (const [label, data] of Object.entries(result.files)) {
+ if (data.exists) {
+ const ratio = ((1 - data.gzipped / data.size) * 100).toFixed(1);
+ markdown += `| ${label} | ${formatBytes(data.size)} | ${formatBytes(data.gzipped)} | ${ratio}% |\n`;
+ }
+ }
+
+ markdown += `\n`;
+ });
+
+ // Add comparison section
+ if (results.length > 1) {
+ markdown += `## Size Comparison\n\n`;
+ markdown += `### WASM Binary Comparison\n\n`;
+ markdown += `| Package | WASM Size | Difference |\n`;
+ markdown += `|---------|-----------|------------|\n`;
+
+ const originalWasm = original?.files['WASM Binary']?.size || 0;
+
+ results.forEach(result => {
+ const wasmSize = result.files['WASM Binary']?.size || 0;
+ const diff = result === original
+ ? 'Baseline'
+ : `${((wasmSize - originalWasm) / 1024).toFixed(1)} KB (${((wasmSize / originalWasm - 1) * 100).toFixed(1)}%)`;
+
+ markdown += `| ${result.name} | ${formatBytes(wasmSize)} | ${diff} |\n`;
+ });
+
+ markdown += `\n### JavaScript Bundle Comparison\n\n`;
+ markdown += `| Package | ES Module | CommonJS | Combined |\n`;
+ markdown += `|---------|-----------|----------|----------|\n`;
+
+ results.forEach(result => {
+ const esSize = result.files['ES Module']?.size || 0;
+ const cjsSize = result.files['CommonJS']?.size || 0;
+ const combined = esSize + cjsSize;
+
+ markdown += `| ${result.name} | ${formatBytes(esSize)} | ${formatBytes(cjsSize)} | ${formatBytes(combined)} |\n`;
+ });
+ }
+
+ markdown += `\n## Notes\n\n`;
+ markdown += `- Gzipped sizes represent the approximate size when served with compression\n`;
+ markdown += `- The WASM binary is the largest component and is shared across all API methods\n`;
+ markdown += `- JavaScript wrapper size varies based on the number of exported functions\n`;
+ markdown += `- @libpg-query/v17 only exports parse/parseSync, reducing JavaScript bundle size\n`;
+
+ return markdown;
+}
+
+// Run analysis and save report
+const report = analyze();
+const reportPath = path.join(__dirname, '..', 'BUILD_SIZE_REPORT.md');
+fs.writeFileSync(reportPath, report);
+console.log(`Build size report generated: ${reportPath}`);
+
+// Also output to console
+console.log('\n' + report);
\ No newline at end of file
diff --git a/scripts/build-types.js b/scripts/build-types.js
new file mode 100644
index 00000000..3583feee
--- /dev/null
+++ b/scripts/build-types.js
@@ -0,0 +1,96 @@
+#!/usr/bin/env node
+
+const { execSync } = require('child_process');
+const fs = require('fs');
+const path = require('path');
+
+// Get all types directories
+function getTypesDirectories() {
+ const typesDir = path.join(__dirname, '..', 'types');
+ if (!fs.existsSync(typesDir)) {
+ console.log('No types directory found');
+ return [];
+ }
+
+ return fs.readdirSync(typesDir)
+ .filter(dir => {
+ const fullPath = path.join(typesDir, dir);
+ return fs.statSync(fullPath).isDirectory();
+ })
+ .sort();
+}
+
+// Build a single types package
+function buildTypesPackage(version) {
+ const packagePath = path.join(__dirname, '..', 'types', version);
+ const packageJsonPath = path.join(packagePath, 'package.json');
+
+ if (!fs.existsSync(packageJsonPath)) {
+ console.log(`β οΈ Skipping types/${version} - no package.json found`);
+ return false;
+ }
+
+ console.log(`π¨ Building types/${version}...`);
+
+ try {
+ // First run build:proto to generate types from protobuf
+ console.log(` π Running build:proto for types/${version}...`);
+ execSync('pnpm run build:proto', {
+ cwd: packagePath,
+ stdio: 'inherit'
+ });
+
+ // Then run the main build command
+ console.log(` ποΈ Running build for types/${version}...`);
+ execSync('pnpm run build', {
+ cwd: packagePath,
+ stdio: 'inherit'
+ });
+
+ console.log(`β
Successfully built types/${version}\n`);
+ return true;
+ } catch (error) {
+ console.error(`β Failed to build types/${version}: ${error.message}\n`);
+ return false;
+ }
+}
+
+// Main function
+function buildAllTypes() {
+ const typesDirectories = getTypesDirectories();
+
+ if (typesDirectories.length === 0) {
+ console.log('No types packages found to build');
+ return;
+ }
+
+ console.log(`Found ${typesDirectories.length} types packages: ${typesDirectories.join(', ')}\n`);
+
+ let successful = 0;
+ let failed = 0;
+
+ for (const version of typesDirectories) {
+ if (buildTypesPackage(version)) {
+ successful++;
+ } else {
+ failed++;
+ }
+ }
+
+ console.log('='.repeat(50));
+ console.log(`Build Summary:`);
+ console.log(`β
Successful: ${successful}`);
+ console.log(`β Failed: ${failed}`);
+ console.log(`π¦ Total packages: ${typesDirectories.length}`);
+
+ if (failed > 0) {
+ process.exit(1);
+ }
+}
+
+// Run the script
+if (require.main === module) {
+ buildAllTypes();
+}
+
+module.exports = { buildAllTypes, buildTypesPackage, getTypesDirectories };
\ No newline at end of file
diff --git a/scripts/fetch-protos.js b/scripts/fetch-protos.js
new file mode 100644
index 00000000..caf3fb1b
--- /dev/null
+++ b/scripts/fetch-protos.js
@@ -0,0 +1,96 @@
+#!/usr/bin/env node
+
+const fs = require('fs');
+const path = require('path');
+const https = require('https');
+
+// Read all version packages and extract x-publish metadata
+function getVersionMappings() {
+ const versionsDir = path.join(__dirname, '..', 'versions');
+ const mappings = [];
+
+ for (const version of ['13', '14', '15', '16', '17']) {
+ const packagePath = path.join(versionsDir, version, 'package.json');
+ if (fs.existsSync(packagePath)) {
+ const pkg = JSON.parse(fs.readFileSync(packagePath, 'utf8'));
+ if (pkg['x-publish']) {
+ mappings.push({
+ pgVersion: pkg['x-publish'].pgVersion,
+ packageVersion: pkg.version,
+ distTag: pkg['x-publish'].distTag,
+ libpgQueryTag: pkg['x-publish'].libpgQueryTag
+ });
+ }
+ }
+ }
+
+ return mappings;
+}
+
+// Download file from URL
+function downloadFile(url, dest) {
+ return new Promise((resolve, reject) => {
+ const file = fs.createWriteStream(dest);
+ console.log('Downloading', url, 'to', dest);
+ https.get(url, (response) => {
+ if (response.statusCode === 200) {
+ response.pipe(file);
+ file.on('finish', () => {
+ file.close();
+ resolve();
+ });
+ } else {
+ reject(new Error(`HTTP ${response.statusCode}: ${response.statusMessage}`));
+ }
+ }).on('error', (err) => {
+ reject(err);
+ });
+ });
+}
+
+// Main function
+async function fetchProtos() {
+ const mappings = getVersionMappings();
+ const protosDir = path.join(__dirname, '..', 'protos');
+
+ // Create protos directory if it doesn't exist
+ if (!fs.existsSync(protosDir)) {
+ fs.mkdirSync(protosDir, { recursive: true });
+ }
+
+ console.log('Fetching protobuf files for all versions...\n');
+
+ for (const mapping of mappings) {
+ const { pgVersion, libpgQueryTag } = mapping;
+ const versionDir = path.join(protosDir, pgVersion);
+
+ // Create version directory
+ if (!fs.existsSync(versionDir)) {
+ fs.mkdirSync(versionDir, { recursive: true });
+ }
+
+ // Use the libpgQueryTag from the Makefile
+ const url = `https://raw.githubusercontent.com/pganalyze/libpg_query/refs/tags/${libpgQueryTag}/protobuf/pg_query.proto`;
+ const destPath = path.join(versionDir, 'pg_query.proto');
+
+ console.log(`Fetching protobuf for PostgreSQL ${pgVersion} with tag ${libpgQueryTag}...`);
+
+ try {
+ await downloadFile(url, destPath);
+ console.log(`β
Successfully downloaded protobuf for PostgreSQL ${pgVersion}`);
+ console.log(` Source: ${url}`);
+ console.log(` Saved to: ${destPath}\n`);
+ } catch (error) {
+ console.log(`β Failed to fetch protobuf for PostgreSQL ${pgVersion}: ${error.message}\n`);
+ }
+ }
+
+ console.log('Protobuf fetch completed!');
+}
+
+// Run the script
+if (require.main === module) {
+ fetchProtos().catch(console.error);
+}
+
+module.exports = { fetchProtos, getVersionMappings };
\ No newline at end of file
diff --git a/scripts/prepare-types.js b/scripts/prepare-types.js
new file mode 100644
index 00000000..156462b9
--- /dev/null
+++ b/scripts/prepare-types.js
@@ -0,0 +1,108 @@
+#!/usr/bin/env node
+
+const fs = require('fs');
+const path = require('path');
+
+/**
+ * Script to prepare types packages for publishing by modifying their dist/package.json
+ * to use the correct publishing name and dist-tag from x-publish metadata
+ */
+
+function preparePackageForPublish(packageDir) {
+ const packageJsonPath = path.join(packageDir, 'package.json');
+ const distPackageJsonPath = path.join(packageDir, 'dist', 'package.json');
+
+ if (!fs.existsSync(packageJsonPath)) {
+ console.error(`β Package.json not found: ${packageJsonPath}`);
+ return false;
+ }
+
+ if (!fs.existsSync(distPackageJsonPath)) {
+ console.error(`β Dist package.json not found: ${distPackageJsonPath}`);
+ return false;
+ }
+
+ try {
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
+ const distPackageJson = JSON.parse(fs.readFileSync(distPackageJsonPath, 'utf8'));
+
+ if (!packageJson['x-publish']) {
+ console.error(`β No x-publish metadata found in ${packageDir}`);
+ return false;
+ }
+
+ const { publishName, distTag } = packageJson['x-publish'];
+
+ if (!publishName) {
+ console.error(`β No publishName found in x-publish metadata for ${packageDir}`);
+ return false;
+ }
+
+ // Modify the dist package.json
+ distPackageJson.name = publishName;
+
+ // Add dist-tag to publishConfig if specified
+ if (distTag) {
+ if (!distPackageJson.publishConfig) {
+ distPackageJson.publishConfig = {};
+ }
+ distPackageJson.publishConfig.tag = distTag;
+ }
+
+ // Remove x-publish metadata from the dist version
+ delete distPackageJson['x-publish'];
+
+ // Write the modified package.json back to dist
+ fs.writeFileSync(distPackageJsonPath, JSON.stringify(distPackageJson, null, 2) + '\n');
+
+ console.log(`β
Prepared ${packageDir} for publishing as ${publishName}${distTag ? ` with tag ${distTag}` : ''}`);
+ return true;
+
+ } catch (error) {
+ console.error(`β Error preparing ${packageDir}: ${error.message}`);
+ return false;
+ }
+}
+
+function main() {
+ const typesDir = path.join(__dirname, '..', 'types');
+
+ if (!fs.existsSync(typesDir)) {
+ console.error('β Types directory not found');
+ process.exit(1);
+ }
+
+ const typesPackages = fs.readdirSync(typesDir)
+ .filter(dir => fs.statSync(path.join(typesDir, dir)).isDirectory())
+ .sort();
+
+ console.log(`π¦ Found ${typesPackages.length} types packages: ${typesPackages.join(', ')}\n`);
+
+ let successCount = 0;
+
+ for (const packageName of typesPackages) {
+ const packagePath = path.join(typesDir, packageName);
+ console.log(`π§ Preparing types/${packageName}...`);
+
+ if (preparePackageForPublish(packagePath)) {
+ successCount++;
+ }
+ console.log('');
+ }
+
+ console.log('==================================================');
+ console.log(`Prepare Summary:`);
+ console.log(`β
Successful: ${successCount}`);
+ console.log(`β Failed: ${typesPackages.length - successCount}`);
+ console.log(`π¦ Total packages: ${typesPackages.length}`);
+
+ if (successCount < typesPackages.length) {
+ process.exit(1);
+ }
+}
+
+if (require.main === module) {
+ main();
+}
+
+module.exports = { preparePackageForPublish };
\ No newline at end of file
diff --git a/scripts/publish-versions.js b/scripts/publish-versions.js
new file mode 100644
index 00000000..c1ad0aae
--- /dev/null
+++ b/scripts/publish-versions.js
@@ -0,0 +1,37 @@
+#!/usr/bin/env node
+
+const fs = require('fs');
+const path = require('path');
+const { execSync } = require('child_process');
+
+const pkgPath = path.join(process.cwd(), 'package.json');
+
+if (!fs.existsSync(pkgPath)) {
+ console.error('β No package.json found in current directory.');
+ process.exit(1);
+}
+
+const original = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
+const publishMeta = original['x-publish'] || {};
+
+const publishName = publishMeta.publishName || 'libpg-query';
+const distTag = process.env.TAG || publishMeta.distTag || 'latest';
+
+if (!original.name || !original.version) {
+ console.error('β package.json must include name and version');
+ process.exit(1);
+}
+
+const modified = { ...original, name: publishName };
+
+try {
+ console.log(`π¦ Publishing ${publishName}@${original.version} with tag '${distTag}'...`);
+ fs.writeFileSync(pkgPath, JSON.stringify(modified, null, 2));
+ execSync(`npm publish --tag ${distTag}`, { stdio: 'inherit' });
+ console.log('β
Publish complete.');
+} catch (err) {
+ console.error('β Publish failed:', err.message);
+} finally {
+ fs.writeFileSync(pkgPath, JSON.stringify(original, null, 2));
+ console.log('π Restored original package.json');
+}
diff --git a/tsconfig.json b/tsconfig.json
new file mode 100644
index 00000000..a4694981
--- /dev/null
+++ b/tsconfig.json
@@ -0,0 +1,27 @@
+{
+ "compilerOptions": {
+ "target": "ES2020",
+ "module": "commonjs",
+ "lib": ["ES2020"],
+ "declaration": true,
+ "outDir": "./dist",
+ "strict": true,
+ "noUnusedLocals": false,
+ "noUnusedParameters": false,
+ "noImplicitReturns": true,
+ "noFallthroughCasesInSwitch": true,
+ "moduleResolution": "node",
+ "baseUrl": ".",
+ "esModuleInterop": true,
+ "experimentalDecorators": true,
+ "emitDecoratorMetadata": true,
+ "skipLibCheck": true,
+ "forceConsistentCasingInFileNames": true
+ },
+ "exclude": [
+ "node_modules",
+ "dist",
+ "**/*.test.*",
+ "**/*.spec.*"
+ ]
+}
\ No newline at end of file
diff --git a/types/13/CHANGELOG.md b/types/13/CHANGELOG.md
new file mode 100644
index 00000000..a96e990c
--- /dev/null
+++ b/types/13/CHANGELOG.md
@@ -0,0 +1,40 @@
+# Change Log
+
+All notable changes to this project will be documented in this file.
+See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [17.4.2](https://github.com/launchql/pgsql-parser/compare/@pgsql/types@17.4.1...@pgsql/types@17.4.2) (2025-06-22)
+
+**Note:** Version bump only for package @pgsql/types
+
+
+
+
+
+## [17.4.1](https://github.com/launchql/pgsql-parser/compare/@pgsql/types@17.4.0...@pgsql/types@17.4.1) (2025-06-21)
+
+**Note:** Version bump only for package @pgsql/types
+
+
+
+
+
+# [17.4.0](https://github.com/launchql/pgsql-parser/compare/@pgsql/types@17.1.0...@pgsql/types@17.4.0) (2025-06-21)
+
+**Note:** Version bump only for package @pgsql/types
+
+
+
+
+
+# [17.2.0](https://github.com/launchql/pgsql-parser/compare/@pgsql/types@17.1.0...@pgsql/types@17.2.0) (2025-06-21)
+
+**Note:** Version bump only for package @pgsql/types
+
+
+
+
+
+# [17.1.0](https://github.com/launchql/pgsql-parser/compare/@pgsql/types@13.9.0...@pgsql/types@17.1.0) (2025-06-21)
+
+**Note:** Version bump only for package @pgsql/types
diff --git a/types/13/README.md b/types/13/README.md
new file mode 100644
index 00000000..81c50431
--- /dev/null
+++ b/types/13/README.md
@@ -0,0 +1,99 @@
+# @pgsql/types
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+`@pgsql/types` is a TypeScript library providing type definitions for PostgreSQL AST nodes, primarily used in conjunction with [`pgsql-parser`](https://github.com/launchql/pgsql-parser). It offers a comprehensive and type-safe way to interact with the AST nodes generated by PostgreSQL query parsing.
+
+
+## Installation
+
+Install the package via npm:
+
+```bash
+npm install @pgsql/types
+```
+
+## Usage
+
+`@pgsql/types` provides TypeScript type definitions for PostgreSQL Abstract Syntax Tree (AST) nodes. These types are useful for constructing, analyzing, or manipulating ASTs in a type-safe manner.
+
+Here are a few examples of how you can use these types in your TypeScript projects:
+
+### Validating AST Nodes
+
+You can use the types to validate AST nodes, ensuring they conform to the expected structure:
+
+```ts
+import { CreateStmt } from '@pgsql/types';
+
+function validateCreateStmt(stmt: CreateStmt) {
+ if (!stmt.relation || !stmt.tableElts) {
+ throw new Error('Invalid CreateStmt: missing required fields');
+ }
+ // Add more validation logic as needed
+ console.log('CreateStmt is valid');
+}
+
+// Example usage
+validateCreateStmt(createStmtObject);
+```
+
+### Constructing AST Nodes
+
+Types help ensure that you construct AST nodes correctly:
+
+```ts
+import { CreateStmt, ColumnDef, Constraint } from '@pgsql/types';
+
+const newColumn: ColumnDef = {
+ colname: 'id',
+ typeName: { names: [{ String: { str: 'int4' } }] },
+ constraints: [{ Constraint: { contype: 'CONSTR_PRIMARY' } }],
+};
+
+const createStmt: CreateStmt = {
+ relation: { relname: 'new_table' },
+ tableElts: [newColumn],
+};
+
+console.log(createStmt);
+```
+
+## Versions
+
+Our latest is built with PostgreSQL 17 AST types.
+
+| PG Major Version | libpg_query | npm dist-tag
+|--------------------------|-------------|---------|
+| 17 | 17-6.1.0 | [`pg17`](https://www.npmjs.com/package/@pgsql/types/v/latest)
+| 16 | 16-5.2.0 | [`pg16`](https://www.npmjs.com/package/@pgsql/types/v/pg16)
+| 15 | 15-4.2.4 | [`pg15`](https://www.npmjs.com/package/@pgsql/types/v/pg15)
+| 14 | 14-3.0.0 | [`pg14`](https://www.npmjs.com/package/@pgsql/types/v/pg14)
+| 13 | 13-2.2.0 | [`pg13`](https://www.npmjs.com/package/@pgsql/types/v/pg13)
+
+## Related
+
+* [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.
+* [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`.
+* [@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.
+* [@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.
+* [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.
+* [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.
+
+## Disclaimer
+
+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.
\ No newline at end of file
diff --git a/types/13/jest.config.js b/types/13/jest.config.js
new file mode 100644
index 00000000..0aa3aaa4
--- /dev/null
+++ b/types/13/jest.config.js
@@ -0,0 +1,18 @@
+/** @type {import('ts-jest').JestConfigWithTsJest} */
+module.exports = {
+ preset: "ts-jest",
+ testEnvironment: "node",
+ transform: {
+ "^.+\\.tsx?$": [
+ "ts-jest",
+ {
+ babelConfig: false,
+ tsconfig: "tsconfig.json",
+ },
+ ],
+ },
+ transformIgnorePatterns: [`/node_modules/*`],
+ testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
+ moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
+ modulePathIgnorePatterns: ["dist/*"]
+};
diff --git a/types/13/package.json b/types/13/package.json
new file mode 100644
index 00000000..f8e99daf
--- /dev/null
+++ b/types/13/package.json
@@ -0,0 +1,39 @@
+{
+ "name": "@libpg-query/types13",
+ "version": "13.10.1",
+ "author": "Dan Lynch ",
+ "description": "PostgreSQL AST types from the real Postgres parser",
+ "main": "index.js",
+ "module": "esm/index.js",
+ "types": "index.d.ts",
+ "homepage": "https://github.com/launchql/libpg-query-node",
+ "license": "SEE LICENSE IN LICENSE",
+ "publishConfig": {
+ "access": "public",
+ "directory": "dist"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/launchql/libpg-query-node"
+ },
+ "bugs": {
+ "url": "https://github.com/launchql/libpg-query-node/issues"
+ },
+ "x-publish": {
+ "publishName": "@pgsql/types",
+ "distTag": "pg13"
+ },
+ "scripts": {
+ "copy": "copyfiles -f ../../LICENSE README.md package.json dist",
+ "clean": "rimraf dist",
+ "build": "pnpm run clean && tsc && tsc -p tsconfig.esm.json && pnpm run copy",
+ "build:dev": "pnpm run clean && tsc --declarationMap && tsc -p tsconfig.esm.json && pnpm run copy",
+ "build:proto": "ts-node scripts/pg-proto-parser",
+ "prepare:types": "node -e \"require('../../scripts/prepare-types.js').preparePackageForPublish('.')\"",
+ "lint": "eslint . --fix"
+ },
+ "keywords": [],
+ "devDependencies": {
+ "pg-proto-parser": "^1.28.2"
+ }
+}
diff --git a/types/13/scripts/pg-proto-parser.ts b/types/13/scripts/pg-proto-parser.ts
new file mode 100644
index 00000000..1b5f2559
--- /dev/null
+++ b/types/13/scripts/pg-proto-parser.ts
@@ -0,0 +1,20 @@
+import { PgProtoParser, PgProtoParserOptions } from 'pg-proto-parser';
+import { resolve, join } from 'path';
+
+const inFile: string = join(__dirname, '../../../protos/13/pg_query.proto');
+const outDir: string = resolve(join(__dirname, '../src'));
+
+const options: PgProtoParserOptions = {
+ outDir,
+ types: {
+ enabled: true,
+ wrappedNodeTypeExport: true
+ },
+ enums: {
+ enabled: true,
+ enumsAsTypeUnion: true
+ }
+};
+const parser = new PgProtoParser(inFile, options);
+
+parser.write();
diff --git a/types/13/src/enums.ts b/types/13/src/enums.ts
new file mode 100644
index 00000000..6a60de7f
--- /dev/null
+++ b/types/13/src/enums.ts
@@ -0,0 +1,62 @@
+/**
+* This file was automatically generated by pg-proto-parser@1.28.2.
+* DO NOT MODIFY IT BY HAND. Instead, modify the source proto file,
+* and run the pg-proto-parser generate command to regenerate this file.
+*/
+export type OverridingKind = "OVERRIDING_NOT_SET" | "OVERRIDING_USER_VALUE" | "OVERRIDING_SYSTEM_VALUE";
+export type QuerySource = "QSRC_ORIGINAL" | "QSRC_PARSER" | "QSRC_INSTEAD_RULE" | "QSRC_QUAL_INSTEAD_RULE" | "QSRC_NON_INSTEAD_RULE";
+export type SortByDir = "SORTBY_DEFAULT" | "SORTBY_ASC" | "SORTBY_DESC" | "SORTBY_USING";
+export type SortByNulls = "SORTBY_NULLS_DEFAULT" | "SORTBY_NULLS_FIRST" | "SORTBY_NULLS_LAST";
+export type A_Expr_Kind = "AEXPR_OP" | "AEXPR_OP_ANY" | "AEXPR_OP_ALL" | "AEXPR_DISTINCT" | "AEXPR_NOT_DISTINCT" | "AEXPR_NULLIF" | "AEXPR_OF" | "AEXPR_IN" | "AEXPR_LIKE" | "AEXPR_ILIKE" | "AEXPR_SIMILAR" | "AEXPR_BETWEEN" | "AEXPR_NOT_BETWEEN" | "AEXPR_BETWEEN_SYM" | "AEXPR_NOT_BETWEEN_SYM" | "AEXPR_PAREN";
+export type RoleSpecType = "ROLESPEC_CSTRING" | "ROLESPEC_CURRENT_USER" | "ROLESPEC_SESSION_USER" | "ROLESPEC_PUBLIC";
+export type TableLikeOption = "CREATE_TABLE_LIKE_COMMENTS" | "CREATE_TABLE_LIKE_CONSTRAINTS" | "CREATE_TABLE_LIKE_DEFAULTS" | "CREATE_TABLE_LIKE_GENERATED" | "CREATE_TABLE_LIKE_IDENTITY" | "CREATE_TABLE_LIKE_INDEXES" | "CREATE_TABLE_LIKE_STATISTICS" | "CREATE_TABLE_LIKE_STORAGE" | "CREATE_TABLE_LIKE_ALL";
+export type DefElemAction = "DEFELEM_UNSPEC" | "DEFELEM_SET" | "DEFELEM_ADD" | "DEFELEM_DROP";
+export type PartitionRangeDatumKind = "PARTITION_RANGE_DATUM_MINVALUE" | "PARTITION_RANGE_DATUM_VALUE" | "PARTITION_RANGE_DATUM_MAXVALUE";
+export type RTEKind = "RTE_RELATION" | "RTE_SUBQUERY" | "RTE_JOIN" | "RTE_FUNCTION" | "RTE_TABLEFUNC" | "RTE_VALUES" | "RTE_CTE" | "RTE_NAMEDTUPLESTORE" | "RTE_RESULT";
+export type WCOKind = "WCO_VIEW_CHECK" | "WCO_RLS_INSERT_CHECK" | "WCO_RLS_UPDATE_CHECK" | "WCO_RLS_CONFLICT_CHECK";
+export type GroupingSetKind = "GROUPING_SET_EMPTY" | "GROUPING_SET_SIMPLE" | "GROUPING_SET_ROLLUP" | "GROUPING_SET_CUBE" | "GROUPING_SET_SETS";
+export type CTEMaterialize = "CTEMaterializeDefault" | "CTEMaterializeAlways" | "CTEMaterializeNever";
+export type SetOperation = "SETOP_NONE" | "SETOP_UNION" | "SETOP_INTERSECT" | "SETOP_EXCEPT";
+export type ObjectType = "OBJECT_ACCESS_METHOD" | "OBJECT_AGGREGATE" | "OBJECT_AMOP" | "OBJECT_AMPROC" | "OBJECT_ATTRIBUTE" | "OBJECT_CAST" | "OBJECT_COLUMN" | "OBJECT_COLLATION" | "OBJECT_CONVERSION" | "OBJECT_DATABASE" | "OBJECT_DEFAULT" | "OBJECT_DEFACL" | "OBJECT_DOMAIN" | "OBJECT_DOMCONSTRAINT" | "OBJECT_EVENT_TRIGGER" | "OBJECT_EXTENSION" | "OBJECT_FDW" | "OBJECT_FOREIGN_SERVER" | "OBJECT_FOREIGN_TABLE" | "OBJECT_FUNCTION" | "OBJECT_INDEX" | "OBJECT_LANGUAGE" | "OBJECT_LARGEOBJECT" | "OBJECT_MATVIEW" | "OBJECT_OPCLASS" | "OBJECT_OPERATOR" | "OBJECT_OPFAMILY" | "OBJECT_POLICY" | "OBJECT_PROCEDURE" | "OBJECT_PUBLICATION" | "OBJECT_PUBLICATION_REL" | "OBJECT_ROLE" | "OBJECT_ROUTINE" | "OBJECT_RULE" | "OBJECT_SCHEMA" | "OBJECT_SEQUENCE" | "OBJECT_SUBSCRIPTION" | "OBJECT_STATISTIC_EXT" | "OBJECT_TABCONSTRAINT" | "OBJECT_TABLE" | "OBJECT_TABLESPACE" | "OBJECT_TRANSFORM" | "OBJECT_TRIGGER" | "OBJECT_TSCONFIGURATION" | "OBJECT_TSDICTIONARY" | "OBJECT_TSPARSER" | "OBJECT_TSTEMPLATE" | "OBJECT_TYPE" | "OBJECT_USER_MAPPING" | "OBJECT_VIEW";
+export type DropBehavior = "DROP_RESTRICT" | "DROP_CASCADE";
+export type AlterTableType = "AT_AddColumn" | "AT_AddColumnRecurse" | "AT_AddColumnToView" | "AT_ColumnDefault" | "AT_CookedColumnDefault" | "AT_DropNotNull" | "AT_SetNotNull" | "AT_DropExpression" | "AT_CheckNotNull" | "AT_SetStatistics" | "AT_SetOptions" | "AT_ResetOptions" | "AT_SetStorage" | "AT_DropColumn" | "AT_DropColumnRecurse" | "AT_AddIndex" | "AT_ReAddIndex" | "AT_AddConstraint" | "AT_AddConstraintRecurse" | "AT_ReAddConstraint" | "AT_ReAddDomainConstraint" | "AT_AlterConstraint" | "AT_ValidateConstraint" | "AT_ValidateConstraintRecurse" | "AT_AddIndexConstraint" | "AT_DropConstraint" | "AT_DropConstraintRecurse" | "AT_ReAddComment" | "AT_AlterColumnType" | "AT_AlterColumnGenericOptions" | "AT_ChangeOwner" | "AT_ClusterOn" | "AT_DropCluster" | "AT_SetLogged" | "AT_SetUnLogged" | "AT_DropOids" | "AT_SetTableSpace" | "AT_SetRelOptions" | "AT_ResetRelOptions" | "AT_ReplaceRelOptions" | "AT_EnableTrig" | "AT_EnableAlwaysTrig" | "AT_EnableReplicaTrig" | "AT_DisableTrig" | "AT_EnableTrigAll" | "AT_DisableTrigAll" | "AT_EnableTrigUser" | "AT_DisableTrigUser" | "AT_EnableRule" | "AT_EnableAlwaysRule" | "AT_EnableReplicaRule" | "AT_DisableRule" | "AT_AddInherit" | "AT_DropInherit" | "AT_AddOf" | "AT_DropOf" | "AT_ReplicaIdentity" | "AT_EnableRowSecurity" | "AT_DisableRowSecurity" | "AT_ForceRowSecurity" | "AT_NoForceRowSecurity" | "AT_GenericOptions" | "AT_AttachPartition" | "AT_DetachPartition" | "AT_AddIdentity" | "AT_SetIdentity" | "AT_DropIdentity";
+export type GrantTargetType = "ACL_TARGET_OBJECT" | "ACL_TARGET_ALL_IN_SCHEMA" | "ACL_TARGET_DEFAULTS";
+export type VariableSetKind = "VAR_SET_VALUE" | "VAR_SET_DEFAULT" | "VAR_SET_CURRENT" | "VAR_SET_MULTI" | "VAR_RESET" | "VAR_RESET_ALL";
+export type ConstrType = "CONSTR_NULL" | "CONSTR_NOTNULL" | "CONSTR_DEFAULT" | "CONSTR_IDENTITY" | "CONSTR_GENERATED" | "CONSTR_CHECK" | "CONSTR_PRIMARY" | "CONSTR_UNIQUE" | "CONSTR_EXCLUSION" | "CONSTR_FOREIGN" | "CONSTR_ATTR_DEFERRABLE" | "CONSTR_ATTR_NOT_DEFERRABLE" | "CONSTR_ATTR_DEFERRED" | "CONSTR_ATTR_IMMEDIATE";
+export type ImportForeignSchemaType = "FDW_IMPORT_SCHEMA_ALL" | "FDW_IMPORT_SCHEMA_LIMIT_TO" | "FDW_IMPORT_SCHEMA_EXCEPT";
+export type RoleStmtType = "ROLESTMT_ROLE" | "ROLESTMT_USER" | "ROLESTMT_GROUP";
+export type FetchDirection = "FETCH_FORWARD" | "FETCH_BACKWARD" | "FETCH_ABSOLUTE" | "FETCH_RELATIVE";
+export type FunctionParameterMode = "FUNC_PARAM_IN" | "FUNC_PARAM_OUT" | "FUNC_PARAM_INOUT" | "FUNC_PARAM_VARIADIC" | "FUNC_PARAM_TABLE";
+export type TransactionStmtKind = "TRANS_STMT_BEGIN" | "TRANS_STMT_START" | "TRANS_STMT_COMMIT" | "TRANS_STMT_ROLLBACK" | "TRANS_STMT_SAVEPOINT" | "TRANS_STMT_RELEASE" | "TRANS_STMT_ROLLBACK_TO" | "TRANS_STMT_PREPARE" | "TRANS_STMT_COMMIT_PREPARED" | "TRANS_STMT_ROLLBACK_PREPARED";
+export type ViewCheckOption = "NO_CHECK_OPTION" | "LOCAL_CHECK_OPTION" | "CASCADED_CHECK_OPTION";
+export type ClusterOption = "CLUOPT_RECHECK" | "CLUOPT_VERBOSE";
+export type DiscardMode = "DISCARD_ALL" | "DISCARD_PLANS" | "DISCARD_SEQUENCES" | "DISCARD_TEMP";
+export type ReindexObjectType = "REINDEX_OBJECT_INDEX" | "REINDEX_OBJECT_TABLE" | "REINDEX_OBJECT_SCHEMA" | "REINDEX_OBJECT_SYSTEM" | "REINDEX_OBJECT_DATABASE";
+export type AlterTSConfigType = "ALTER_TSCONFIG_ADD_MAPPING" | "ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN" | "ALTER_TSCONFIG_REPLACE_DICT" | "ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN" | "ALTER_TSCONFIG_DROP_MAPPING";
+export type AlterSubscriptionType = "ALTER_SUBSCRIPTION_OPTIONS" | "ALTER_SUBSCRIPTION_CONNECTION" | "ALTER_SUBSCRIPTION_PUBLICATION" | "ALTER_SUBSCRIPTION_REFRESH" | "ALTER_SUBSCRIPTION_ENABLED";
+export type OnCommitAction = "ONCOMMIT_NOOP" | "ONCOMMIT_PRESERVE_ROWS" | "ONCOMMIT_DELETE_ROWS" | "ONCOMMIT_DROP";
+export type ParamKind = "PARAM_EXTERN" | "PARAM_EXEC" | "PARAM_SUBLINK" | "PARAM_MULTIEXPR";
+export type CoercionContext = "COERCION_IMPLICIT" | "COERCION_ASSIGNMENT" | "COERCION_EXPLICIT";
+export type CoercionForm = "COERCE_EXPLICIT_CALL" | "COERCE_EXPLICIT_CAST" | "COERCE_IMPLICIT_CAST";
+export type BoolExprType = "AND_EXPR" | "OR_EXPR" | "NOT_EXPR";
+export type SubLinkType = "EXISTS_SUBLINK" | "ALL_SUBLINK" | "ANY_SUBLINK" | "ROWCOMPARE_SUBLINK" | "EXPR_SUBLINK" | "MULTIEXPR_SUBLINK" | "ARRAY_SUBLINK" | "CTE_SUBLINK";
+export type RowCompareType = "ROWCOMPARE_LT" | "ROWCOMPARE_LE" | "ROWCOMPARE_EQ" | "ROWCOMPARE_GE" | "ROWCOMPARE_GT" | "ROWCOMPARE_NE";
+export type MinMaxOp = "IS_GREATEST" | "IS_LEAST";
+export type SQLValueFunctionOp = "SVFOP_CURRENT_DATE" | "SVFOP_CURRENT_TIME" | "SVFOP_CURRENT_TIME_N" | "SVFOP_CURRENT_TIMESTAMP" | "SVFOP_CURRENT_TIMESTAMP_N" | "SVFOP_LOCALTIME" | "SVFOP_LOCALTIME_N" | "SVFOP_LOCALTIMESTAMP" | "SVFOP_LOCALTIMESTAMP_N" | "SVFOP_CURRENT_ROLE" | "SVFOP_CURRENT_USER" | "SVFOP_USER" | "SVFOP_SESSION_USER" | "SVFOP_CURRENT_CATALOG" | "SVFOP_CURRENT_SCHEMA";
+export type XmlExprOp = "IS_XMLCONCAT" | "IS_XMLELEMENT" | "IS_XMLFOREST" | "IS_XMLPARSE" | "IS_XMLPI" | "IS_XMLROOT" | "IS_XMLSERIALIZE" | "IS_DOCUMENT";
+export type XmlOptionType = "XMLOPTION_DOCUMENT" | "XMLOPTION_CONTENT";
+export type NullTestType = "IS_NULL" | "IS_NOT_NULL";
+export type BoolTestType = "IS_TRUE" | "IS_NOT_TRUE" | "IS_FALSE" | "IS_NOT_FALSE" | "IS_UNKNOWN" | "IS_NOT_UNKNOWN";
+export type CmdType = "CMD_UNKNOWN" | "CMD_SELECT" | "CMD_UPDATE" | "CMD_INSERT" | "CMD_DELETE" | "CMD_UTILITY" | "CMD_NOTHING";
+export type JoinType = "JOIN_INNER" | "JOIN_LEFT" | "JOIN_FULL" | "JOIN_RIGHT" | "JOIN_SEMI" | "JOIN_ANTI" | "JOIN_UNIQUE_OUTER" | "JOIN_UNIQUE_INNER";
+export type AggStrategy = "AGG_PLAIN" | "AGG_SORTED" | "AGG_HASHED" | "AGG_MIXED";
+export type AggSplit = "AGGSPLIT_SIMPLE" | "AGGSPLIT_INITIAL_SERIAL" | "AGGSPLIT_FINAL_DESERIAL";
+export type SetOpCmd = "SETOPCMD_INTERSECT" | "SETOPCMD_INTERSECT_ALL" | "SETOPCMD_EXCEPT" | "SETOPCMD_EXCEPT_ALL";
+export type SetOpStrategy = "SETOP_SORTED" | "SETOP_HASHED";
+export type OnConflictAction = "ONCONFLICT_NONE" | "ONCONFLICT_NOTHING" | "ONCONFLICT_UPDATE";
+export type LimitOption = "LIMIT_OPTION_DEFAULT" | "LIMIT_OPTION_COUNT" | "LIMIT_OPTION_WITH_TIES";
+export type LockClauseStrength = "LCS_NONE" | "LCS_FORKEYSHARE" | "LCS_FORSHARE" | "LCS_FORNOKEYUPDATE" | "LCS_FORUPDATE";
+export type LockWaitPolicy = "LockWaitBlock" | "LockWaitSkip" | "LockWaitError";
+export type LockTupleMode = "LockTupleKeyShare" | "LockTupleShare" | "LockTupleNoKeyExclusive" | "LockTupleExclusive";
+export type KeywordKind = "NO_KEYWORD" | "UNRESERVED_KEYWORD" | "COL_NAME_KEYWORD" | "TYPE_FUNC_NAME_KEYWORD" | "RESERVED_KEYWORD";
+export type Token = "NUL" | "ASCII_37" | "ASCII_40" | "ASCII_41" | "ASCII_42" | "ASCII_43" | "ASCII_44" | "ASCII_45" | "ASCII_46" | "ASCII_47" | "ASCII_58" | "ASCII_59" | "ASCII_60" | "ASCII_61" | "ASCII_62" | "ASCII_63" | "ASCII_91" | "ASCII_92" | "ASCII_93" | "ASCII_94" | "IDENT" | "UIDENT" | "FCONST" | "SCONST" | "USCONST" | "BCONST" | "XCONST" | "Op" | "ICONST" | "PARAM" | "TYPECAST" | "DOT_DOT" | "COLON_EQUALS" | "EQUALS_GREATER" | "LESS_EQUALS" | "GREATER_EQUALS" | "NOT_EQUALS" | "SQL_COMMENT" | "C_COMMENT" | "ABORT_P" | "ABSOLUTE_P" | "ACCESS" | "ACTION" | "ADD_P" | "ADMIN" | "AFTER" | "AGGREGATE" | "ALL" | "ALSO" | "ALTER" | "ALWAYS" | "ANALYSE" | "ANALYZE" | "AND" | "ANY" | "ARRAY" | "AS" | "ASC" | "ASSERTION" | "ASSIGNMENT" | "ASYMMETRIC" | "AT" | "ATTACH" | "ATTRIBUTE" | "AUTHORIZATION" | "BACKWARD" | "BEFORE" | "BEGIN_P" | "BETWEEN" | "BIGINT" | "BINARY" | "BIT" | "BOOLEAN_P" | "BOTH" | "BY" | "CACHE" | "CALL" | "CALLED" | "CASCADE" | "CASCADED" | "CASE" | "CAST" | "CATALOG_P" | "CHAIN" | "CHAR_P" | "CHARACTER" | "CHARACTERISTICS" | "CHECK" | "CHECKPOINT" | "CLASS" | "CLOSE" | "CLUSTER" | "COALESCE" | "COLLATE" | "COLLATION" | "COLUMN" | "COLUMNS" | "COMMENT" | "COMMENTS" | "COMMIT" | "COMMITTED" | "CONCURRENTLY" | "CONFIGURATION" | "CONFLICT" | "CONNECTION" | "CONSTRAINT" | "CONSTRAINTS" | "CONTENT_P" | "CONTINUE_P" | "CONVERSION_P" | "COPY" | "COST" | "CREATE" | "CROSS" | "CSV" | "CUBE" | "CURRENT_P" | "CURRENT_CATALOG" | "CURRENT_DATE" | "CURRENT_ROLE" | "CURRENT_SCHEMA" | "CURRENT_TIME" | "CURRENT_TIMESTAMP" | "CURRENT_USER" | "CURSOR" | "CYCLE" | "DATA_P" | "DATABASE" | "DAY_P" | "DEALLOCATE" | "DEC" | "DECIMAL_P" | "DECLARE" | "DEFAULT" | "DEFAULTS" | "DEFERRABLE" | "DEFERRED" | "DEFINER" | "DELETE_P" | "DELIMITER" | "DELIMITERS" | "DEPENDS" | "DESC" | "DETACH" | "DICTIONARY" | "DISABLE_P" | "DISCARD" | "DISTINCT" | "DO" | "DOCUMENT_P" | "DOMAIN_P" | "DOUBLE_P" | "DROP" | "EACH" | "ELSE" | "ENABLE_P" | "ENCODING" | "ENCRYPTED" | "END_P" | "ENUM_P" | "ESCAPE" | "EVENT" | "EXCEPT" | "EXCLUDE" | "EXCLUDING" | "EXCLUSIVE" | "EXECUTE" | "EXISTS" | "EXPLAIN" | "EXPRESSION" | "EXTENSION" | "EXTERNAL" | "EXTRACT" | "FALSE_P" | "FAMILY" | "FETCH" | "FILTER" | "FIRST_P" | "FLOAT_P" | "FOLLOWING" | "FOR" | "FORCE" | "FOREIGN" | "FORWARD" | "FREEZE" | "FROM" | "FULL" | "FUNCTION" | "FUNCTIONS" | "GENERATED" | "GLOBAL" | "GRANT" | "GRANTED" | "GREATEST" | "GROUP_P" | "GROUPING" | "GROUPS" | "HANDLER" | "HAVING" | "HEADER_P" | "HOLD" | "HOUR_P" | "IDENTITY_P" | "IF_P" | "ILIKE" | "IMMEDIATE" | "IMMUTABLE" | "IMPLICIT_P" | "IMPORT_P" | "IN_P" | "INCLUDE" | "INCLUDING" | "INCREMENT" | "INDEX" | "INDEXES" | "INHERIT" | "INHERITS" | "INITIALLY" | "INLINE_P" | "INNER_P" | "INOUT" | "INPUT_P" | "INSENSITIVE" | "INSERT" | "INSTEAD" | "INT_P" | "INTEGER" | "INTERSECT" | "INTERVAL" | "INTO" | "INVOKER" | "IS" | "ISNULL" | "ISOLATION" | "JOIN" | "KEY" | "LABEL" | "LANGUAGE" | "LARGE_P" | "LAST_P" | "LATERAL_P" | "LEADING" | "LEAKPROOF" | "LEAST" | "LEFT" | "LEVEL" | "LIKE" | "LIMIT" | "LISTEN" | "LOAD" | "LOCAL" | "LOCALTIME" | "LOCALTIMESTAMP" | "LOCATION" | "LOCK_P" | "LOCKED" | "LOGGED" | "MAPPING" | "MATCH" | "MATERIALIZED" | "MAXVALUE" | "METHOD" | "MINUTE_P" | "MINVALUE" | "MODE" | "MONTH_P" | "MOVE" | "NAME_P" | "NAMES" | "NATIONAL" | "NATURAL" | "NCHAR" | "NEW" | "NEXT" | "NFC" | "NFD" | "NFKC" | "NFKD" | "NO" | "NONE" | "NORMALIZE" | "NORMALIZED" | "NOT" | "NOTHING" | "NOTIFY" | "NOTNULL" | "NOWAIT" | "NULL_P" | "NULLIF" | "NULLS_P" | "NUMERIC" | "OBJECT_P" | "OF" | "OFF" | "OFFSET" | "OIDS" | "OLD" | "ON" | "ONLY" | "OPERATOR" | "OPTION" | "OPTIONS" | "OR" | "ORDER" | "ORDINALITY" | "OTHERS" | "OUT_P" | "OUTER_P" | "OVER" | "OVERLAPS" | "OVERLAY" | "OVERRIDING" | "OWNED" | "OWNER" | "PARALLEL" | "PARSER" | "PARTIAL" | "PARTITION" | "PASSING" | "PASSWORD" | "PLACING" | "PLANS" | "POLICY" | "POSITION" | "PRECEDING" | "PRECISION" | "PRESERVE" | "PREPARE" | "PREPARED" | "PRIMARY" | "PRIOR" | "PRIVILEGES" | "PROCEDURAL" | "PROCEDURE" | "PROCEDURES" | "PROGRAM" | "PUBLICATION" | "QUOTE" | "RANGE" | "READ" | "REAL" | "REASSIGN" | "RECHECK" | "RECURSIVE" | "REF_P" | "REFERENCES" | "REFERENCING" | "REFRESH" | "REINDEX" | "RELATIVE_P" | "RELEASE" | "RENAME" | "REPEATABLE" | "REPLACE" | "REPLICA" | "RESET" | "RESTART" | "RESTRICT" | "RETURNING" | "RETURNS" | "REVOKE" | "RIGHT" | "ROLE" | "ROLLBACK" | "ROLLUP" | "ROUTINE" | "ROUTINES" | "ROW" | "ROWS" | "RULE" | "SAVEPOINT" | "SCHEMA" | "SCHEMAS" | "SCROLL" | "SEARCH" | "SECOND_P" | "SECURITY" | "SELECT" | "SEQUENCE" | "SEQUENCES" | "SERIALIZABLE" | "SERVER" | "SESSION" | "SESSION_USER" | "SET" | "SETS" | "SETOF" | "SHARE" | "SHOW" | "SIMILAR" | "SIMPLE" | "SKIP" | "SMALLINT" | "SNAPSHOT" | "SOME" | "SQL_P" | "STABLE" | "STANDALONE_P" | "START" | "STATEMENT" | "STATISTICS" | "STDIN" | "STDOUT" | "STORAGE" | "STORED" | "STRICT_P" | "STRIP_P" | "SUBSCRIPTION" | "SUBSTRING" | "SUPPORT" | "SYMMETRIC" | "SYSID" | "SYSTEM_P" | "TABLE" | "TABLES" | "TABLESAMPLE" | "TABLESPACE" | "TEMP" | "TEMPLATE" | "TEMPORARY" | "TEXT_P" | "THEN" | "TIES" | "TIME" | "TIMESTAMP" | "TO" | "TRAILING" | "TRANSACTION" | "TRANSFORM" | "TREAT" | "TRIGGER" | "TRIM" | "TRUE_P" | "TRUNCATE" | "TRUSTED" | "TYPE_P" | "TYPES_P" | "UESCAPE" | "UNBOUNDED" | "UNCOMMITTED" | "UNENCRYPTED" | "UNION" | "UNIQUE" | "UNKNOWN" | "UNLISTEN" | "UNLOGGED" | "UNTIL" | "UPDATE" | "USER" | "USING" | "VACUUM" | "VALID" | "VALIDATE" | "VALIDATOR" | "VALUE_P" | "VALUES" | "VARCHAR" | "VARIADIC" | "VARYING" | "VERBOSE" | "VERSION_P" | "VIEW" | "VIEWS" | "VOLATILE" | "WHEN" | "WHERE" | "WHITESPACE_P" | "WINDOW" | "WITH" | "WITHIN" | "WITHOUT" | "WORK" | "WRAPPER" | "WRITE" | "XML_P" | "XMLATTRIBUTES" | "XMLCONCAT" | "XMLELEMENT" | "XMLEXISTS" | "XMLFOREST" | "XMLNAMESPACES" | "XMLPARSE" | "XMLPI" | "XMLROOT" | "XMLSERIALIZE" | "XMLTABLE" | "YEAR_P" | "YES_P" | "ZONE" | "NOT_LA" | "NULLS_LA" | "WITH_LA" | "POSTFIXOP" | "UMINUS";
\ No newline at end of file
diff --git a/types/13/src/index.ts b/types/13/src/index.ts
new file mode 100644
index 00000000..dc5ee069
--- /dev/null
+++ b/types/13/src/index.ts
@@ -0,0 +1,2 @@
+export * from './types';
+export * from './enums';
diff --git a/types/13/src/types.ts b/types/13/src/types.ts
new file mode 100644
index 00000000..0e6c54fa
--- /dev/null
+++ b/types/13/src/types.ts
@@ -0,0 +1,2099 @@
+/**
+* This file was automatically generated by pg-proto-parser@1.28.2.
+* DO NOT MODIFY IT BY HAND. Instead, modify the source proto file,
+* and run the pg-proto-parser generate command to regenerate this file.
+*/
+import { OverridingKind, QuerySource, SortByDir, SortByNulls, A_Expr_Kind, RoleSpecType, TableLikeOption, DefElemAction, PartitionRangeDatumKind, RTEKind, WCOKind, GroupingSetKind, CTEMaterialize, SetOperation, ObjectType, DropBehavior, AlterTableType, GrantTargetType, VariableSetKind, ConstrType, ImportForeignSchemaType, RoleStmtType, FetchDirection, FunctionParameterMode, TransactionStmtKind, ViewCheckOption, ClusterOption, DiscardMode, ReindexObjectType, AlterTSConfigType, AlterSubscriptionType, OnCommitAction, ParamKind, CoercionContext, CoercionForm, BoolExprType, SubLinkType, RowCompareType, MinMaxOp, SQLValueFunctionOp, XmlExprOp, XmlOptionType, NullTestType, BoolTestType, CmdType, JoinType, AggStrategy, AggSplit, SetOpCmd, SetOpStrategy, OnConflictAction, LimitOption, LockClauseStrength, LockWaitPolicy, LockTupleMode, KeywordKind, Token } from "./enums";
+export type Node = {
+ ParseResult: ParseResult;
+} | {
+ ScanResult: ScanResult;
+} | {
+ Integer: Integer;
+} | {
+ Float: Float;
+} | {
+ String: String;
+} | {
+ BitString: BitString;
+} | {
+ Null: Null;
+} | {
+ List: List;
+} | {
+ OidList: OidList;
+} | {
+ IntList: IntList;
+} | {
+ Alias: Alias;
+} | {
+ RangeVar: RangeVar;
+} | {
+ TableFunc: TableFunc;
+} | {
+ Expr: Expr;
+} | {
+ Var: Var;
+} | {
+ Param: Param;
+} | {
+ Aggref: Aggref;
+} | {
+ GroupingFunc: GroupingFunc;
+} | {
+ WindowFunc: WindowFunc;
+} | {
+ SubscriptingRef: SubscriptingRef;
+} | {
+ FuncExpr: FuncExpr;
+} | {
+ NamedArgExpr: NamedArgExpr;
+} | {
+ OpExpr: OpExpr;
+} | {
+ DistinctExpr: DistinctExpr;
+} | {
+ NullIfExpr: NullIfExpr;
+} | {
+ ScalarArrayOpExpr: ScalarArrayOpExpr;
+} | {
+ BoolExpr: BoolExpr;
+} | {
+ SubLink: SubLink;
+} | {
+ SubPlan: SubPlan;
+} | {
+ AlternativeSubPlan: AlternativeSubPlan;
+} | {
+ FieldSelect: FieldSelect;
+} | {
+ FieldStore: FieldStore;
+} | {
+ RelabelType: RelabelType;
+} | {
+ CoerceViaIO: CoerceViaIO;
+} | {
+ ArrayCoerceExpr: ArrayCoerceExpr;
+} | {
+ ConvertRowtypeExpr: ConvertRowtypeExpr;
+} | {
+ CollateExpr: CollateExpr;
+} | {
+ CaseExpr: CaseExpr;
+} | {
+ CaseWhen: CaseWhen;
+} | {
+ CaseTestExpr: CaseTestExpr;
+} | {
+ ArrayExpr: ArrayExpr;
+} | {
+ RowExpr: RowExpr;
+} | {
+ RowCompareExpr: RowCompareExpr;
+} | {
+ CoalesceExpr: CoalesceExpr;
+} | {
+ MinMaxExpr: MinMaxExpr;
+} | {
+ SQLValueFunction: SQLValueFunction;
+} | {
+ XmlExpr: XmlExpr;
+} | {
+ NullTest: NullTest;
+} | {
+ BooleanTest: BooleanTest;
+} | {
+ CoerceToDomain: CoerceToDomain;
+} | {
+ CoerceToDomainValue: CoerceToDomainValue;
+} | {
+ SetToDefault: SetToDefault;
+} | {
+ CurrentOfExpr: CurrentOfExpr;
+} | {
+ NextValueExpr: NextValueExpr;
+} | {
+ InferenceElem: InferenceElem;
+} | {
+ TargetEntry: TargetEntry;
+} | {
+ RangeTblRef: RangeTblRef;
+} | {
+ JoinExpr: JoinExpr;
+} | {
+ FromExpr: FromExpr;
+} | {
+ OnConflictExpr: OnConflictExpr;
+} | {
+ IntoClause: IntoClause;
+} | {
+ RawStmt: RawStmt;
+} | {
+ Query: Query;
+} | {
+ InsertStmt: InsertStmt;
+} | {
+ DeleteStmt: DeleteStmt;
+} | {
+ UpdateStmt: UpdateStmt;
+} | {
+ SelectStmt: SelectStmt;
+} | {
+ AlterTableStmt: AlterTableStmt;
+} | {
+ AlterTableCmd: AlterTableCmd;
+} | {
+ AlterDomainStmt: AlterDomainStmt;
+} | {
+ SetOperationStmt: SetOperationStmt;
+} | {
+ GrantStmt: GrantStmt;
+} | {
+ GrantRoleStmt: GrantRoleStmt;
+} | {
+ AlterDefaultPrivilegesStmt: AlterDefaultPrivilegesStmt;
+} | {
+ ClosePortalStmt: ClosePortalStmt;
+} | {
+ ClusterStmt: ClusterStmt;
+} | {
+ CopyStmt: CopyStmt;
+} | {
+ CreateStmt: CreateStmt;
+} | {
+ DefineStmt: DefineStmt;
+} | {
+ DropStmt: DropStmt;
+} | {
+ TruncateStmt: TruncateStmt;
+} | {
+ CommentStmt: CommentStmt;
+} | {
+ FetchStmt: FetchStmt;
+} | {
+ IndexStmt: IndexStmt;
+} | {
+ CreateFunctionStmt: CreateFunctionStmt;
+} | {
+ AlterFunctionStmt: AlterFunctionStmt;
+} | {
+ DoStmt: DoStmt;
+} | {
+ RenameStmt: RenameStmt;
+} | {
+ RuleStmt: RuleStmt;
+} | {
+ NotifyStmt: NotifyStmt;
+} | {
+ ListenStmt: ListenStmt;
+} | {
+ UnlistenStmt: UnlistenStmt;
+} | {
+ TransactionStmt: TransactionStmt;
+} | {
+ ViewStmt: ViewStmt;
+} | {
+ LoadStmt: LoadStmt;
+} | {
+ CreateDomainStmt: CreateDomainStmt;
+} | {
+ CreatedbStmt: CreatedbStmt;
+} | {
+ DropdbStmt: DropdbStmt;
+} | {
+ VacuumStmt: VacuumStmt;
+} | {
+ ExplainStmt: ExplainStmt;
+} | {
+ CreateTableAsStmt: CreateTableAsStmt;
+} | {
+ CreateSeqStmt: CreateSeqStmt;
+} | {
+ AlterSeqStmt: AlterSeqStmt;
+} | {
+ VariableSetStmt: VariableSetStmt;
+} | {
+ VariableShowStmt: VariableShowStmt;
+} | {
+ DiscardStmt: DiscardStmt;
+} | {
+ CreateTrigStmt: CreateTrigStmt;
+} | {
+ CreatePLangStmt: CreatePLangStmt;
+} | {
+ CreateRoleStmt: CreateRoleStmt;
+} | {
+ AlterRoleStmt: AlterRoleStmt;
+} | {
+ DropRoleStmt: DropRoleStmt;
+} | {
+ LockStmt: LockStmt;
+} | {
+ ConstraintsSetStmt: ConstraintsSetStmt;
+} | {
+ ReindexStmt: ReindexStmt;
+} | {
+ CheckPointStmt: CheckPointStmt;
+} | {
+ CreateSchemaStmt: CreateSchemaStmt;
+} | {
+ AlterDatabaseStmt: AlterDatabaseStmt;
+} | {
+ AlterDatabaseSetStmt: AlterDatabaseSetStmt;
+} | {
+ AlterRoleSetStmt: AlterRoleSetStmt;
+} | {
+ CreateConversionStmt: CreateConversionStmt;
+} | {
+ CreateCastStmt: CreateCastStmt;
+} | {
+ CreateOpClassStmt: CreateOpClassStmt;
+} | {
+ CreateOpFamilyStmt: CreateOpFamilyStmt;
+} | {
+ AlterOpFamilyStmt: AlterOpFamilyStmt;
+} | {
+ PrepareStmt: PrepareStmt;
+} | {
+ ExecuteStmt: ExecuteStmt;
+} | {
+ DeallocateStmt: DeallocateStmt;
+} | {
+ DeclareCursorStmt: DeclareCursorStmt;
+} | {
+ CreateTableSpaceStmt: CreateTableSpaceStmt;
+} | {
+ DropTableSpaceStmt: DropTableSpaceStmt;
+} | {
+ AlterObjectDependsStmt: AlterObjectDependsStmt;
+} | {
+ AlterObjectSchemaStmt: AlterObjectSchemaStmt;
+} | {
+ AlterOwnerStmt: AlterOwnerStmt;
+} | {
+ AlterOperatorStmt: AlterOperatorStmt;
+} | {
+ AlterTypeStmt: AlterTypeStmt;
+} | {
+ DropOwnedStmt: DropOwnedStmt;
+} | {
+ ReassignOwnedStmt: ReassignOwnedStmt;
+} | {
+ CompositeTypeStmt: CompositeTypeStmt;
+} | {
+ CreateEnumStmt: CreateEnumStmt;
+} | {
+ CreateRangeStmt: CreateRangeStmt;
+} | {
+ AlterEnumStmt: AlterEnumStmt;
+} | {
+ AlterTSDictionaryStmt: AlterTSDictionaryStmt;
+} | {
+ AlterTSConfigurationStmt: AlterTSConfigurationStmt;
+} | {
+ CreateFdwStmt: CreateFdwStmt;
+} | {
+ AlterFdwStmt: AlterFdwStmt;
+} | {
+ CreateForeignServerStmt: CreateForeignServerStmt;
+} | {
+ AlterForeignServerStmt: AlterForeignServerStmt;
+} | {
+ CreateUserMappingStmt: CreateUserMappingStmt;
+} | {
+ AlterUserMappingStmt: AlterUserMappingStmt;
+} | {
+ DropUserMappingStmt: DropUserMappingStmt;
+} | {
+ AlterTableSpaceOptionsStmt: AlterTableSpaceOptionsStmt;
+} | {
+ AlterTableMoveAllStmt: AlterTableMoveAllStmt;
+} | {
+ SecLabelStmt: SecLabelStmt;
+} | {
+ CreateForeignTableStmt: CreateForeignTableStmt;
+} | {
+ ImportForeignSchemaStmt: ImportForeignSchemaStmt;
+} | {
+ CreateExtensionStmt: CreateExtensionStmt;
+} | {
+ AlterExtensionStmt: AlterExtensionStmt;
+} | {
+ AlterExtensionContentsStmt: AlterExtensionContentsStmt;
+} | {
+ CreateEventTrigStmt: CreateEventTrigStmt;
+} | {
+ AlterEventTrigStmt: AlterEventTrigStmt;
+} | {
+ RefreshMatViewStmt: RefreshMatViewStmt;
+} | {
+ ReplicaIdentityStmt: ReplicaIdentityStmt;
+} | {
+ AlterSystemStmt: AlterSystemStmt;
+} | {
+ CreatePolicyStmt: CreatePolicyStmt;
+} | {
+ AlterPolicyStmt: AlterPolicyStmt;
+} | {
+ CreateTransformStmt: CreateTransformStmt;
+} | {
+ CreateAmStmt: CreateAmStmt;
+} | {
+ CreatePublicationStmt: CreatePublicationStmt;
+} | {
+ AlterPublicationStmt: AlterPublicationStmt;
+} | {
+ CreateSubscriptionStmt: CreateSubscriptionStmt;
+} | {
+ AlterSubscriptionStmt: AlterSubscriptionStmt;
+} | {
+ DropSubscriptionStmt: DropSubscriptionStmt;
+} | {
+ CreateStatsStmt: CreateStatsStmt;
+} | {
+ AlterCollationStmt: AlterCollationStmt;
+} | {
+ CallStmt: CallStmt;
+} | {
+ AlterStatsStmt: AlterStatsStmt;
+} | {
+ A_Expr: A_Expr;
+} | {
+ ColumnRef: ColumnRef;
+} | {
+ ParamRef: ParamRef;
+} | {
+ A_Const: A_Const;
+} | {
+ FuncCall: FuncCall;
+} | {
+ A_Star: A_Star;
+} | {
+ A_Indices: A_Indices;
+} | {
+ A_Indirection: A_Indirection;
+} | {
+ A_ArrayExpr: A_ArrayExpr;
+} | {
+ ResTarget: ResTarget;
+} | {
+ MultiAssignRef: MultiAssignRef;
+} | {
+ TypeCast: TypeCast;
+} | {
+ CollateClause: CollateClause;
+} | {
+ SortBy: SortBy;
+} | {
+ WindowDef: WindowDef;
+} | {
+ RangeSubselect: RangeSubselect;
+} | {
+ RangeFunction: RangeFunction;
+} | {
+ RangeTableSample: RangeTableSample;
+} | {
+ RangeTableFunc: RangeTableFunc;
+} | {
+ RangeTableFuncCol: RangeTableFuncCol;
+} | {
+ TypeName: TypeName;
+} | {
+ ColumnDef: ColumnDef;
+} | {
+ IndexElem: IndexElem;
+} | {
+ Constraint: Constraint;
+} | {
+ DefElem: DefElem;
+} | {
+ RangeTblEntry: RangeTblEntry;
+} | {
+ RangeTblFunction: RangeTblFunction;
+} | {
+ TableSampleClause: TableSampleClause;
+} | {
+ WithCheckOption: WithCheckOption;
+} | {
+ SortGroupClause: SortGroupClause;
+} | {
+ GroupingSet: GroupingSet;
+} | {
+ WindowClause: WindowClause;
+} | {
+ ObjectWithArgs: ObjectWithArgs;
+} | {
+ AccessPriv: AccessPriv;
+} | {
+ CreateOpClassItem: CreateOpClassItem;
+} | {
+ TableLikeClause: TableLikeClause;
+} | {
+ FunctionParameter: FunctionParameter;
+} | {
+ LockingClause: LockingClause;
+} | {
+ RowMarkClause: RowMarkClause;
+} | {
+ XmlSerialize: XmlSerialize;
+} | {
+ WithClause: WithClause;
+} | {
+ InferClause: InferClause;
+} | {
+ OnConflictClause: OnConflictClause;
+} | {
+ CommonTableExpr: CommonTableExpr;
+} | {
+ RoleSpec: RoleSpec;
+} | {
+ TriggerTransition: TriggerTransition;
+} | {
+ PartitionElem: PartitionElem;
+} | {
+ PartitionSpec: PartitionSpec;
+} | {
+ PartitionBoundSpec: PartitionBoundSpec;
+} | {
+ PartitionRangeDatum: PartitionRangeDatum;
+} | {
+ PartitionCmd: PartitionCmd;
+} | {
+ VacuumRelation: VacuumRelation;
+} | {
+ InlineCodeBlock: InlineCodeBlock;
+} | {
+ CallContext: CallContext;
+} | {
+ ScanToken: ScanToken;
+};
+export interface ParseResult {
+ version?: number;
+ stmts?: RawStmt[];
+}
+export interface ScanResult {
+ version?: number;
+ tokens?: ScanToken[];
+}
+export interface Integer {
+ ival?: number;
+}
+export interface Float {
+ str?: string;
+}
+export interface String {
+ str?: string;
+}
+export interface BitString {
+ str?: string;
+}
+export interface Null {}
+export interface List {
+ items?: Node[];
+}
+export interface OidList {
+ items?: Node[];
+}
+export interface IntList {
+ items?: Node[];
+}
+export interface Alias {
+ aliasname?: string;
+ colnames?: Node[];
+}
+export interface RangeVar {
+ catalogname?: string;
+ schemaname?: string;
+ relname?: string;
+ inh?: boolean;
+ relpersistence?: string;
+ alias?: Alias;
+ location?: number;
+}
+export interface TableFunc {
+ ns_uris?: Node[];
+ ns_names?: Node[];
+ docexpr?: Node;
+ rowexpr?: Node;
+ colnames?: Node[];
+ coltypes?: Node[];
+ coltypmods?: Node[];
+ colcollations?: Node[];
+ colexprs?: Node[];
+ coldefexprs?: Node[];
+ notnulls?: bigint[];
+ ordinalitycol?: number;
+ location?: number;
+}
+export interface Expr {}
+export interface Var {
+ xpr?: Node;
+ varno?: number;
+ varattno?: number;
+ vartype?: number;
+ vartypmod?: number;
+ varcollid?: number;
+ varlevelsup?: number;
+ varnosyn?: number;
+ varattnosyn?: number;
+ location?: number;
+}
+export interface Param {
+ xpr?: Node;
+ paramkind?: ParamKind;
+ paramid?: number;
+ paramtype?: number;
+ paramtypmod?: number;
+ paramcollid?: number;
+ location?: number;
+}
+export interface Aggref {
+ xpr?: Node;
+ aggfnoid?: number;
+ aggtype?: number;
+ aggcollid?: number;
+ inputcollid?: number;
+ aggtranstype?: number;
+ aggargtypes?: Node[];
+ aggdirectargs?: Node[];
+ args?: Node[];
+ aggorder?: Node[];
+ aggdistinct?: Node[];
+ aggfilter?: Node;
+ aggstar?: boolean;
+ aggvariadic?: boolean;
+ aggkind?: string;
+ agglevelsup?: number;
+ aggsplit?: AggSplit;
+ location?: number;
+}
+export interface GroupingFunc {
+ xpr?: Node;
+ args?: Node[];
+ refs?: Node[];
+ cols?: Node[];
+ agglevelsup?: number;
+ location?: number;
+}
+export interface WindowFunc {
+ xpr?: Node;
+ winfnoid?: number;
+ wintype?: number;
+ wincollid?: number;
+ inputcollid?: number;
+ args?: Node[];
+ aggfilter?: Node;
+ winref?: number;
+ winstar?: boolean;
+ winagg?: boolean;
+ location?: number;
+}
+export interface SubscriptingRef {
+ xpr?: Node;
+ refcontainertype?: number;
+ refelemtype?: number;
+ reftypmod?: number;
+ refcollid?: number;
+ refupperindexpr?: Node[];
+ reflowerindexpr?: Node[];
+ refexpr?: Node;
+ refassgnexpr?: Node;
+}
+export interface FuncExpr {
+ xpr?: Node;
+ funcid?: number;
+ funcresulttype?: number;
+ funcretset?: boolean;
+ funcvariadic?: boolean;
+ funcformat?: CoercionForm;
+ funccollid?: number;
+ inputcollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface NamedArgExpr {
+ xpr?: Node;
+ arg?: Node;
+ name?: string;
+ argnumber?: number;
+ location?: number;
+}
+export interface OpExpr {
+ xpr?: Node;
+ opno?: number;
+ opfuncid?: number;
+ opresulttype?: number;
+ opretset?: boolean;
+ opcollid?: number;
+ inputcollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface DistinctExpr {
+ xpr?: Node;
+ opno?: number;
+ opfuncid?: number;
+ opresulttype?: number;
+ opretset?: boolean;
+ opcollid?: number;
+ inputcollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface NullIfExpr {
+ xpr?: Node;
+ opno?: number;
+ opfuncid?: number;
+ opresulttype?: number;
+ opretset?: boolean;
+ opcollid?: number;
+ inputcollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface ScalarArrayOpExpr {
+ xpr?: Node;
+ opno?: number;
+ opfuncid?: number;
+ useOr?: boolean;
+ inputcollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface BoolExpr {
+ xpr?: Node;
+ boolop?: BoolExprType;
+ args?: Node[];
+ location?: number;
+}
+export interface SubLink {
+ xpr?: Node;
+ subLinkType?: SubLinkType;
+ subLinkId?: number;
+ testexpr?: Node;
+ operName?: Node[];
+ subselect?: Node;
+ location?: number;
+}
+export interface SubPlan {
+ xpr?: Node;
+ subLinkType?: SubLinkType;
+ testexpr?: Node;
+ paramIds?: Node[];
+ plan_id?: number;
+ plan_name?: string;
+ firstColType?: number;
+ firstColTypmod?: number;
+ firstColCollation?: number;
+ useHashTable?: boolean;
+ unknownEqFalse?: boolean;
+ parallel_safe?: boolean;
+ setParam?: Node[];
+ parParam?: Node[];
+ args?: Node[];
+ startup_cost?: number;
+ per_call_cost?: number;
+}
+export interface AlternativeSubPlan {
+ xpr?: Node;
+ subplans?: Node[];
+}
+export interface FieldSelect {
+ xpr?: Node;
+ arg?: Node;
+ fieldnum?: number;
+ resulttype?: number;
+ resulttypmod?: number;
+ resultcollid?: number;
+}
+export interface FieldStore {
+ xpr?: Node;
+ arg?: Node;
+ newvals?: Node[];
+ fieldnums?: Node[];
+ resulttype?: number;
+}
+export interface RelabelType {
+ xpr?: Node;
+ arg?: Node;
+ resulttype?: number;
+ resulttypmod?: number;
+ resultcollid?: number;
+ relabelformat?: CoercionForm;
+ location?: number;
+}
+export interface CoerceViaIO {
+ xpr?: Node;
+ arg?: Node;
+ resulttype?: number;
+ resultcollid?: number;
+ coerceformat?: CoercionForm;
+ location?: number;
+}
+export interface ArrayCoerceExpr {
+ xpr?: Node;
+ arg?: Node;
+ elemexpr?: Node;
+ resulttype?: number;
+ resulttypmod?: number;
+ resultcollid?: number;
+ coerceformat?: CoercionForm;
+ location?: number;
+}
+export interface ConvertRowtypeExpr {
+ xpr?: Node;
+ arg?: Node;
+ resulttype?: number;
+ convertformat?: CoercionForm;
+ location?: number;
+}
+export interface CollateExpr {
+ xpr?: Node;
+ arg?: Node;
+ collOid?: number;
+ location?: number;
+}
+export interface CaseExpr {
+ xpr?: Node;
+ casetype?: number;
+ casecollid?: number;
+ arg?: Node;
+ args?: Node[];
+ defresult?: Node;
+ location?: number;
+}
+export interface CaseWhen {
+ xpr?: Node;
+ expr?: Node;
+ result?: Node;
+ location?: number;
+}
+export interface CaseTestExpr {
+ xpr?: Node;
+ typeId?: number;
+ typeMod?: number;
+ collation?: number;
+}
+export interface ArrayExpr {
+ xpr?: Node;
+ array_typeid?: number;
+ array_collid?: number;
+ element_typeid?: number;
+ elements?: Node[];
+ multidims?: boolean;
+ location?: number;
+}
+export interface RowExpr {
+ xpr?: Node;
+ args?: Node[];
+ row_typeid?: number;
+ row_format?: CoercionForm;
+ colnames?: Node[];
+ location?: number;
+}
+export interface RowCompareExpr {
+ xpr?: Node;
+ rctype?: RowCompareType;
+ opnos?: Node[];
+ opfamilies?: Node[];
+ inputcollids?: Node[];
+ largs?: Node[];
+ rargs?: Node[];
+}
+export interface CoalesceExpr {
+ xpr?: Node;
+ coalescetype?: number;
+ coalescecollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface MinMaxExpr {
+ xpr?: Node;
+ minmaxtype?: number;
+ minmaxcollid?: number;
+ inputcollid?: number;
+ op?: MinMaxOp;
+ args?: Node[];
+ location?: number;
+}
+export interface SQLValueFunction {
+ xpr?: Node;
+ op?: SQLValueFunctionOp;
+ type?: number;
+ typmod?: number;
+ location?: number;
+}
+export interface XmlExpr {
+ xpr?: Node;
+ op?: XmlExprOp;
+ name?: string;
+ named_args?: Node[];
+ arg_names?: Node[];
+ args?: Node[];
+ xmloption?: XmlOptionType;
+ type?: number;
+ typmod?: number;
+ location?: number;
+}
+export interface NullTest {
+ xpr?: Node;
+ arg?: Node;
+ nulltesttype?: NullTestType;
+ argisrow?: boolean;
+ location?: number;
+}
+export interface BooleanTest {
+ xpr?: Node;
+ arg?: Node;
+ booltesttype?: BoolTestType;
+ location?: number;
+}
+export interface CoerceToDomain {
+ xpr?: Node;
+ arg?: Node;
+ resulttype?: number;
+ resulttypmod?: number;
+ resultcollid?: number;
+ coercionformat?: CoercionForm;
+ location?: number;
+}
+export interface CoerceToDomainValue {
+ xpr?: Node;
+ typeId?: number;
+ typeMod?: number;
+ collation?: number;
+ location?: number;
+}
+export interface SetToDefault {
+ xpr?: Node;
+ typeId?: number;
+ typeMod?: number;
+ collation?: number;
+ location?: number;
+}
+export interface CurrentOfExpr {
+ xpr?: Node;
+ cvarno?: number;
+ cursor_name?: string;
+ cursor_param?: number;
+}
+export interface NextValueExpr {
+ xpr?: Node;
+ seqid?: number;
+ typeId?: number;
+}
+export interface InferenceElem {
+ xpr?: Node;
+ expr?: Node;
+ infercollid?: number;
+ inferopclass?: number;
+}
+export interface TargetEntry {
+ xpr?: Node;
+ expr?: Node;
+ resno?: number;
+ resname?: string;
+ ressortgroupref?: number;
+ resorigtbl?: number;
+ resorigcol?: number;
+ resjunk?: boolean;
+}
+export interface RangeTblRef {
+ rtindex?: number;
+}
+export interface JoinExpr {
+ jointype?: JoinType;
+ isNatural?: boolean;
+ larg?: Node;
+ rarg?: Node;
+ usingClause?: Node[];
+ quals?: Node;
+ alias?: Alias;
+ rtindex?: number;
+}
+export interface FromExpr {
+ fromlist?: Node[];
+ quals?: Node;
+}
+export interface OnConflictExpr {
+ action?: OnConflictAction;
+ arbiterElems?: Node[];
+ arbiterWhere?: Node;
+ constraint?: number;
+ onConflictSet?: Node[];
+ onConflictWhere?: Node;
+ exclRelIndex?: number;
+ exclRelTlist?: Node[];
+}
+export interface IntoClause {
+ rel?: RangeVar;
+ colNames?: Node[];
+ accessMethod?: string;
+ options?: Node[];
+ onCommit?: OnCommitAction;
+ tableSpaceName?: string;
+ viewQuery?: Node;
+ skipData?: boolean;
+}
+export interface RawStmt {
+ stmt?: Node;
+ stmt_location?: number;
+ stmt_len?: number;
+}
+export interface Query {
+ commandType?: CmdType;
+ querySource?: QuerySource;
+ canSetTag?: boolean;
+ utilityStmt?: Node;
+ resultRelation?: number;
+ hasAggs?: boolean;
+ hasWindowFuncs?: boolean;
+ hasTargetSRFs?: boolean;
+ hasSubLinks?: boolean;
+ hasDistinctOn?: boolean;
+ hasRecursive?: boolean;
+ hasModifyingCTE?: boolean;
+ hasForUpdate?: boolean;
+ hasRowSecurity?: boolean;
+ cteList?: Node[];
+ rtable?: Node[];
+ jointree?: FromExpr;
+ targetList?: Node[];
+ override?: OverridingKind;
+ onConflict?: OnConflictExpr;
+ returningList?: Node[];
+ groupClause?: Node[];
+ groupingSets?: Node[];
+ havingQual?: Node;
+ windowClause?: Node[];
+ distinctClause?: Node[];
+ sortClause?: Node[];
+ limitOffset?: Node;
+ limitCount?: Node;
+ limitOption?: LimitOption;
+ rowMarks?: Node[];
+ setOperations?: Node;
+ constraintDeps?: Node[];
+ withCheckOptions?: Node[];
+ stmt_location?: number;
+ stmt_len?: number;
+}
+export interface InsertStmt {
+ relation?: RangeVar;
+ cols?: Node[];
+ selectStmt?: Node;
+ onConflictClause?: OnConflictClause;
+ returningList?: Node[];
+ withClause?: WithClause;
+ override?: OverridingKind;
+}
+export interface DeleteStmt {
+ relation?: RangeVar;
+ usingClause?: Node[];
+ whereClause?: Node;
+ returningList?: Node[];
+ withClause?: WithClause;
+}
+export interface UpdateStmt {
+ relation?: RangeVar;
+ targetList?: Node[];
+ whereClause?: Node;
+ fromClause?: Node[];
+ returningList?: Node[];
+ withClause?: WithClause;
+}
+export interface SelectStmt {
+ distinctClause?: Node[];
+ intoClause?: IntoClause;
+ targetList?: Node[];
+ fromClause?: Node[];
+ whereClause?: Node;
+ groupClause?: Node[];
+ havingClause?: Node;
+ windowClause?: Node[];
+ valuesLists?: Node[];
+ sortClause?: Node[];
+ limitOffset?: Node;
+ limitCount?: Node;
+ limitOption?: LimitOption;
+ lockingClause?: Node[];
+ withClause?: WithClause;
+ op?: SetOperation;
+ all?: boolean;
+ larg?: SelectStmt;
+ rarg?: SelectStmt;
+}
+export interface AlterTableStmt {
+ relation?: RangeVar;
+ cmds?: Node[];
+ relkind?: ObjectType;
+ missing_ok?: boolean;
+}
+export interface AlterTableCmd {
+ subtype?: AlterTableType;
+ name?: string;
+ num?: number;
+ newowner?: RoleSpec;
+ def?: Node;
+ behavior?: DropBehavior;
+ missing_ok?: boolean;
+ recurse?: boolean;
+}
+export interface AlterDomainStmt {
+ subtype?: string;
+ typeName?: Node[];
+ name?: string;
+ def?: Node;
+ behavior?: DropBehavior;
+ missing_ok?: boolean;
+}
+export interface SetOperationStmt {
+ op?: SetOperation;
+ all?: boolean;
+ larg?: Node;
+ rarg?: Node;
+ colTypes?: Node[];
+ colTypmods?: Node[];
+ colCollations?: Node[];
+ groupClauses?: Node[];
+}
+export interface GrantStmt {
+ is_grant?: boolean;
+ targtype?: GrantTargetType;
+ objtype?: ObjectType;
+ objects?: Node[];
+ privileges?: Node[];
+ grantees?: Node[];
+ grant_option?: boolean;
+ behavior?: DropBehavior;
+}
+export interface GrantRoleStmt {
+ granted_roles?: Node[];
+ grantee_roles?: Node[];
+ is_grant?: boolean;
+ admin_opt?: boolean;
+ grantor?: RoleSpec;
+ behavior?: DropBehavior;
+}
+export interface AlterDefaultPrivilegesStmt {
+ options?: Node[];
+ action?: GrantStmt;
+}
+export interface ClosePortalStmt {
+ portalname?: string;
+}
+export interface ClusterStmt {
+ relation?: RangeVar;
+ indexname?: string;
+ options?: number;
+}
+export interface CopyStmt {
+ relation?: RangeVar;
+ query?: Node;
+ attlist?: Node[];
+ is_from?: boolean;
+ is_program?: boolean;
+ filename?: string;
+ options?: Node[];
+ whereClause?: Node;
+}
+export interface CreateStmt {
+ relation?: RangeVar;
+ tableElts?: Node[];
+ inhRelations?: Node[];
+ partbound?: PartitionBoundSpec;
+ partspec?: PartitionSpec;
+ ofTypename?: TypeName;
+ constraints?: Node[];
+ options?: Node[];
+ oncommit?: OnCommitAction;
+ tablespacename?: string;
+ accessMethod?: string;
+ if_not_exists?: boolean;
+}
+export interface DefineStmt {
+ kind?: ObjectType;
+ oldstyle?: boolean;
+ defnames?: Node[];
+ args?: Node[];
+ definition?: Node[];
+ if_not_exists?: boolean;
+ replace?: boolean;
+}
+export interface DropStmt {
+ objects?: Node[];
+ removeType?: ObjectType;
+ behavior?: DropBehavior;
+ missing_ok?: boolean;
+ concurrent?: boolean;
+}
+export interface TruncateStmt {
+ relations?: Node[];
+ restart_seqs?: boolean;
+ behavior?: DropBehavior;
+}
+export interface CommentStmt {
+ objtype?: ObjectType;
+ object?: Node;
+ comment?: string;
+}
+export interface FetchStmt {
+ direction?: FetchDirection;
+ howMany?: bigint;
+ portalname?: string;
+ ismove?: boolean;
+}
+export interface IndexStmt {
+ idxname?: string;
+ relation?: RangeVar;
+ accessMethod?: string;
+ tableSpace?: string;
+ indexParams?: Node[];
+ indexIncludingParams?: Node[];
+ options?: Node[];
+ whereClause?: Node;
+ excludeOpNames?: Node[];
+ idxcomment?: string;
+ indexOid?: number;
+ oldNode?: number;
+ oldCreateSubid?: number;
+ oldFirstRelfilenodeSubid?: number;
+ unique?: boolean;
+ primary?: boolean;
+ isconstraint?: boolean;
+ deferrable?: boolean;
+ initdeferred?: boolean;
+ transformed?: boolean;
+ concurrent?: boolean;
+ if_not_exists?: boolean;
+ reset_default_tblspc?: boolean;
+}
+export interface CreateFunctionStmt {
+ is_procedure?: boolean;
+ replace?: boolean;
+ funcname?: Node[];
+ parameters?: Node[];
+ returnType?: TypeName;
+ options?: Node[];
+}
+export interface AlterFunctionStmt {
+ objtype?: ObjectType;
+ func?: ObjectWithArgs;
+ actions?: Node[];
+}
+export interface DoStmt {
+ args?: Node[];
+}
+export interface RenameStmt {
+ renameType?: ObjectType;
+ relationType?: ObjectType;
+ relation?: RangeVar;
+ object?: Node;
+ subname?: string;
+ newname?: string;
+ behavior?: DropBehavior;
+ missing_ok?: boolean;
+}
+export interface RuleStmt {
+ relation?: RangeVar;
+ rulename?: string;
+ whereClause?: Node;
+ event?: CmdType;
+ instead?: boolean;
+ actions?: Node[];
+ replace?: boolean;
+}
+export interface NotifyStmt {
+ conditionname?: string;
+ payload?: string;
+}
+export interface ListenStmt {
+ conditionname?: string;
+}
+export interface UnlistenStmt {
+ conditionname?: string;
+}
+export interface TransactionStmt {
+ kind?: TransactionStmtKind;
+ options?: Node[];
+ savepoint_name?: string;
+ gid?: string;
+ chain?: boolean;
+}
+export interface ViewStmt {
+ view?: RangeVar;
+ aliases?: Node[];
+ query?: Node;
+ replace?: boolean;
+ options?: Node[];
+ withCheckOption?: ViewCheckOption;
+}
+export interface LoadStmt {
+ filename?: string;
+}
+export interface CreateDomainStmt {
+ domainname?: Node[];
+ typeName?: TypeName;
+ collClause?: CollateClause;
+ constraints?: Node[];
+}
+export interface CreatedbStmt {
+ dbname?: string;
+ options?: Node[];
+}
+export interface DropdbStmt {
+ dbname?: string;
+ missing_ok?: boolean;
+ options?: Node[];
+}
+export interface VacuumStmt {
+ options?: Node[];
+ rels?: Node[];
+ is_vacuumcmd?: boolean;
+}
+export interface ExplainStmt {
+ query?: Node;
+ options?: Node[];
+}
+export interface CreateTableAsStmt {
+ query?: Node;
+ into?: IntoClause;
+ relkind?: ObjectType;
+ is_select_into?: boolean;
+ if_not_exists?: boolean;
+}
+export interface CreateSeqStmt {
+ sequence?: RangeVar;
+ options?: Node[];
+ ownerId?: number;
+ for_identity?: boolean;
+ if_not_exists?: boolean;
+}
+export interface AlterSeqStmt {
+ sequence?: RangeVar;
+ options?: Node[];
+ for_identity?: boolean;
+ missing_ok?: boolean;
+}
+export interface VariableSetStmt {
+ kind?: VariableSetKind;
+ name?: string;
+ args?: Node[];
+ is_local?: boolean;
+}
+export interface VariableShowStmt {
+ name?: string;
+}
+export interface DiscardStmt {
+ target?: DiscardMode;
+}
+export interface CreateTrigStmt {
+ trigname?: string;
+ relation?: RangeVar;
+ funcname?: Node[];
+ args?: Node[];
+ row?: boolean;
+ timing?: number;
+ events?: number;
+ columns?: Node[];
+ whenClause?: Node;
+ isconstraint?: boolean;
+ transitionRels?: Node[];
+ deferrable?: boolean;
+ initdeferred?: boolean;
+ constrrel?: RangeVar;
+}
+export interface CreatePLangStmt {
+ replace?: boolean;
+ plname?: string;
+ plhandler?: Node[];
+ plinline?: Node[];
+ plvalidator?: Node[];
+ pltrusted?: boolean;
+}
+export interface CreateRoleStmt {
+ stmt_type?: RoleStmtType;
+ role?: string;
+ options?: Node[];
+}
+export interface AlterRoleStmt {
+ role?: RoleSpec;
+ options?: Node[];
+ action?: number;
+}
+export interface DropRoleStmt {
+ roles?: Node[];
+ missing_ok?: boolean;
+}
+export interface LockStmt {
+ relations?: Node[];
+ mode?: number;
+ nowait?: boolean;
+}
+export interface ConstraintsSetStmt {
+ constraints?: Node[];
+ deferred?: boolean;
+}
+export interface ReindexStmt {
+ kind?: ReindexObjectType;
+ relation?: RangeVar;
+ name?: string;
+ options?: number;
+ concurrent?: boolean;
+}
+export interface CheckPointStmt {}
+export interface CreateSchemaStmt {
+ schemaname?: string;
+ authrole?: RoleSpec;
+ schemaElts?: Node[];
+ if_not_exists?: boolean;
+}
+export interface AlterDatabaseStmt {
+ dbname?: string;
+ options?: Node[];
+}
+export interface AlterDatabaseSetStmt {
+ dbname?: string;
+ setstmt?: VariableSetStmt;
+}
+export interface AlterRoleSetStmt {
+ role?: RoleSpec;
+ database?: string;
+ setstmt?: VariableSetStmt;
+}
+export interface CreateConversionStmt {
+ conversion_name?: Node[];
+ for_encoding_name?: string;
+ to_encoding_name?: string;
+ func_name?: Node[];
+ def?: boolean;
+}
+export interface CreateCastStmt {
+ sourcetype?: TypeName;
+ targettype?: TypeName;
+ func?: ObjectWithArgs;
+ context?: CoercionContext;
+ inout?: boolean;
+}
+export interface CreateOpClassStmt {
+ opclassname?: Node[];
+ opfamilyname?: Node[];
+ amname?: string;
+ datatype?: TypeName;
+ items?: Node[];
+ isDefault?: boolean;
+}
+export interface CreateOpFamilyStmt {
+ opfamilyname?: Node[];
+ amname?: string;
+}
+export interface AlterOpFamilyStmt {
+ opfamilyname?: Node[];
+ amname?: string;
+ isDrop?: boolean;
+ items?: Node[];
+}
+export interface PrepareStmt {
+ name?: string;
+ argtypes?: Node[];
+ query?: Node;
+}
+export interface ExecuteStmt {
+ name?: string;
+ params?: Node[];
+}
+export interface DeallocateStmt {
+ name?: string;
+}
+export interface DeclareCursorStmt {
+ portalname?: string;
+ options?: number;
+ query?: Node;
+}
+export interface CreateTableSpaceStmt {
+ tablespacename?: string;
+ owner?: RoleSpec;
+ location?: string;
+ options?: Node[];
+}
+export interface DropTableSpaceStmt {
+ tablespacename?: string;
+ missing_ok?: boolean;
+}
+export interface AlterObjectDependsStmt {
+ objectType?: ObjectType;
+ relation?: RangeVar;
+ object?: Node;
+ extname?: Node;
+ remove?: boolean;
+}
+export interface AlterObjectSchemaStmt {
+ objectType?: ObjectType;
+ relation?: RangeVar;
+ object?: Node;
+ newschema?: string;
+ missing_ok?: boolean;
+}
+export interface AlterOwnerStmt {
+ objectType?: ObjectType;
+ relation?: RangeVar;
+ object?: Node;
+ newowner?: RoleSpec;
+}
+export interface AlterOperatorStmt {
+ opername?: ObjectWithArgs;
+ options?: Node[];
+}
+export interface AlterTypeStmt {
+ typeName?: Node[];
+ options?: Node[];
+}
+export interface DropOwnedStmt {
+ roles?: Node[];
+ behavior?: DropBehavior;
+}
+export interface ReassignOwnedStmt {
+ roles?: Node[];
+ newrole?: RoleSpec;
+}
+export interface CompositeTypeStmt {
+ typevar?: RangeVar;
+ coldeflist?: Node[];
+}
+export interface CreateEnumStmt {
+ typeName?: Node[];
+ vals?: Node[];
+}
+export interface CreateRangeStmt {
+ typeName?: Node[];
+ params?: Node[];
+}
+export interface AlterEnumStmt {
+ typeName?: Node[];
+ oldVal?: string;
+ newVal?: string;
+ newValNeighbor?: string;
+ newValIsAfter?: boolean;
+ skipIfNewValExists?: boolean;
+}
+export interface AlterTSDictionaryStmt {
+ dictname?: Node[];
+ options?: Node[];
+}
+export interface AlterTSConfigurationStmt {
+ kind?: AlterTSConfigType;
+ cfgname?: Node[];
+ tokentype?: Node[];
+ dicts?: Node[];
+ override?: boolean;
+ replace?: boolean;
+ missing_ok?: boolean;
+}
+export interface CreateFdwStmt {
+ fdwname?: string;
+ func_options?: Node[];
+ options?: Node[];
+}
+export interface AlterFdwStmt {
+ fdwname?: string;
+ func_options?: Node[];
+ options?: Node[];
+}
+export interface CreateForeignServerStmt {
+ servername?: string;
+ servertype?: string;
+ version?: string;
+ fdwname?: string;
+ if_not_exists?: boolean;
+ options?: Node[];
+}
+export interface AlterForeignServerStmt {
+ servername?: string;
+ version?: string;
+ options?: Node[];
+ has_version?: boolean;
+}
+export interface CreateUserMappingStmt {
+ user?: RoleSpec;
+ servername?: string;
+ if_not_exists?: boolean;
+ options?: Node[];
+}
+export interface AlterUserMappingStmt {
+ user?: RoleSpec;
+ servername?: string;
+ options?: Node[];
+}
+export interface DropUserMappingStmt {
+ user?: RoleSpec;
+ servername?: string;
+ missing_ok?: boolean;
+}
+export interface AlterTableSpaceOptionsStmt {
+ tablespacename?: string;
+ options?: Node[];
+ isReset?: boolean;
+}
+export interface AlterTableMoveAllStmt {
+ orig_tablespacename?: string;
+ objtype?: ObjectType;
+ roles?: Node[];
+ new_tablespacename?: string;
+ nowait?: boolean;
+}
+export interface SecLabelStmt {
+ objtype?: ObjectType;
+ object?: Node;
+ provider?: string;
+ label?: string;
+}
+export interface CreateForeignTableStmt {
+ base?: CreateStmt;
+ servername?: string;
+ options?: Node[];
+}
+export interface ImportForeignSchemaStmt {
+ server_name?: string;
+ remote_schema?: string;
+ local_schema?: string;
+ list_type?: ImportForeignSchemaType;
+ table_list?: Node[];
+ options?: Node[];
+}
+export interface CreateExtensionStmt {
+ extname?: string;
+ if_not_exists?: boolean;
+ options?: Node[];
+}
+export interface AlterExtensionStmt {
+ extname?: string;
+ options?: Node[];
+}
+export interface AlterExtensionContentsStmt {
+ extname?: string;
+ action?: number;
+ objtype?: ObjectType;
+ object?: Node;
+}
+export interface CreateEventTrigStmt {
+ trigname?: string;
+ eventname?: string;
+ whenclause?: Node[];
+ funcname?: Node[];
+}
+export interface AlterEventTrigStmt {
+ trigname?: string;
+ tgenabled?: string;
+}
+export interface RefreshMatViewStmt {
+ concurrent?: boolean;
+ skipData?: boolean;
+ relation?: RangeVar;
+}
+export interface ReplicaIdentityStmt {
+ identity_type?: string;
+ name?: string;
+}
+export interface AlterSystemStmt {
+ setstmt?: VariableSetStmt;
+}
+export interface CreatePolicyStmt {
+ policy_name?: string;
+ table?: RangeVar;
+ cmd_name?: string;
+ permissive?: boolean;
+ roles?: Node[];
+ qual?: Node;
+ with_check?: Node;
+}
+export interface AlterPolicyStmt {
+ policy_name?: string;
+ table?: RangeVar;
+ roles?: Node[];
+ qual?: Node;
+ with_check?: Node;
+}
+export interface CreateTransformStmt {
+ replace?: boolean;
+ type_name?: TypeName;
+ lang?: string;
+ fromsql?: ObjectWithArgs;
+ tosql?: ObjectWithArgs;
+}
+export interface CreateAmStmt {
+ amname?: string;
+ handler_name?: Node[];
+ amtype?: string;
+}
+export interface CreatePublicationStmt {
+ pubname?: string;
+ options?: Node[];
+ tables?: Node[];
+ for_all_tables?: boolean;
+}
+export interface AlterPublicationStmt {
+ pubname?: string;
+ options?: Node[];
+ tables?: Node[];
+ for_all_tables?: boolean;
+ tableAction?: DefElemAction;
+}
+export interface CreateSubscriptionStmt {
+ subname?: string;
+ conninfo?: string;
+ publication?: Node[];
+ options?: Node[];
+}
+export interface AlterSubscriptionStmt {
+ kind?: AlterSubscriptionType;
+ subname?: string;
+ conninfo?: string;
+ publication?: Node[];
+ options?: Node[];
+}
+export interface DropSubscriptionStmt {
+ subname?: string;
+ missing_ok?: boolean;
+ behavior?: DropBehavior;
+}
+export interface CreateStatsStmt {
+ defnames?: Node[];
+ stat_types?: Node[];
+ exprs?: Node[];
+ relations?: Node[];
+ stxcomment?: string;
+ if_not_exists?: boolean;
+}
+export interface AlterCollationStmt {
+ collname?: Node[];
+}
+export interface CallStmt {
+ funccall?: FuncCall;
+ funcexpr?: FuncExpr;
+}
+export interface AlterStatsStmt {
+ defnames?: Node[];
+ stxstattarget?: number;
+ missing_ok?: boolean;
+}
+export interface A_Expr {
+ kind?: A_Expr_Kind;
+ name?: Node[];
+ lexpr?: Node;
+ rexpr?: Node;
+ location?: number;
+}
+export interface ColumnRef {
+ fields?: Node[];
+ location?: number;
+}
+export interface ParamRef {
+ number?: number;
+ location?: number;
+}
+export interface A_Const {
+ val?: Node;
+ location?: number;
+}
+export interface FuncCall {
+ funcname?: Node[];
+ args?: Node[];
+ agg_order?: Node[];
+ agg_filter?: Node;
+ agg_within_group?: boolean;
+ agg_star?: boolean;
+ agg_distinct?: boolean;
+ func_variadic?: boolean;
+ over?: WindowDef;
+ location?: number;
+}
+export interface A_Star {}
+export interface A_Indices {
+ is_slice?: boolean;
+ lidx?: Node;
+ uidx?: Node;
+}
+export interface A_Indirection {
+ arg?: Node;
+ indirection?: Node[];
+}
+export interface A_ArrayExpr {
+ elements?: Node[];
+ location?: number;
+}
+export interface ResTarget {
+ name?: string;
+ indirection?: Node[];
+ val?: Node;
+ location?: number;
+}
+export interface MultiAssignRef {
+ source?: Node;
+ colno?: number;
+ ncolumns?: number;
+}
+export interface TypeCast {
+ arg?: Node;
+ typeName?: TypeName;
+ location?: number;
+}
+export interface CollateClause {
+ arg?: Node;
+ collname?: Node[];
+ location?: number;
+}
+export interface SortBy {
+ node?: Node;
+ sortby_dir?: SortByDir;
+ sortby_nulls?: SortByNulls;
+ useOp?: Node[];
+ location?: number;
+}
+export interface WindowDef {
+ name?: string;
+ refname?: string;
+ partitionClause?: Node[];
+ orderClause?: Node[];
+ frameOptions?: number;
+ startOffset?: Node;
+ endOffset?: Node;
+ location?: number;
+}
+export interface RangeSubselect {
+ lateral?: boolean;
+ subquery?: Node;
+ alias?: Alias;
+}
+export interface RangeFunction {
+ lateral?: boolean;
+ ordinality?: boolean;
+ is_rowsfrom?: boolean;
+ functions?: Node[];
+ alias?: Alias;
+ coldeflist?: Node[];
+}
+export interface RangeTableSample {
+ relation?: Node;
+ method?: Node[];
+ args?: Node[];
+ repeatable?: Node;
+ location?: number;
+}
+export interface RangeTableFunc {
+ lateral?: boolean;
+ docexpr?: Node;
+ rowexpr?: Node;
+ namespaces?: Node[];
+ columns?: Node[];
+ alias?: Alias;
+ location?: number;
+}
+export interface RangeTableFuncCol {
+ colname?: string;
+ typeName?: TypeName;
+ for_ordinality?: boolean;
+ is_not_null?: boolean;
+ colexpr?: Node;
+ coldefexpr?: Node;
+ location?: number;
+}
+export interface TypeName {
+ names?: Node[];
+ typeOid?: number;
+ setof?: boolean;
+ pct_type?: boolean;
+ typmods?: Node[];
+ typemod?: number;
+ arrayBounds?: Node[];
+ location?: number;
+}
+export interface ColumnDef {
+ colname?: string;
+ typeName?: TypeName;
+ inhcount?: number;
+ is_local?: boolean;
+ is_not_null?: boolean;
+ is_from_type?: boolean;
+ storage?: string;
+ raw_default?: Node;
+ cooked_default?: Node;
+ identity?: string;
+ identitySequence?: RangeVar;
+ generated?: string;
+ collClause?: CollateClause;
+ collOid?: number;
+ constraints?: Node[];
+ fdwoptions?: Node[];
+ location?: number;
+}
+export interface IndexElem {
+ name?: string;
+ expr?: Node;
+ indexcolname?: string;
+ collation?: Node[];
+ opclass?: Node[];
+ opclassopts?: Node[];
+ ordering?: SortByDir;
+ nulls_ordering?: SortByNulls;
+}
+export interface Constraint {
+ contype?: ConstrType;
+ conname?: string;
+ deferrable?: boolean;
+ initdeferred?: boolean;
+ location?: number;
+ is_no_inherit?: boolean;
+ raw_expr?: Node;
+ cooked_expr?: string;
+ generated_when?: string;
+ keys?: Node[];
+ including?: Node[];
+ exclusions?: Node[];
+ options?: Node[];
+ indexname?: string;
+ indexspace?: string;
+ reset_default_tblspc?: boolean;
+ access_method?: string;
+ where_clause?: Node;
+ pktable?: RangeVar;
+ fk_attrs?: Node[];
+ pk_attrs?: Node[];
+ fk_matchtype?: string;
+ fk_upd_action?: string;
+ fk_del_action?: string;
+ old_conpfeqop?: Node[];
+ old_pktable_oid?: number;
+ skip_validation?: boolean;
+ initially_valid?: boolean;
+}
+export interface DefElem {
+ defnamespace?: string;
+ defname?: string;
+ arg?: Node;
+ defaction?: DefElemAction;
+ location?: number;
+}
+export interface RangeTblEntry {
+ rtekind?: RTEKind;
+ relid?: number;
+ relkind?: string;
+ rellockmode?: number;
+ tablesample?: TableSampleClause;
+ subquery?: Query;
+ security_barrier?: boolean;
+ jointype?: JoinType;
+ joinmergedcols?: number;
+ joinaliasvars?: Node[];
+ joinleftcols?: Node[];
+ joinrightcols?: Node[];
+ functions?: Node[];
+ funcordinality?: boolean;
+ tablefunc?: TableFunc;
+ values_lists?: Node[];
+ ctename?: string;
+ ctelevelsup?: number;
+ self_reference?: boolean;
+ coltypes?: Node[];
+ coltypmods?: Node[];
+ colcollations?: Node[];
+ enrname?: string;
+ enrtuples?: number;
+ alias?: Alias;
+ eref?: Alias;
+ lateral?: boolean;
+ inh?: boolean;
+ inFromCl?: boolean;
+ requiredPerms?: number;
+ checkAsUser?: number;
+ selectedCols?: bigint[];
+ insertedCols?: bigint[];
+ updatedCols?: bigint[];
+ extraUpdatedCols?: bigint[];
+ securityQuals?: Node[];
+}
+export interface RangeTblFunction {
+ funcexpr?: Node;
+ funccolcount?: number;
+ funccolnames?: Node[];
+ funccoltypes?: Node[];
+ funccoltypmods?: Node[];
+ funccolcollations?: Node[];
+ funcparams?: bigint[];
+}
+export interface TableSampleClause {
+ tsmhandler?: number;
+ args?: Node[];
+ repeatable?: Node;
+}
+export interface WithCheckOption {
+ kind?: WCOKind;
+ relname?: string;
+ polname?: string;
+ qual?: Node;
+ cascaded?: boolean;
+}
+export interface SortGroupClause {
+ tleSortGroupRef?: number;
+ eqop?: number;
+ sortop?: number;
+ nulls_first?: boolean;
+ hashable?: boolean;
+}
+export interface GroupingSet {
+ kind?: GroupingSetKind;
+ content?: Node[];
+ location?: number;
+}
+export interface WindowClause {
+ name?: string;
+ refname?: string;
+ partitionClause?: Node[];
+ orderClause?: Node[];
+ frameOptions?: number;
+ startOffset?: Node;
+ endOffset?: Node;
+ startInRangeFunc?: number;
+ endInRangeFunc?: number;
+ inRangeColl?: number;
+ inRangeAsc?: boolean;
+ inRangeNullsFirst?: boolean;
+ winref?: number;
+ copiedOrder?: boolean;
+}
+export interface ObjectWithArgs {
+ objname?: Node[];
+ objargs?: Node[];
+ args_unspecified?: boolean;
+}
+export interface AccessPriv {
+ priv_name?: string;
+ cols?: Node[];
+}
+export interface CreateOpClassItem {
+ itemtype?: number;
+ name?: ObjectWithArgs;
+ number?: number;
+ order_family?: Node[];
+ class_args?: Node[];
+ storedtype?: TypeName;
+}
+export interface TableLikeClause {
+ relation?: RangeVar;
+ options?: number;
+ relationOid?: number;
+}
+export interface FunctionParameter {
+ name?: string;
+ argType?: TypeName;
+ mode?: FunctionParameterMode;
+ defexpr?: Node;
+}
+export interface LockingClause {
+ lockedRels?: Node[];
+ strength?: LockClauseStrength;
+ waitPolicy?: LockWaitPolicy;
+}
+export interface RowMarkClause {
+ rti?: number;
+ strength?: LockClauseStrength;
+ waitPolicy?: LockWaitPolicy;
+ pushedDown?: boolean;
+}
+export interface XmlSerialize {
+ xmloption?: XmlOptionType;
+ expr?: Node;
+ typeName?: TypeName;
+ location?: number;
+}
+export interface WithClause {
+ ctes?: Node[];
+ recursive?: boolean;
+ location?: number;
+}
+export interface InferClause {
+ indexElems?: Node[];
+ whereClause?: Node;
+ conname?: string;
+ location?: number;
+}
+export interface OnConflictClause {
+ action?: OnConflictAction;
+ infer?: InferClause;
+ targetList?: Node[];
+ whereClause?: Node;
+ location?: number;
+}
+export interface CommonTableExpr {
+ ctename?: string;
+ aliascolnames?: Node[];
+ ctematerialized?: CTEMaterialize;
+ ctequery?: Node;
+ location?: number;
+ cterecursive?: boolean;
+ cterefcount?: number;
+ ctecolnames?: Node[];
+ ctecoltypes?: Node[];
+ ctecoltypmods?: Node[];
+ ctecolcollations?: Node[];
+}
+export interface RoleSpec {
+ roletype?: RoleSpecType;
+ rolename?: string;
+ location?: number;
+}
+export interface TriggerTransition {
+ name?: string;
+ isNew?: boolean;
+ isTable?: boolean;
+}
+export interface PartitionElem {
+ name?: string;
+ expr?: Node;
+ collation?: Node[];
+ opclass?: Node[];
+ location?: number;
+}
+export interface PartitionSpec {
+ strategy?: string;
+ partParams?: Node[];
+ location?: number;
+}
+export interface PartitionBoundSpec {
+ strategy?: string;
+ is_default?: boolean;
+ modulus?: number;
+ remainder?: number;
+ listdatums?: Node[];
+ lowerdatums?: Node[];
+ upperdatums?: Node[];
+ location?: number;
+}
+export interface PartitionRangeDatum {
+ kind?: PartitionRangeDatumKind;
+ value?: Node;
+ location?: number;
+}
+export interface PartitionCmd {
+ name?: RangeVar;
+ bound?: PartitionBoundSpec;
+}
+export interface VacuumRelation {
+ relation?: RangeVar;
+ oid?: number;
+ va_cols?: Node[];
+}
+export interface InlineCodeBlock {
+ source_text?: string;
+ langOid?: number;
+ langIsTrusted?: boolean;
+ atomic?: boolean;
+}
+export interface CallContext {
+ atomic?: boolean;
+}
+export interface ScanToken {
+ start?: number;
+ end?: number;
+ token?: Token;
+ keywordKind?: KeywordKind;
+}
\ No newline at end of file
diff --git a/types/13/tsconfig.esm.json b/types/13/tsconfig.esm.json
new file mode 100644
index 00000000..800d7506
--- /dev/null
+++ b/types/13/tsconfig.esm.json
@@ -0,0 +1,9 @@
+{
+ "extends": "./tsconfig.json",
+ "compilerOptions": {
+ "outDir": "dist/esm",
+ "module": "es2022",
+ "rootDir": "src/",
+ "declaration": false
+ }
+}
diff --git a/types/13/tsconfig.json b/types/13/tsconfig.json
new file mode 100644
index 00000000..1a9d5696
--- /dev/null
+++ b/types/13/tsconfig.json
@@ -0,0 +1,9 @@
+{
+ "extends": "../../tsconfig.json",
+ "compilerOptions": {
+ "outDir": "dist",
+ "rootDir": "src/"
+ },
+ "include": ["src/**/*.ts"],
+ "exclude": ["dist", "node_modules", "**/*.spec.*", "**/*.test.*"]
+}
diff --git a/types/14/CHANGELOG.md b/types/14/CHANGELOG.md
new file mode 100644
index 00000000..a96e990c
--- /dev/null
+++ b/types/14/CHANGELOG.md
@@ -0,0 +1,40 @@
+# Change Log
+
+All notable changes to this project will be documented in this file.
+See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [17.4.2](https://github.com/launchql/pgsql-parser/compare/@pgsql/types@17.4.1...@pgsql/types@17.4.2) (2025-06-22)
+
+**Note:** Version bump only for package @pgsql/types
+
+
+
+
+
+## [17.4.1](https://github.com/launchql/pgsql-parser/compare/@pgsql/types@17.4.0...@pgsql/types@17.4.1) (2025-06-21)
+
+**Note:** Version bump only for package @pgsql/types
+
+
+
+
+
+# [17.4.0](https://github.com/launchql/pgsql-parser/compare/@pgsql/types@17.1.0...@pgsql/types@17.4.0) (2025-06-21)
+
+**Note:** Version bump only for package @pgsql/types
+
+
+
+
+
+# [17.2.0](https://github.com/launchql/pgsql-parser/compare/@pgsql/types@17.1.0...@pgsql/types@17.2.0) (2025-06-21)
+
+**Note:** Version bump only for package @pgsql/types
+
+
+
+
+
+# [17.1.0](https://github.com/launchql/pgsql-parser/compare/@pgsql/types@13.9.0...@pgsql/types@17.1.0) (2025-06-21)
+
+**Note:** Version bump only for package @pgsql/types
diff --git a/types/14/README.md b/types/14/README.md
new file mode 100644
index 00000000..81c50431
--- /dev/null
+++ b/types/14/README.md
@@ -0,0 +1,99 @@
+# @pgsql/types
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+`@pgsql/types` is a TypeScript library providing type definitions for PostgreSQL AST nodes, primarily used in conjunction with [`pgsql-parser`](https://github.com/launchql/pgsql-parser). It offers a comprehensive and type-safe way to interact with the AST nodes generated by PostgreSQL query parsing.
+
+
+## Installation
+
+Install the package via npm:
+
+```bash
+npm install @pgsql/types
+```
+
+## Usage
+
+`@pgsql/types` provides TypeScript type definitions for PostgreSQL Abstract Syntax Tree (AST) nodes. These types are useful for constructing, analyzing, or manipulating ASTs in a type-safe manner.
+
+Here are a few examples of how you can use these types in your TypeScript projects:
+
+### Validating AST Nodes
+
+You can use the types to validate AST nodes, ensuring they conform to the expected structure:
+
+```ts
+import { CreateStmt } from '@pgsql/types';
+
+function validateCreateStmt(stmt: CreateStmt) {
+ if (!stmt.relation || !stmt.tableElts) {
+ throw new Error('Invalid CreateStmt: missing required fields');
+ }
+ // Add more validation logic as needed
+ console.log('CreateStmt is valid');
+}
+
+// Example usage
+validateCreateStmt(createStmtObject);
+```
+
+### Constructing AST Nodes
+
+Types help ensure that you construct AST nodes correctly:
+
+```ts
+import { CreateStmt, ColumnDef, Constraint } from '@pgsql/types';
+
+const newColumn: ColumnDef = {
+ colname: 'id',
+ typeName: { names: [{ String: { str: 'int4' } }] },
+ constraints: [{ Constraint: { contype: 'CONSTR_PRIMARY' } }],
+};
+
+const createStmt: CreateStmt = {
+ relation: { relname: 'new_table' },
+ tableElts: [newColumn],
+};
+
+console.log(createStmt);
+```
+
+## Versions
+
+Our latest is built with PostgreSQL 17 AST types.
+
+| PG Major Version | libpg_query | npm dist-tag
+|--------------------------|-------------|---------|
+| 17 | 17-6.1.0 | [`pg17`](https://www.npmjs.com/package/@pgsql/types/v/latest)
+| 16 | 16-5.2.0 | [`pg16`](https://www.npmjs.com/package/@pgsql/types/v/pg16)
+| 15 | 15-4.2.4 | [`pg15`](https://www.npmjs.com/package/@pgsql/types/v/pg15)
+| 14 | 14-3.0.0 | [`pg14`](https://www.npmjs.com/package/@pgsql/types/v/pg14)
+| 13 | 13-2.2.0 | [`pg13`](https://www.npmjs.com/package/@pgsql/types/v/pg13)
+
+## Related
+
+* [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.
+* [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`.
+* [@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.
+* [@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.
+* [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.
+* [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.
+
+## Disclaimer
+
+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.
\ No newline at end of file
diff --git a/types/14/jest.config.js b/types/14/jest.config.js
new file mode 100644
index 00000000..0aa3aaa4
--- /dev/null
+++ b/types/14/jest.config.js
@@ -0,0 +1,18 @@
+/** @type {import('ts-jest').JestConfigWithTsJest} */
+module.exports = {
+ preset: "ts-jest",
+ testEnvironment: "node",
+ transform: {
+ "^.+\\.tsx?$": [
+ "ts-jest",
+ {
+ babelConfig: false,
+ tsconfig: "tsconfig.json",
+ },
+ ],
+ },
+ transformIgnorePatterns: [`/node_modules/*`],
+ testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
+ moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
+ modulePathIgnorePatterns: ["dist/*"]
+};
diff --git a/types/14/package.json b/types/14/package.json
new file mode 100644
index 00000000..998510e4
--- /dev/null
+++ b/types/14/package.json
@@ -0,0 +1,39 @@
+{
+ "name": "@libpg-query/types14",
+ "version": "14.0.1",
+ "author": "Dan Lynch ",
+ "description": "PostgreSQL AST types from the real Postgres parser",
+ "main": "index.js",
+ "module": "esm/index.js",
+ "types": "index.d.ts",
+ "homepage": "https://github.com/launchql/libpg-query-node",
+ "license": "SEE LICENSE IN LICENSE",
+ "publishConfig": {
+ "access": "public",
+ "directory": "dist"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/launchql/libpg-query-node"
+ },
+ "bugs": {
+ "url": "https://github.com/launchql/libpg-query-node/issues"
+ },
+ "x-publish": {
+ "publishName": "@pgsql/types",
+ "distTag": "pg14"
+ },
+ "scripts": {
+ "copy": "copyfiles -f ../../LICENSE README.md package.json dist",
+ "clean": "rimraf dist",
+ "build": "pnpm run clean && tsc && tsc -p tsconfig.esm.json && pnpm run copy",
+ "build:dev": "pnpm run clean && tsc --declarationMap && tsc -p tsconfig.esm.json && pnpm run copy",
+ "build:proto": "ts-node scripts/pg-proto-parser",
+ "prepare:types": "node -e \"require('../../scripts/prepare-types.js').preparePackageForPublish('.')\"",
+ "lint": "eslint . --fix"
+ },
+ "keywords": [],
+ "devDependencies": {
+ "pg-proto-parser": "^1.28.2"
+ }
+}
diff --git a/types/14/scripts/pg-proto-parser.ts b/types/14/scripts/pg-proto-parser.ts
new file mode 100644
index 00000000..69038d48
--- /dev/null
+++ b/types/14/scripts/pg-proto-parser.ts
@@ -0,0 +1,20 @@
+import { PgProtoParser, PgProtoParserOptions } from 'pg-proto-parser';
+import { resolve, join } from 'path';
+
+const inFile: string = join(__dirname, '../../../protos/14/pg_query.proto');
+const outDir: string = resolve(join(__dirname, '../src'));
+
+const options: PgProtoParserOptions = {
+ outDir,
+ types: {
+ enabled: true,
+ wrappedNodeTypeExport: true
+ },
+ enums: {
+ enabled: true,
+ enumsAsTypeUnion: true
+ }
+};
+const parser = new PgProtoParser(inFile, options);
+
+parser.write();
diff --git a/types/14/src/enums.ts b/types/14/src/enums.ts
new file mode 100644
index 00000000..5d71e52f
--- /dev/null
+++ b/types/14/src/enums.ts
@@ -0,0 +1,62 @@
+/**
+* This file was automatically generated by pg-proto-parser@1.28.2.
+* DO NOT MODIFY IT BY HAND. Instead, modify the source proto file,
+* and run the pg-proto-parser generate command to regenerate this file.
+*/
+export type OverridingKind = "OVERRIDING_NOT_SET" | "OVERRIDING_USER_VALUE" | "OVERRIDING_SYSTEM_VALUE";
+export type QuerySource = "QSRC_ORIGINAL" | "QSRC_PARSER" | "QSRC_INSTEAD_RULE" | "QSRC_QUAL_INSTEAD_RULE" | "QSRC_NON_INSTEAD_RULE";
+export type SortByDir = "SORTBY_DEFAULT" | "SORTBY_ASC" | "SORTBY_DESC" | "SORTBY_USING";
+export type SortByNulls = "SORTBY_NULLS_DEFAULT" | "SORTBY_NULLS_FIRST" | "SORTBY_NULLS_LAST";
+export type SetQuantifier = "SET_QUANTIFIER_DEFAULT" | "SET_QUANTIFIER_ALL" | "SET_QUANTIFIER_DISTINCT";
+export type A_Expr_Kind = "AEXPR_OP" | "AEXPR_OP_ANY" | "AEXPR_OP_ALL" | "AEXPR_DISTINCT" | "AEXPR_NOT_DISTINCT" | "AEXPR_NULLIF" | "AEXPR_IN" | "AEXPR_LIKE" | "AEXPR_ILIKE" | "AEXPR_SIMILAR" | "AEXPR_BETWEEN" | "AEXPR_NOT_BETWEEN" | "AEXPR_BETWEEN_SYM" | "AEXPR_NOT_BETWEEN_SYM";
+export type RoleSpecType = "ROLESPEC_CSTRING" | "ROLESPEC_CURRENT_ROLE" | "ROLESPEC_CURRENT_USER" | "ROLESPEC_SESSION_USER" | "ROLESPEC_PUBLIC";
+export type TableLikeOption = "CREATE_TABLE_LIKE_COMMENTS" | "CREATE_TABLE_LIKE_COMPRESSION" | "CREATE_TABLE_LIKE_CONSTRAINTS" | "CREATE_TABLE_LIKE_DEFAULTS" | "CREATE_TABLE_LIKE_GENERATED" | "CREATE_TABLE_LIKE_IDENTITY" | "CREATE_TABLE_LIKE_INDEXES" | "CREATE_TABLE_LIKE_STATISTICS" | "CREATE_TABLE_LIKE_STORAGE" | "CREATE_TABLE_LIKE_ALL";
+export type DefElemAction = "DEFELEM_UNSPEC" | "DEFELEM_SET" | "DEFELEM_ADD" | "DEFELEM_DROP";
+export type PartitionRangeDatumKind = "PARTITION_RANGE_DATUM_MINVALUE" | "PARTITION_RANGE_DATUM_VALUE" | "PARTITION_RANGE_DATUM_MAXVALUE";
+export type RTEKind = "RTE_RELATION" | "RTE_SUBQUERY" | "RTE_JOIN" | "RTE_FUNCTION" | "RTE_TABLEFUNC" | "RTE_VALUES" | "RTE_CTE" | "RTE_NAMEDTUPLESTORE" | "RTE_RESULT";
+export type WCOKind = "WCO_VIEW_CHECK" | "WCO_RLS_INSERT_CHECK" | "WCO_RLS_UPDATE_CHECK" | "WCO_RLS_CONFLICT_CHECK";
+export type GroupingSetKind = "GROUPING_SET_EMPTY" | "GROUPING_SET_SIMPLE" | "GROUPING_SET_ROLLUP" | "GROUPING_SET_CUBE" | "GROUPING_SET_SETS";
+export type CTEMaterialize = "CTEMaterializeDefault" | "CTEMaterializeAlways" | "CTEMaterializeNever";
+export type SetOperation = "SETOP_NONE" | "SETOP_UNION" | "SETOP_INTERSECT" | "SETOP_EXCEPT";
+export type ObjectType = "OBJECT_ACCESS_METHOD" | "OBJECT_AGGREGATE" | "OBJECT_AMOP" | "OBJECT_AMPROC" | "OBJECT_ATTRIBUTE" | "OBJECT_CAST" | "OBJECT_COLUMN" | "OBJECT_COLLATION" | "OBJECT_CONVERSION" | "OBJECT_DATABASE" | "OBJECT_DEFAULT" | "OBJECT_DEFACL" | "OBJECT_DOMAIN" | "OBJECT_DOMCONSTRAINT" | "OBJECT_EVENT_TRIGGER" | "OBJECT_EXTENSION" | "OBJECT_FDW" | "OBJECT_FOREIGN_SERVER" | "OBJECT_FOREIGN_TABLE" | "OBJECT_FUNCTION" | "OBJECT_INDEX" | "OBJECT_LANGUAGE" | "OBJECT_LARGEOBJECT" | "OBJECT_MATVIEW" | "OBJECT_OPCLASS" | "OBJECT_OPERATOR" | "OBJECT_OPFAMILY" | "OBJECT_POLICY" | "OBJECT_PROCEDURE" | "OBJECT_PUBLICATION" | "OBJECT_PUBLICATION_REL" | "OBJECT_ROLE" | "OBJECT_ROUTINE" | "OBJECT_RULE" | "OBJECT_SCHEMA" | "OBJECT_SEQUENCE" | "OBJECT_SUBSCRIPTION" | "OBJECT_STATISTIC_EXT" | "OBJECT_TABCONSTRAINT" | "OBJECT_TABLE" | "OBJECT_TABLESPACE" | "OBJECT_TRANSFORM" | "OBJECT_TRIGGER" | "OBJECT_TSCONFIGURATION" | "OBJECT_TSDICTIONARY" | "OBJECT_TSPARSER" | "OBJECT_TSTEMPLATE" | "OBJECT_TYPE" | "OBJECT_USER_MAPPING" | "OBJECT_VIEW";
+export type DropBehavior = "DROP_RESTRICT" | "DROP_CASCADE";
+export type AlterTableType = "AT_AddColumn" | "AT_AddColumnRecurse" | "AT_AddColumnToView" | "AT_ColumnDefault" | "AT_CookedColumnDefault" | "AT_DropNotNull" | "AT_SetNotNull" | "AT_DropExpression" | "AT_CheckNotNull" | "AT_SetStatistics" | "AT_SetOptions" | "AT_ResetOptions" | "AT_SetStorage" | "AT_SetCompression" | "AT_DropColumn" | "AT_DropColumnRecurse" | "AT_AddIndex" | "AT_ReAddIndex" | "AT_AddConstraint" | "AT_AddConstraintRecurse" | "AT_ReAddConstraint" | "AT_ReAddDomainConstraint" | "AT_AlterConstraint" | "AT_ValidateConstraint" | "AT_ValidateConstraintRecurse" | "AT_AddIndexConstraint" | "AT_DropConstraint" | "AT_DropConstraintRecurse" | "AT_ReAddComment" | "AT_AlterColumnType" | "AT_AlterColumnGenericOptions" | "AT_ChangeOwner" | "AT_ClusterOn" | "AT_DropCluster" | "AT_SetLogged" | "AT_SetUnLogged" | "AT_DropOids" | "AT_SetTableSpace" | "AT_SetRelOptions" | "AT_ResetRelOptions" | "AT_ReplaceRelOptions" | "AT_EnableTrig" | "AT_EnableAlwaysTrig" | "AT_EnableReplicaTrig" | "AT_DisableTrig" | "AT_EnableTrigAll" | "AT_DisableTrigAll" | "AT_EnableTrigUser" | "AT_DisableTrigUser" | "AT_EnableRule" | "AT_EnableAlwaysRule" | "AT_EnableReplicaRule" | "AT_DisableRule" | "AT_AddInherit" | "AT_DropInherit" | "AT_AddOf" | "AT_DropOf" | "AT_ReplicaIdentity" | "AT_EnableRowSecurity" | "AT_DisableRowSecurity" | "AT_ForceRowSecurity" | "AT_NoForceRowSecurity" | "AT_GenericOptions" | "AT_AttachPartition" | "AT_DetachPartition" | "AT_DetachPartitionFinalize" | "AT_AddIdentity" | "AT_SetIdentity" | "AT_DropIdentity" | "AT_ReAddStatistics";
+export type GrantTargetType = "ACL_TARGET_OBJECT" | "ACL_TARGET_ALL_IN_SCHEMA" | "ACL_TARGET_DEFAULTS";
+export type VariableSetKind = "VAR_SET_VALUE" | "VAR_SET_DEFAULT" | "VAR_SET_CURRENT" | "VAR_SET_MULTI" | "VAR_RESET" | "VAR_RESET_ALL";
+export type ConstrType = "CONSTR_NULL" | "CONSTR_NOTNULL" | "CONSTR_DEFAULT" | "CONSTR_IDENTITY" | "CONSTR_GENERATED" | "CONSTR_CHECK" | "CONSTR_PRIMARY" | "CONSTR_UNIQUE" | "CONSTR_EXCLUSION" | "CONSTR_FOREIGN" | "CONSTR_ATTR_DEFERRABLE" | "CONSTR_ATTR_NOT_DEFERRABLE" | "CONSTR_ATTR_DEFERRED" | "CONSTR_ATTR_IMMEDIATE";
+export type ImportForeignSchemaType = "FDW_IMPORT_SCHEMA_ALL" | "FDW_IMPORT_SCHEMA_LIMIT_TO" | "FDW_IMPORT_SCHEMA_EXCEPT";
+export type RoleStmtType = "ROLESTMT_ROLE" | "ROLESTMT_USER" | "ROLESTMT_GROUP";
+export type FetchDirection = "FETCH_FORWARD" | "FETCH_BACKWARD" | "FETCH_ABSOLUTE" | "FETCH_RELATIVE";
+export type FunctionParameterMode = "FUNC_PARAM_IN" | "FUNC_PARAM_OUT" | "FUNC_PARAM_INOUT" | "FUNC_PARAM_VARIADIC" | "FUNC_PARAM_TABLE" | "FUNC_PARAM_DEFAULT";
+export type TransactionStmtKind = "TRANS_STMT_BEGIN" | "TRANS_STMT_START" | "TRANS_STMT_COMMIT" | "TRANS_STMT_ROLLBACK" | "TRANS_STMT_SAVEPOINT" | "TRANS_STMT_RELEASE" | "TRANS_STMT_ROLLBACK_TO" | "TRANS_STMT_PREPARE" | "TRANS_STMT_COMMIT_PREPARED" | "TRANS_STMT_ROLLBACK_PREPARED";
+export type ViewCheckOption = "NO_CHECK_OPTION" | "LOCAL_CHECK_OPTION" | "CASCADED_CHECK_OPTION";
+export type DiscardMode = "DISCARD_ALL" | "DISCARD_PLANS" | "DISCARD_SEQUENCES" | "DISCARD_TEMP";
+export type ReindexObjectType = "REINDEX_OBJECT_INDEX" | "REINDEX_OBJECT_TABLE" | "REINDEX_OBJECT_SCHEMA" | "REINDEX_OBJECT_SYSTEM" | "REINDEX_OBJECT_DATABASE";
+export type AlterTSConfigType = "ALTER_TSCONFIG_ADD_MAPPING" | "ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN" | "ALTER_TSCONFIG_REPLACE_DICT" | "ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN" | "ALTER_TSCONFIG_DROP_MAPPING";
+export type AlterSubscriptionType = "ALTER_SUBSCRIPTION_OPTIONS" | "ALTER_SUBSCRIPTION_CONNECTION" | "ALTER_SUBSCRIPTION_SET_PUBLICATION" | "ALTER_SUBSCRIPTION_ADD_PUBLICATION" | "ALTER_SUBSCRIPTION_DROP_PUBLICATION" | "ALTER_SUBSCRIPTION_REFRESH" | "ALTER_SUBSCRIPTION_ENABLED";
+export type OnCommitAction = "ONCOMMIT_NOOP" | "ONCOMMIT_PRESERVE_ROWS" | "ONCOMMIT_DELETE_ROWS" | "ONCOMMIT_DROP";
+export type ParamKind = "PARAM_EXTERN" | "PARAM_EXEC" | "PARAM_SUBLINK" | "PARAM_MULTIEXPR";
+export type CoercionContext = "COERCION_IMPLICIT" | "COERCION_ASSIGNMENT" | "COERCION_PLPGSQL" | "COERCION_EXPLICIT";
+export type CoercionForm = "COERCE_EXPLICIT_CALL" | "COERCE_EXPLICIT_CAST" | "COERCE_IMPLICIT_CAST" | "COERCE_SQL_SYNTAX";
+export type BoolExprType = "AND_EXPR" | "OR_EXPR" | "NOT_EXPR";
+export type SubLinkType = "EXISTS_SUBLINK" | "ALL_SUBLINK" | "ANY_SUBLINK" | "ROWCOMPARE_SUBLINK" | "EXPR_SUBLINK" | "MULTIEXPR_SUBLINK" | "ARRAY_SUBLINK" | "CTE_SUBLINK";
+export type RowCompareType = "ROWCOMPARE_LT" | "ROWCOMPARE_LE" | "ROWCOMPARE_EQ" | "ROWCOMPARE_GE" | "ROWCOMPARE_GT" | "ROWCOMPARE_NE";
+export type MinMaxOp = "IS_GREATEST" | "IS_LEAST";
+export type SQLValueFunctionOp = "SVFOP_CURRENT_DATE" | "SVFOP_CURRENT_TIME" | "SVFOP_CURRENT_TIME_N" | "SVFOP_CURRENT_TIMESTAMP" | "SVFOP_CURRENT_TIMESTAMP_N" | "SVFOP_LOCALTIME" | "SVFOP_LOCALTIME_N" | "SVFOP_LOCALTIMESTAMP" | "SVFOP_LOCALTIMESTAMP_N" | "SVFOP_CURRENT_ROLE" | "SVFOP_CURRENT_USER" | "SVFOP_USER" | "SVFOP_SESSION_USER" | "SVFOP_CURRENT_CATALOG" | "SVFOP_CURRENT_SCHEMA";
+export type XmlExprOp = "IS_XMLCONCAT" | "IS_XMLELEMENT" | "IS_XMLFOREST" | "IS_XMLPARSE" | "IS_XMLPI" | "IS_XMLROOT" | "IS_XMLSERIALIZE" | "IS_DOCUMENT";
+export type XmlOptionType = "XMLOPTION_DOCUMENT" | "XMLOPTION_CONTENT";
+export type NullTestType = "IS_NULL" | "IS_NOT_NULL";
+export type BoolTestType = "IS_TRUE" | "IS_NOT_TRUE" | "IS_FALSE" | "IS_NOT_FALSE" | "IS_UNKNOWN" | "IS_NOT_UNKNOWN";
+export type CmdType = "CMD_UNKNOWN" | "CMD_SELECT" | "CMD_UPDATE" | "CMD_INSERT" | "CMD_DELETE" | "CMD_UTILITY" | "CMD_NOTHING";
+export type JoinType = "JOIN_INNER" | "JOIN_LEFT" | "JOIN_FULL" | "JOIN_RIGHT" | "JOIN_SEMI" | "JOIN_ANTI" | "JOIN_UNIQUE_OUTER" | "JOIN_UNIQUE_INNER";
+export type AggStrategy = "AGG_PLAIN" | "AGG_SORTED" | "AGG_HASHED" | "AGG_MIXED";
+export type AggSplit = "AGGSPLIT_SIMPLE" | "AGGSPLIT_INITIAL_SERIAL" | "AGGSPLIT_FINAL_DESERIAL";
+export type SetOpCmd = "SETOPCMD_INTERSECT" | "SETOPCMD_INTERSECT_ALL" | "SETOPCMD_EXCEPT" | "SETOPCMD_EXCEPT_ALL";
+export type SetOpStrategy = "SETOP_SORTED" | "SETOP_HASHED";
+export type OnConflictAction = "ONCONFLICT_NONE" | "ONCONFLICT_NOTHING" | "ONCONFLICT_UPDATE";
+export type LimitOption = "LIMIT_OPTION_DEFAULT" | "LIMIT_OPTION_COUNT" | "LIMIT_OPTION_WITH_TIES";
+export type LockClauseStrength = "LCS_NONE" | "LCS_FORKEYSHARE" | "LCS_FORSHARE" | "LCS_FORNOKEYUPDATE" | "LCS_FORUPDATE";
+export type LockWaitPolicy = "LockWaitBlock" | "LockWaitSkip" | "LockWaitError";
+export type LockTupleMode = "LockTupleKeyShare" | "LockTupleShare" | "LockTupleNoKeyExclusive" | "LockTupleExclusive";
+export type KeywordKind = "NO_KEYWORD" | "UNRESERVED_KEYWORD" | "COL_NAME_KEYWORD" | "TYPE_FUNC_NAME_KEYWORD" | "RESERVED_KEYWORD";
+export type Token = "NUL" | "ASCII_37" | "ASCII_40" | "ASCII_41" | "ASCII_42" | "ASCII_43" | "ASCII_44" | "ASCII_45" | "ASCII_46" | "ASCII_47" | "ASCII_58" | "ASCII_59" | "ASCII_60" | "ASCII_61" | "ASCII_62" | "ASCII_63" | "ASCII_91" | "ASCII_92" | "ASCII_93" | "ASCII_94" | "IDENT" | "UIDENT" | "FCONST" | "SCONST" | "USCONST" | "BCONST" | "XCONST" | "Op" | "ICONST" | "PARAM" | "TYPECAST" | "DOT_DOT" | "COLON_EQUALS" | "EQUALS_GREATER" | "LESS_EQUALS" | "GREATER_EQUALS" | "NOT_EQUALS" | "SQL_COMMENT" | "C_COMMENT" | "ABORT_P" | "ABSOLUTE_P" | "ACCESS" | "ACTION" | "ADD_P" | "ADMIN" | "AFTER" | "AGGREGATE" | "ALL" | "ALSO" | "ALTER" | "ALWAYS" | "ANALYSE" | "ANALYZE" | "AND" | "ANY" | "ARRAY" | "AS" | "ASC" | "ASENSITIVE" | "ASSERTION" | "ASSIGNMENT" | "ASYMMETRIC" | "ATOMIC" | "AT" | "ATTACH" | "ATTRIBUTE" | "AUTHORIZATION" | "BACKWARD" | "BEFORE" | "BEGIN_P" | "BETWEEN" | "BIGINT" | "BINARY" | "BIT" | "BOOLEAN_P" | "BOTH" | "BREADTH" | "BY" | "CACHE" | "CALL" | "CALLED" | "CASCADE" | "CASCADED" | "CASE" | "CAST" | "CATALOG_P" | "CHAIN" | "CHAR_P" | "CHARACTER" | "CHARACTERISTICS" | "CHECK" | "CHECKPOINT" | "CLASS" | "CLOSE" | "CLUSTER" | "COALESCE" | "COLLATE" | "COLLATION" | "COLUMN" | "COLUMNS" | "COMMENT" | "COMMENTS" | "COMMIT" | "COMMITTED" | "COMPRESSION" | "CONCURRENTLY" | "CONFIGURATION" | "CONFLICT" | "CONNECTION" | "CONSTRAINT" | "CONSTRAINTS" | "CONTENT_P" | "CONTINUE_P" | "CONVERSION_P" | "COPY" | "COST" | "CREATE" | "CROSS" | "CSV" | "CUBE" | "CURRENT_P" | "CURRENT_CATALOG" | "CURRENT_DATE" | "CURRENT_ROLE" | "CURRENT_SCHEMA" | "CURRENT_TIME" | "CURRENT_TIMESTAMP" | "CURRENT_USER" | "CURSOR" | "CYCLE" | "DATA_P" | "DATABASE" | "DAY_P" | "DEALLOCATE" | "DEC" | "DECIMAL_P" | "DECLARE" | "DEFAULT" | "DEFAULTS" | "DEFERRABLE" | "DEFERRED" | "DEFINER" | "DELETE_P" | "DELIMITER" | "DELIMITERS" | "DEPENDS" | "DEPTH" | "DESC" | "DETACH" | "DICTIONARY" | "DISABLE_P" | "DISCARD" | "DISTINCT" | "DO" | "DOCUMENT_P" | "DOMAIN_P" | "DOUBLE_P" | "DROP" | "EACH" | "ELSE" | "ENABLE_P" | "ENCODING" | "ENCRYPTED" | "END_P" | "ENUM_P" | "ESCAPE" | "EVENT" | "EXCEPT" | "EXCLUDE" | "EXCLUDING" | "EXCLUSIVE" | "EXECUTE" | "EXISTS" | "EXPLAIN" | "EXPRESSION" | "EXTENSION" | "EXTERNAL" | "EXTRACT" | "FALSE_P" | "FAMILY" | "FETCH" | "FILTER" | "FINALIZE" | "FIRST_P" | "FLOAT_P" | "FOLLOWING" | "FOR" | "FORCE" | "FOREIGN" | "FORWARD" | "FREEZE" | "FROM" | "FULL" | "FUNCTION" | "FUNCTIONS" | "GENERATED" | "GLOBAL" | "GRANT" | "GRANTED" | "GREATEST" | "GROUP_P" | "GROUPING" | "GROUPS" | "HANDLER" | "HAVING" | "HEADER_P" | "HOLD" | "HOUR_P" | "IDENTITY_P" | "IF_P" | "ILIKE" | "IMMEDIATE" | "IMMUTABLE" | "IMPLICIT_P" | "IMPORT_P" | "IN_P" | "INCLUDE" | "INCLUDING" | "INCREMENT" | "INDEX" | "INDEXES" | "INHERIT" | "INHERITS" | "INITIALLY" | "INLINE_P" | "INNER_P" | "INOUT" | "INPUT_P" | "INSENSITIVE" | "INSERT" | "INSTEAD" | "INT_P" | "INTEGER" | "INTERSECT" | "INTERVAL" | "INTO" | "INVOKER" | "IS" | "ISNULL" | "ISOLATION" | "JOIN" | "KEY" | "LABEL" | "LANGUAGE" | "LARGE_P" | "LAST_P" | "LATERAL_P" | "LEADING" | "LEAKPROOF" | "LEAST" | "LEFT" | "LEVEL" | "LIKE" | "LIMIT" | "LISTEN" | "LOAD" | "LOCAL" | "LOCALTIME" | "LOCALTIMESTAMP" | "LOCATION" | "LOCK_P" | "LOCKED" | "LOGGED" | "MAPPING" | "MATCH" | "MATERIALIZED" | "MAXVALUE" | "METHOD" | "MINUTE_P" | "MINVALUE" | "MODE" | "MONTH_P" | "MOVE" | "NAME_P" | "NAMES" | "NATIONAL" | "NATURAL" | "NCHAR" | "NEW" | "NEXT" | "NFC" | "NFD" | "NFKC" | "NFKD" | "NO" | "NONE" | "NORMALIZE" | "NORMALIZED" | "NOT" | "NOTHING" | "NOTIFY" | "NOTNULL" | "NOWAIT" | "NULL_P" | "NULLIF" | "NULLS_P" | "NUMERIC" | "OBJECT_P" | "OF" | "OFF" | "OFFSET" | "OIDS" | "OLD" | "ON" | "ONLY" | "OPERATOR" | "OPTION" | "OPTIONS" | "OR" | "ORDER" | "ORDINALITY" | "OTHERS" | "OUT_P" | "OUTER_P" | "OVER" | "OVERLAPS" | "OVERLAY" | "OVERRIDING" | "OWNED" | "OWNER" | "PARALLEL" | "PARSER" | "PARTIAL" | "PARTITION" | "PASSING" | "PASSWORD" | "PLACING" | "PLANS" | "POLICY" | "POSITION" | "PRECEDING" | "PRECISION" | "PRESERVE" | "PREPARE" | "PREPARED" | "PRIMARY" | "PRIOR" | "PRIVILEGES" | "PROCEDURAL" | "PROCEDURE" | "PROCEDURES" | "PROGRAM" | "PUBLICATION" | "QUOTE" | "RANGE" | "READ" | "REAL" | "REASSIGN" | "RECHECK" | "RECURSIVE" | "REF_P" | "REFERENCES" | "REFERENCING" | "REFRESH" | "REINDEX" | "RELATIVE_P" | "RELEASE" | "RENAME" | "REPEATABLE" | "REPLACE" | "REPLICA" | "RESET" | "RESTART" | "RESTRICT" | "RETURN" | "RETURNING" | "RETURNS" | "REVOKE" | "RIGHT" | "ROLE" | "ROLLBACK" | "ROLLUP" | "ROUTINE" | "ROUTINES" | "ROW" | "ROWS" | "RULE" | "SAVEPOINT" | "SCHEMA" | "SCHEMAS" | "SCROLL" | "SEARCH" | "SECOND_P" | "SECURITY" | "SELECT" | "SEQUENCE" | "SEQUENCES" | "SERIALIZABLE" | "SERVER" | "SESSION" | "SESSION_USER" | "SET" | "SETS" | "SETOF" | "SHARE" | "SHOW" | "SIMILAR" | "SIMPLE" | "SKIP" | "SMALLINT" | "SNAPSHOT" | "SOME" | "SQL_P" | "STABLE" | "STANDALONE_P" | "START" | "STATEMENT" | "STATISTICS" | "STDIN" | "STDOUT" | "STORAGE" | "STORED" | "STRICT_P" | "STRIP_P" | "SUBSCRIPTION" | "SUBSTRING" | "SUPPORT" | "SYMMETRIC" | "SYSID" | "SYSTEM_P" | "TABLE" | "TABLES" | "TABLESAMPLE" | "TABLESPACE" | "TEMP" | "TEMPLATE" | "TEMPORARY" | "TEXT_P" | "THEN" | "TIES" | "TIME" | "TIMESTAMP" | "TO" | "TRAILING" | "TRANSACTION" | "TRANSFORM" | "TREAT" | "TRIGGER" | "TRIM" | "TRUE_P" | "TRUNCATE" | "TRUSTED" | "TYPE_P" | "TYPES_P" | "UESCAPE" | "UNBOUNDED" | "UNCOMMITTED" | "UNENCRYPTED" | "UNION" | "UNIQUE" | "UNKNOWN" | "UNLISTEN" | "UNLOGGED" | "UNTIL" | "UPDATE" | "USER" | "USING" | "VACUUM" | "VALID" | "VALIDATE" | "VALIDATOR" | "VALUE_P" | "VALUES" | "VARCHAR" | "VARIADIC" | "VARYING" | "VERBOSE" | "VERSION_P" | "VIEW" | "VIEWS" | "VOLATILE" | "WHEN" | "WHERE" | "WHITESPACE_P" | "WINDOW" | "WITH" | "WITHIN" | "WITHOUT" | "WORK" | "WRAPPER" | "WRITE" | "XML_P" | "XMLATTRIBUTES" | "XMLCONCAT" | "XMLELEMENT" | "XMLEXISTS" | "XMLFOREST" | "XMLNAMESPACES" | "XMLPARSE" | "XMLPI" | "XMLROOT" | "XMLSERIALIZE" | "XMLTABLE" | "YEAR_P" | "YES_P" | "ZONE" | "NOT_LA" | "NULLS_LA" | "WITH_LA" | "MODE_TYPE_NAME" | "MODE_PLPGSQL_EXPR" | "MODE_PLPGSQL_ASSIGN1" | "MODE_PLPGSQL_ASSIGN2" | "MODE_PLPGSQL_ASSIGN3" | "UMINUS";
\ No newline at end of file
diff --git a/types/14/src/index.ts b/types/14/src/index.ts
new file mode 100644
index 00000000..dc5ee069
--- /dev/null
+++ b/types/14/src/index.ts
@@ -0,0 +1,2 @@
+export * from './types';
+export * from './enums';
diff --git a/types/14/src/types.ts b/types/14/src/types.ts
new file mode 100644
index 00000000..f9e3de8a
--- /dev/null
+++ b/types/14/src/types.ts
@@ -0,0 +1,2160 @@
+/**
+* This file was automatically generated by pg-proto-parser@1.28.2.
+* DO NOT MODIFY IT BY HAND. Instead, modify the source proto file,
+* and run the pg-proto-parser generate command to regenerate this file.
+*/
+import { OverridingKind, QuerySource, SortByDir, SortByNulls, SetQuantifier, A_Expr_Kind, RoleSpecType, TableLikeOption, DefElemAction, PartitionRangeDatumKind, RTEKind, WCOKind, GroupingSetKind, CTEMaterialize, SetOperation, ObjectType, DropBehavior, AlterTableType, GrantTargetType, VariableSetKind, ConstrType, ImportForeignSchemaType, RoleStmtType, FetchDirection, FunctionParameterMode, TransactionStmtKind, ViewCheckOption, DiscardMode, ReindexObjectType, AlterTSConfigType, AlterSubscriptionType, OnCommitAction, ParamKind, CoercionContext, CoercionForm, BoolExprType, SubLinkType, RowCompareType, MinMaxOp, SQLValueFunctionOp, XmlExprOp, XmlOptionType, NullTestType, BoolTestType, CmdType, JoinType, AggStrategy, AggSplit, SetOpCmd, SetOpStrategy, OnConflictAction, LimitOption, LockClauseStrength, LockWaitPolicy, LockTupleMode, KeywordKind, Token } from "./enums";
+export type Node = {
+ ParseResult: ParseResult;
+} | {
+ ScanResult: ScanResult;
+} | {
+ Integer: Integer;
+} | {
+ Float: Float;
+} | {
+ String: String;
+} | {
+ BitString: BitString;
+} | {
+ Null: Null;
+} | {
+ List: List;
+} | {
+ OidList: OidList;
+} | {
+ IntList: IntList;
+} | {
+ Alias: Alias;
+} | {
+ RangeVar: RangeVar;
+} | {
+ TableFunc: TableFunc;
+} | {
+ Expr: Expr;
+} | {
+ Var: Var;
+} | {
+ Param: Param;
+} | {
+ Aggref: Aggref;
+} | {
+ GroupingFunc: GroupingFunc;
+} | {
+ WindowFunc: WindowFunc;
+} | {
+ SubscriptingRef: SubscriptingRef;
+} | {
+ FuncExpr: FuncExpr;
+} | {
+ NamedArgExpr: NamedArgExpr;
+} | {
+ OpExpr: OpExpr;
+} | {
+ DistinctExpr: DistinctExpr;
+} | {
+ NullIfExpr: NullIfExpr;
+} | {
+ ScalarArrayOpExpr: ScalarArrayOpExpr;
+} | {
+ BoolExpr: BoolExpr;
+} | {
+ SubLink: SubLink;
+} | {
+ SubPlan: SubPlan;
+} | {
+ AlternativeSubPlan: AlternativeSubPlan;
+} | {
+ FieldSelect: FieldSelect;
+} | {
+ FieldStore: FieldStore;
+} | {
+ RelabelType: RelabelType;
+} | {
+ CoerceViaIO: CoerceViaIO;
+} | {
+ ArrayCoerceExpr: ArrayCoerceExpr;
+} | {
+ ConvertRowtypeExpr: ConvertRowtypeExpr;
+} | {
+ CollateExpr: CollateExpr;
+} | {
+ CaseExpr: CaseExpr;
+} | {
+ CaseWhen: CaseWhen;
+} | {
+ CaseTestExpr: CaseTestExpr;
+} | {
+ ArrayExpr: ArrayExpr;
+} | {
+ RowExpr: RowExpr;
+} | {
+ RowCompareExpr: RowCompareExpr;
+} | {
+ CoalesceExpr: CoalesceExpr;
+} | {
+ MinMaxExpr: MinMaxExpr;
+} | {
+ SQLValueFunction: SQLValueFunction;
+} | {
+ XmlExpr: XmlExpr;
+} | {
+ NullTest: NullTest;
+} | {
+ BooleanTest: BooleanTest;
+} | {
+ CoerceToDomain: CoerceToDomain;
+} | {
+ CoerceToDomainValue: CoerceToDomainValue;
+} | {
+ SetToDefault: SetToDefault;
+} | {
+ CurrentOfExpr: CurrentOfExpr;
+} | {
+ NextValueExpr: NextValueExpr;
+} | {
+ InferenceElem: InferenceElem;
+} | {
+ TargetEntry: TargetEntry;
+} | {
+ RangeTblRef: RangeTblRef;
+} | {
+ JoinExpr: JoinExpr;
+} | {
+ FromExpr: FromExpr;
+} | {
+ OnConflictExpr: OnConflictExpr;
+} | {
+ IntoClause: IntoClause;
+} | {
+ RawStmt: RawStmt;
+} | {
+ Query: Query;
+} | {
+ InsertStmt: InsertStmt;
+} | {
+ DeleteStmt: DeleteStmt;
+} | {
+ UpdateStmt: UpdateStmt;
+} | {
+ SelectStmt: SelectStmt;
+} | {
+ ReturnStmt: ReturnStmt;
+} | {
+ PLAssignStmt: PLAssignStmt;
+} | {
+ AlterTableStmt: AlterTableStmt;
+} | {
+ AlterTableCmd: AlterTableCmd;
+} | {
+ AlterDomainStmt: AlterDomainStmt;
+} | {
+ SetOperationStmt: SetOperationStmt;
+} | {
+ GrantStmt: GrantStmt;
+} | {
+ GrantRoleStmt: GrantRoleStmt;
+} | {
+ AlterDefaultPrivilegesStmt: AlterDefaultPrivilegesStmt;
+} | {
+ ClosePortalStmt: ClosePortalStmt;
+} | {
+ ClusterStmt: ClusterStmt;
+} | {
+ CopyStmt: CopyStmt;
+} | {
+ CreateStmt: CreateStmt;
+} | {
+ DefineStmt: DefineStmt;
+} | {
+ DropStmt: DropStmt;
+} | {
+ TruncateStmt: TruncateStmt;
+} | {
+ CommentStmt: CommentStmt;
+} | {
+ FetchStmt: FetchStmt;
+} | {
+ IndexStmt: IndexStmt;
+} | {
+ CreateFunctionStmt: CreateFunctionStmt;
+} | {
+ AlterFunctionStmt: AlterFunctionStmt;
+} | {
+ DoStmt: DoStmt;
+} | {
+ RenameStmt: RenameStmt;
+} | {
+ RuleStmt: RuleStmt;
+} | {
+ NotifyStmt: NotifyStmt;
+} | {
+ ListenStmt: ListenStmt;
+} | {
+ UnlistenStmt: UnlistenStmt;
+} | {
+ TransactionStmt: TransactionStmt;
+} | {
+ ViewStmt: ViewStmt;
+} | {
+ LoadStmt: LoadStmt;
+} | {
+ CreateDomainStmt: CreateDomainStmt;
+} | {
+ CreatedbStmt: CreatedbStmt;
+} | {
+ DropdbStmt: DropdbStmt;
+} | {
+ VacuumStmt: VacuumStmt;
+} | {
+ ExplainStmt: ExplainStmt;
+} | {
+ CreateTableAsStmt: CreateTableAsStmt;
+} | {
+ CreateSeqStmt: CreateSeqStmt;
+} | {
+ AlterSeqStmt: AlterSeqStmt;
+} | {
+ VariableSetStmt: VariableSetStmt;
+} | {
+ VariableShowStmt: VariableShowStmt;
+} | {
+ DiscardStmt: DiscardStmt;
+} | {
+ CreateTrigStmt: CreateTrigStmt;
+} | {
+ CreatePLangStmt: CreatePLangStmt;
+} | {
+ CreateRoleStmt: CreateRoleStmt;
+} | {
+ AlterRoleStmt: AlterRoleStmt;
+} | {
+ DropRoleStmt: DropRoleStmt;
+} | {
+ LockStmt: LockStmt;
+} | {
+ ConstraintsSetStmt: ConstraintsSetStmt;
+} | {
+ ReindexStmt: ReindexStmt;
+} | {
+ CheckPointStmt: CheckPointStmt;
+} | {
+ CreateSchemaStmt: CreateSchemaStmt;
+} | {
+ AlterDatabaseStmt: AlterDatabaseStmt;
+} | {
+ AlterDatabaseSetStmt: AlterDatabaseSetStmt;
+} | {
+ AlterRoleSetStmt: AlterRoleSetStmt;
+} | {
+ CreateConversionStmt: CreateConversionStmt;
+} | {
+ CreateCastStmt: CreateCastStmt;
+} | {
+ CreateOpClassStmt: CreateOpClassStmt;
+} | {
+ CreateOpFamilyStmt: CreateOpFamilyStmt;
+} | {
+ AlterOpFamilyStmt: AlterOpFamilyStmt;
+} | {
+ PrepareStmt: PrepareStmt;
+} | {
+ ExecuteStmt: ExecuteStmt;
+} | {
+ DeallocateStmt: DeallocateStmt;
+} | {
+ DeclareCursorStmt: DeclareCursorStmt;
+} | {
+ CreateTableSpaceStmt: CreateTableSpaceStmt;
+} | {
+ DropTableSpaceStmt: DropTableSpaceStmt;
+} | {
+ AlterObjectDependsStmt: AlterObjectDependsStmt;
+} | {
+ AlterObjectSchemaStmt: AlterObjectSchemaStmt;
+} | {
+ AlterOwnerStmt: AlterOwnerStmt;
+} | {
+ AlterOperatorStmt: AlterOperatorStmt;
+} | {
+ AlterTypeStmt: AlterTypeStmt;
+} | {
+ DropOwnedStmt: DropOwnedStmt;
+} | {
+ ReassignOwnedStmt: ReassignOwnedStmt;
+} | {
+ CompositeTypeStmt: CompositeTypeStmt;
+} | {
+ CreateEnumStmt: CreateEnumStmt;
+} | {
+ CreateRangeStmt: CreateRangeStmt;
+} | {
+ AlterEnumStmt: AlterEnumStmt;
+} | {
+ AlterTSDictionaryStmt: AlterTSDictionaryStmt;
+} | {
+ AlterTSConfigurationStmt: AlterTSConfigurationStmt;
+} | {
+ CreateFdwStmt: CreateFdwStmt;
+} | {
+ AlterFdwStmt: AlterFdwStmt;
+} | {
+ CreateForeignServerStmt: CreateForeignServerStmt;
+} | {
+ AlterForeignServerStmt: AlterForeignServerStmt;
+} | {
+ CreateUserMappingStmt: CreateUserMappingStmt;
+} | {
+ AlterUserMappingStmt: AlterUserMappingStmt;
+} | {
+ DropUserMappingStmt: DropUserMappingStmt;
+} | {
+ AlterTableSpaceOptionsStmt: AlterTableSpaceOptionsStmt;
+} | {
+ AlterTableMoveAllStmt: AlterTableMoveAllStmt;
+} | {
+ SecLabelStmt: SecLabelStmt;
+} | {
+ CreateForeignTableStmt: CreateForeignTableStmt;
+} | {
+ ImportForeignSchemaStmt: ImportForeignSchemaStmt;
+} | {
+ CreateExtensionStmt: CreateExtensionStmt;
+} | {
+ AlterExtensionStmt: AlterExtensionStmt;
+} | {
+ AlterExtensionContentsStmt: AlterExtensionContentsStmt;
+} | {
+ CreateEventTrigStmt: CreateEventTrigStmt;
+} | {
+ AlterEventTrigStmt: AlterEventTrigStmt;
+} | {
+ RefreshMatViewStmt: RefreshMatViewStmt;
+} | {
+ ReplicaIdentityStmt: ReplicaIdentityStmt;
+} | {
+ AlterSystemStmt: AlterSystemStmt;
+} | {
+ CreatePolicyStmt: CreatePolicyStmt;
+} | {
+ AlterPolicyStmt: AlterPolicyStmt;
+} | {
+ CreateTransformStmt: CreateTransformStmt;
+} | {
+ CreateAmStmt: CreateAmStmt;
+} | {
+ CreatePublicationStmt: CreatePublicationStmt;
+} | {
+ AlterPublicationStmt: AlterPublicationStmt;
+} | {
+ CreateSubscriptionStmt: CreateSubscriptionStmt;
+} | {
+ AlterSubscriptionStmt: AlterSubscriptionStmt;
+} | {
+ DropSubscriptionStmt: DropSubscriptionStmt;
+} | {
+ CreateStatsStmt: CreateStatsStmt;
+} | {
+ AlterCollationStmt: AlterCollationStmt;
+} | {
+ CallStmt: CallStmt;
+} | {
+ AlterStatsStmt: AlterStatsStmt;
+} | {
+ A_Expr: A_Expr;
+} | {
+ ColumnRef: ColumnRef;
+} | {
+ ParamRef: ParamRef;
+} | {
+ A_Const: A_Const;
+} | {
+ FuncCall: FuncCall;
+} | {
+ A_Star: A_Star;
+} | {
+ A_Indices: A_Indices;
+} | {
+ A_Indirection: A_Indirection;
+} | {
+ A_ArrayExpr: A_ArrayExpr;
+} | {
+ ResTarget: ResTarget;
+} | {
+ MultiAssignRef: MultiAssignRef;
+} | {
+ TypeCast: TypeCast;
+} | {
+ CollateClause: CollateClause;
+} | {
+ SortBy: SortBy;
+} | {
+ WindowDef: WindowDef;
+} | {
+ RangeSubselect: RangeSubselect;
+} | {
+ RangeFunction: RangeFunction;
+} | {
+ RangeTableSample: RangeTableSample;
+} | {
+ RangeTableFunc: RangeTableFunc;
+} | {
+ RangeTableFuncCol: RangeTableFuncCol;
+} | {
+ TypeName: TypeName;
+} | {
+ ColumnDef: ColumnDef;
+} | {
+ IndexElem: IndexElem;
+} | {
+ StatsElem: StatsElem;
+} | {
+ Constraint: Constraint;
+} | {
+ DefElem: DefElem;
+} | {
+ RangeTblEntry: RangeTblEntry;
+} | {
+ RangeTblFunction: RangeTblFunction;
+} | {
+ TableSampleClause: TableSampleClause;
+} | {
+ WithCheckOption: WithCheckOption;
+} | {
+ SortGroupClause: SortGroupClause;
+} | {
+ GroupingSet: GroupingSet;
+} | {
+ WindowClause: WindowClause;
+} | {
+ ObjectWithArgs: ObjectWithArgs;
+} | {
+ AccessPriv: AccessPriv;
+} | {
+ CreateOpClassItem: CreateOpClassItem;
+} | {
+ TableLikeClause: TableLikeClause;
+} | {
+ FunctionParameter: FunctionParameter;
+} | {
+ LockingClause: LockingClause;
+} | {
+ RowMarkClause: RowMarkClause;
+} | {
+ XmlSerialize: XmlSerialize;
+} | {
+ WithClause: WithClause;
+} | {
+ InferClause: InferClause;
+} | {
+ OnConflictClause: OnConflictClause;
+} | {
+ CTESearchClause: CTESearchClause;
+} | {
+ CTECycleClause: CTECycleClause;
+} | {
+ CommonTableExpr: CommonTableExpr;
+} | {
+ RoleSpec: RoleSpec;
+} | {
+ TriggerTransition: TriggerTransition;
+} | {
+ PartitionElem: PartitionElem;
+} | {
+ PartitionSpec: PartitionSpec;
+} | {
+ PartitionBoundSpec: PartitionBoundSpec;
+} | {
+ PartitionRangeDatum: PartitionRangeDatum;
+} | {
+ PartitionCmd: PartitionCmd;
+} | {
+ VacuumRelation: VacuumRelation;
+} | {
+ InlineCodeBlock: InlineCodeBlock;
+} | {
+ CallContext: CallContext;
+} | {
+ ScanToken: ScanToken;
+};
+export interface ParseResult {
+ version?: number;
+ stmts?: RawStmt[];
+}
+export interface ScanResult {
+ version?: number;
+ tokens?: ScanToken[];
+}
+export interface Integer {
+ ival?: number;
+}
+export interface Float {
+ str?: string;
+}
+export interface String {
+ str?: string;
+}
+export interface BitString {
+ str?: string;
+}
+export interface Null {}
+export interface List {
+ items?: Node[];
+}
+export interface OidList {
+ items?: Node[];
+}
+export interface IntList {
+ items?: Node[];
+}
+export interface Alias {
+ aliasname?: string;
+ colnames?: Node[];
+}
+export interface RangeVar {
+ catalogname?: string;
+ schemaname?: string;
+ relname?: string;
+ inh?: boolean;
+ relpersistence?: string;
+ alias?: Alias;
+ location?: number;
+}
+export interface TableFunc {
+ ns_uris?: Node[];
+ ns_names?: Node[];
+ docexpr?: Node;
+ rowexpr?: Node;
+ colnames?: Node[];
+ coltypes?: Node[];
+ coltypmods?: Node[];
+ colcollations?: Node[];
+ colexprs?: Node[];
+ coldefexprs?: Node[];
+ notnulls?: bigint[];
+ ordinalitycol?: number;
+ location?: number;
+}
+export interface Expr {}
+export interface Var {
+ xpr?: Node;
+ varno?: number;
+ varattno?: number;
+ vartype?: number;
+ vartypmod?: number;
+ varcollid?: number;
+ varlevelsup?: number;
+ varnosyn?: number;
+ varattnosyn?: number;
+ location?: number;
+}
+export interface Param {
+ xpr?: Node;
+ paramkind?: ParamKind;
+ paramid?: number;
+ paramtype?: number;
+ paramtypmod?: number;
+ paramcollid?: number;
+ location?: number;
+}
+export interface Aggref {
+ xpr?: Node;
+ aggfnoid?: number;
+ aggtype?: number;
+ aggcollid?: number;
+ inputcollid?: number;
+ aggtranstype?: number;
+ aggargtypes?: Node[];
+ aggdirectargs?: Node[];
+ args?: Node[];
+ aggorder?: Node[];
+ aggdistinct?: Node[];
+ aggfilter?: Node;
+ aggstar?: boolean;
+ aggvariadic?: boolean;
+ aggkind?: string;
+ agglevelsup?: number;
+ aggsplit?: AggSplit;
+ aggno?: number;
+ aggtransno?: number;
+ location?: number;
+}
+export interface GroupingFunc {
+ xpr?: Node;
+ args?: Node[];
+ refs?: Node[];
+ cols?: Node[];
+ agglevelsup?: number;
+ location?: number;
+}
+export interface WindowFunc {
+ xpr?: Node;
+ winfnoid?: number;
+ wintype?: number;
+ wincollid?: number;
+ inputcollid?: number;
+ args?: Node[];
+ aggfilter?: Node;
+ winref?: number;
+ winstar?: boolean;
+ winagg?: boolean;
+ location?: number;
+}
+export interface SubscriptingRef {
+ xpr?: Node;
+ refcontainertype?: number;
+ refelemtype?: number;
+ refrestype?: number;
+ reftypmod?: number;
+ refcollid?: number;
+ refupperindexpr?: Node[];
+ reflowerindexpr?: Node[];
+ refexpr?: Node;
+ refassgnexpr?: Node;
+}
+export interface FuncExpr {
+ xpr?: Node;
+ funcid?: number;
+ funcresulttype?: number;
+ funcretset?: boolean;
+ funcvariadic?: boolean;
+ funcformat?: CoercionForm;
+ funccollid?: number;
+ inputcollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface NamedArgExpr {
+ xpr?: Node;
+ arg?: Node;
+ name?: string;
+ argnumber?: number;
+ location?: number;
+}
+export interface OpExpr {
+ xpr?: Node;
+ opno?: number;
+ opfuncid?: number;
+ opresulttype?: number;
+ opretset?: boolean;
+ opcollid?: number;
+ inputcollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface DistinctExpr {
+ xpr?: Node;
+ opno?: number;
+ opfuncid?: number;
+ opresulttype?: number;
+ opretset?: boolean;
+ opcollid?: number;
+ inputcollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface NullIfExpr {
+ xpr?: Node;
+ opno?: number;
+ opfuncid?: number;
+ opresulttype?: number;
+ opretset?: boolean;
+ opcollid?: number;
+ inputcollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface ScalarArrayOpExpr {
+ xpr?: Node;
+ opno?: number;
+ opfuncid?: number;
+ hashfuncid?: number;
+ useOr?: boolean;
+ inputcollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface BoolExpr {
+ xpr?: Node;
+ boolop?: BoolExprType;
+ args?: Node[];
+ location?: number;
+}
+export interface SubLink {
+ xpr?: Node;
+ subLinkType?: SubLinkType;
+ subLinkId?: number;
+ testexpr?: Node;
+ operName?: Node[];
+ subselect?: Node;
+ location?: number;
+}
+export interface SubPlan {
+ xpr?: Node;
+ subLinkType?: SubLinkType;
+ testexpr?: Node;
+ paramIds?: Node[];
+ plan_id?: number;
+ plan_name?: string;
+ firstColType?: number;
+ firstColTypmod?: number;
+ firstColCollation?: number;
+ useHashTable?: boolean;
+ unknownEqFalse?: boolean;
+ parallel_safe?: boolean;
+ setParam?: Node[];
+ parParam?: Node[];
+ args?: Node[];
+ startup_cost?: number;
+ per_call_cost?: number;
+}
+export interface AlternativeSubPlan {
+ xpr?: Node;
+ subplans?: Node[];
+}
+export interface FieldSelect {
+ xpr?: Node;
+ arg?: Node;
+ fieldnum?: number;
+ resulttype?: number;
+ resulttypmod?: number;
+ resultcollid?: number;
+}
+export interface FieldStore {
+ xpr?: Node;
+ arg?: Node;
+ newvals?: Node[];
+ fieldnums?: Node[];
+ resulttype?: number;
+}
+export interface RelabelType {
+ xpr?: Node;
+ arg?: Node;
+ resulttype?: number;
+ resulttypmod?: number;
+ resultcollid?: number;
+ relabelformat?: CoercionForm;
+ location?: number;
+}
+export interface CoerceViaIO {
+ xpr?: Node;
+ arg?: Node;
+ resulttype?: number;
+ resultcollid?: number;
+ coerceformat?: CoercionForm;
+ location?: number;
+}
+export interface ArrayCoerceExpr {
+ xpr?: Node;
+ arg?: Node;
+ elemexpr?: Node;
+ resulttype?: number;
+ resulttypmod?: number;
+ resultcollid?: number;
+ coerceformat?: CoercionForm;
+ location?: number;
+}
+export interface ConvertRowtypeExpr {
+ xpr?: Node;
+ arg?: Node;
+ resulttype?: number;
+ convertformat?: CoercionForm;
+ location?: number;
+}
+export interface CollateExpr {
+ xpr?: Node;
+ arg?: Node;
+ collOid?: number;
+ location?: number;
+}
+export interface CaseExpr {
+ xpr?: Node;
+ casetype?: number;
+ casecollid?: number;
+ arg?: Node;
+ args?: Node[];
+ defresult?: Node;
+ location?: number;
+}
+export interface CaseWhen {
+ xpr?: Node;
+ expr?: Node;
+ result?: Node;
+ location?: number;
+}
+export interface CaseTestExpr {
+ xpr?: Node;
+ typeId?: number;
+ typeMod?: number;
+ collation?: number;
+}
+export interface ArrayExpr {
+ xpr?: Node;
+ array_typeid?: number;
+ array_collid?: number;
+ element_typeid?: number;
+ elements?: Node[];
+ multidims?: boolean;
+ location?: number;
+}
+export interface RowExpr {
+ xpr?: Node;
+ args?: Node[];
+ row_typeid?: number;
+ row_format?: CoercionForm;
+ colnames?: Node[];
+ location?: number;
+}
+export interface RowCompareExpr {
+ xpr?: Node;
+ rctype?: RowCompareType;
+ opnos?: Node[];
+ opfamilies?: Node[];
+ inputcollids?: Node[];
+ largs?: Node[];
+ rargs?: Node[];
+}
+export interface CoalesceExpr {
+ xpr?: Node;
+ coalescetype?: number;
+ coalescecollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface MinMaxExpr {
+ xpr?: Node;
+ minmaxtype?: number;
+ minmaxcollid?: number;
+ inputcollid?: number;
+ op?: MinMaxOp;
+ args?: Node[];
+ location?: number;
+}
+export interface SQLValueFunction {
+ xpr?: Node;
+ op?: SQLValueFunctionOp;
+ type?: number;
+ typmod?: number;
+ location?: number;
+}
+export interface XmlExpr {
+ xpr?: Node;
+ op?: XmlExprOp;
+ name?: string;
+ named_args?: Node[];
+ arg_names?: Node[];
+ args?: Node[];
+ xmloption?: XmlOptionType;
+ type?: number;
+ typmod?: number;
+ location?: number;
+}
+export interface NullTest {
+ xpr?: Node;
+ arg?: Node;
+ nulltesttype?: NullTestType;
+ argisrow?: boolean;
+ location?: number;
+}
+export interface BooleanTest {
+ xpr?: Node;
+ arg?: Node;
+ booltesttype?: BoolTestType;
+ location?: number;
+}
+export interface CoerceToDomain {
+ xpr?: Node;
+ arg?: Node;
+ resulttype?: number;
+ resulttypmod?: number;
+ resultcollid?: number;
+ coercionformat?: CoercionForm;
+ location?: number;
+}
+export interface CoerceToDomainValue {
+ xpr?: Node;
+ typeId?: number;
+ typeMod?: number;
+ collation?: number;
+ location?: number;
+}
+export interface SetToDefault {
+ xpr?: Node;
+ typeId?: number;
+ typeMod?: number;
+ collation?: number;
+ location?: number;
+}
+export interface CurrentOfExpr {
+ xpr?: Node;
+ cvarno?: number;
+ cursor_name?: string;
+ cursor_param?: number;
+}
+export interface NextValueExpr {
+ xpr?: Node;
+ seqid?: number;
+ typeId?: number;
+}
+export interface InferenceElem {
+ xpr?: Node;
+ expr?: Node;
+ infercollid?: number;
+ inferopclass?: number;
+}
+export interface TargetEntry {
+ xpr?: Node;
+ expr?: Node;
+ resno?: number;
+ resname?: string;
+ ressortgroupref?: number;
+ resorigtbl?: number;
+ resorigcol?: number;
+ resjunk?: boolean;
+}
+export interface RangeTblRef {
+ rtindex?: number;
+}
+export interface JoinExpr {
+ jointype?: JoinType;
+ isNatural?: boolean;
+ larg?: Node;
+ rarg?: Node;
+ usingClause?: Node[];
+ join_using_alias?: Alias;
+ quals?: Node;
+ alias?: Alias;
+ rtindex?: number;
+}
+export interface FromExpr {
+ fromlist?: Node[];
+ quals?: Node;
+}
+export interface OnConflictExpr {
+ action?: OnConflictAction;
+ arbiterElems?: Node[];
+ arbiterWhere?: Node;
+ constraint?: number;
+ onConflictSet?: Node[];
+ onConflictWhere?: Node;
+ exclRelIndex?: number;
+ exclRelTlist?: Node[];
+}
+export interface IntoClause {
+ rel?: RangeVar;
+ colNames?: Node[];
+ accessMethod?: string;
+ options?: Node[];
+ onCommit?: OnCommitAction;
+ tableSpaceName?: string;
+ viewQuery?: Node;
+ skipData?: boolean;
+}
+export interface RawStmt {
+ stmt?: Node;
+ stmt_location?: number;
+ stmt_len?: number;
+}
+export interface Query {
+ commandType?: CmdType;
+ querySource?: QuerySource;
+ canSetTag?: boolean;
+ utilityStmt?: Node;
+ resultRelation?: number;
+ hasAggs?: boolean;
+ hasWindowFuncs?: boolean;
+ hasTargetSRFs?: boolean;
+ hasSubLinks?: boolean;
+ hasDistinctOn?: boolean;
+ hasRecursive?: boolean;
+ hasModifyingCTE?: boolean;
+ hasForUpdate?: boolean;
+ hasRowSecurity?: boolean;
+ isReturn?: boolean;
+ cteList?: Node[];
+ rtable?: Node[];
+ jointree?: FromExpr;
+ targetList?: Node[];
+ override?: OverridingKind;
+ onConflict?: OnConflictExpr;
+ returningList?: Node[];
+ groupClause?: Node[];
+ groupDistinct?: boolean;
+ groupingSets?: Node[];
+ havingQual?: Node;
+ windowClause?: Node[];
+ distinctClause?: Node[];
+ sortClause?: Node[];
+ limitOffset?: Node;
+ limitCount?: Node;
+ limitOption?: LimitOption;
+ rowMarks?: Node[];
+ setOperations?: Node;
+ constraintDeps?: Node[];
+ withCheckOptions?: Node[];
+ stmt_location?: number;
+ stmt_len?: number;
+}
+export interface InsertStmt {
+ relation?: RangeVar;
+ cols?: Node[];
+ selectStmt?: Node;
+ onConflictClause?: OnConflictClause;
+ returningList?: Node[];
+ withClause?: WithClause;
+ override?: OverridingKind;
+}
+export interface DeleteStmt {
+ relation?: RangeVar;
+ usingClause?: Node[];
+ whereClause?: Node;
+ returningList?: Node[];
+ withClause?: WithClause;
+}
+export interface UpdateStmt {
+ relation?: RangeVar;
+ targetList?: Node[];
+ whereClause?: Node;
+ fromClause?: Node[];
+ returningList?: Node[];
+ withClause?: WithClause;
+}
+export interface SelectStmt {
+ distinctClause?: Node[];
+ intoClause?: IntoClause;
+ targetList?: Node[];
+ fromClause?: Node[];
+ whereClause?: Node;
+ groupClause?: Node[];
+ groupDistinct?: boolean;
+ havingClause?: Node;
+ windowClause?: Node[];
+ valuesLists?: Node[];
+ sortClause?: Node[];
+ limitOffset?: Node;
+ limitCount?: Node;
+ limitOption?: LimitOption;
+ lockingClause?: Node[];
+ withClause?: WithClause;
+ op?: SetOperation;
+ all?: boolean;
+ larg?: SelectStmt;
+ rarg?: SelectStmt;
+}
+export interface ReturnStmt {
+ returnval?: Node;
+}
+export interface PLAssignStmt {
+ name?: string;
+ indirection?: Node[];
+ nnames?: number;
+ val?: SelectStmt;
+ location?: number;
+}
+export interface AlterTableStmt {
+ relation?: RangeVar;
+ cmds?: Node[];
+ objtype?: ObjectType;
+ missing_ok?: boolean;
+}
+export interface AlterTableCmd {
+ subtype?: AlterTableType;
+ name?: string;
+ num?: number;
+ newowner?: RoleSpec;
+ def?: Node;
+ behavior?: DropBehavior;
+ missing_ok?: boolean;
+ recurse?: boolean;
+}
+export interface AlterDomainStmt {
+ subtype?: string;
+ typeName?: Node[];
+ name?: string;
+ def?: Node;
+ behavior?: DropBehavior;
+ missing_ok?: boolean;
+}
+export interface SetOperationStmt {
+ op?: SetOperation;
+ all?: boolean;
+ larg?: Node;
+ rarg?: Node;
+ colTypes?: Node[];
+ colTypmods?: Node[];
+ colCollations?: Node[];
+ groupClauses?: Node[];
+}
+export interface GrantStmt {
+ is_grant?: boolean;
+ targtype?: GrantTargetType;
+ objtype?: ObjectType;
+ objects?: Node[];
+ privileges?: Node[];
+ grantees?: Node[];
+ grant_option?: boolean;
+ grantor?: RoleSpec;
+ behavior?: DropBehavior;
+}
+export interface GrantRoleStmt {
+ granted_roles?: Node[];
+ grantee_roles?: Node[];
+ is_grant?: boolean;
+ admin_opt?: boolean;
+ grantor?: RoleSpec;
+ behavior?: DropBehavior;
+}
+export interface AlterDefaultPrivilegesStmt {
+ options?: Node[];
+ action?: GrantStmt;
+}
+export interface ClosePortalStmt {
+ portalname?: string;
+}
+export interface ClusterStmt {
+ relation?: RangeVar;
+ indexname?: string;
+ params?: Node[];
+}
+export interface CopyStmt {
+ relation?: RangeVar;
+ query?: Node;
+ attlist?: Node[];
+ is_from?: boolean;
+ is_program?: boolean;
+ filename?: string;
+ options?: Node[];
+ whereClause?: Node;
+}
+export interface CreateStmt {
+ relation?: RangeVar;
+ tableElts?: Node[];
+ inhRelations?: Node[];
+ partbound?: PartitionBoundSpec;
+ partspec?: PartitionSpec;
+ ofTypename?: TypeName;
+ constraints?: Node[];
+ options?: Node[];
+ oncommit?: OnCommitAction;
+ tablespacename?: string;
+ accessMethod?: string;
+ if_not_exists?: boolean;
+}
+export interface DefineStmt {
+ kind?: ObjectType;
+ oldstyle?: boolean;
+ defnames?: Node[];
+ args?: Node[];
+ definition?: Node[];
+ if_not_exists?: boolean;
+ replace?: boolean;
+}
+export interface DropStmt {
+ objects?: Node[];
+ removeType?: ObjectType;
+ behavior?: DropBehavior;
+ missing_ok?: boolean;
+ concurrent?: boolean;
+}
+export interface TruncateStmt {
+ relations?: Node[];
+ restart_seqs?: boolean;
+ behavior?: DropBehavior;
+}
+export interface CommentStmt {
+ objtype?: ObjectType;
+ object?: Node;
+ comment?: string;
+}
+export interface FetchStmt {
+ direction?: FetchDirection;
+ howMany?: bigint;
+ portalname?: string;
+ ismove?: boolean;
+}
+export interface IndexStmt {
+ idxname?: string;
+ relation?: RangeVar;
+ accessMethod?: string;
+ tableSpace?: string;
+ indexParams?: Node[];
+ indexIncludingParams?: Node[];
+ options?: Node[];
+ whereClause?: Node;
+ excludeOpNames?: Node[];
+ idxcomment?: string;
+ indexOid?: number;
+ oldNode?: number;
+ oldCreateSubid?: number;
+ oldFirstRelfilenodeSubid?: number;
+ unique?: boolean;
+ primary?: boolean;
+ isconstraint?: boolean;
+ deferrable?: boolean;
+ initdeferred?: boolean;
+ transformed?: boolean;
+ concurrent?: boolean;
+ if_not_exists?: boolean;
+ reset_default_tblspc?: boolean;
+}
+export interface CreateFunctionStmt {
+ is_procedure?: boolean;
+ replace?: boolean;
+ funcname?: Node[];
+ parameters?: Node[];
+ returnType?: TypeName;
+ options?: Node[];
+ sql_body?: Node;
+}
+export interface AlterFunctionStmt {
+ objtype?: ObjectType;
+ func?: ObjectWithArgs;
+ actions?: Node[];
+}
+export interface DoStmt {
+ args?: Node[];
+}
+export interface RenameStmt {
+ renameType?: ObjectType;
+ relationType?: ObjectType;
+ relation?: RangeVar;
+ object?: Node;
+ subname?: string;
+ newname?: string;
+ behavior?: DropBehavior;
+ missing_ok?: boolean;
+}
+export interface RuleStmt {
+ relation?: RangeVar;
+ rulename?: string;
+ whereClause?: Node;
+ event?: CmdType;
+ instead?: boolean;
+ actions?: Node[];
+ replace?: boolean;
+}
+export interface NotifyStmt {
+ conditionname?: string;
+ payload?: string;
+}
+export interface ListenStmt {
+ conditionname?: string;
+}
+export interface UnlistenStmt {
+ conditionname?: string;
+}
+export interface TransactionStmt {
+ kind?: TransactionStmtKind;
+ options?: Node[];
+ savepoint_name?: string;
+ gid?: string;
+ chain?: boolean;
+}
+export interface ViewStmt {
+ view?: RangeVar;
+ aliases?: Node[];
+ query?: Node;
+ replace?: boolean;
+ options?: Node[];
+ withCheckOption?: ViewCheckOption;
+}
+export interface LoadStmt {
+ filename?: string;
+}
+export interface CreateDomainStmt {
+ domainname?: Node[];
+ typeName?: TypeName;
+ collClause?: CollateClause;
+ constraints?: Node[];
+}
+export interface CreatedbStmt {
+ dbname?: string;
+ options?: Node[];
+}
+export interface DropdbStmt {
+ dbname?: string;
+ missing_ok?: boolean;
+ options?: Node[];
+}
+export interface VacuumStmt {
+ options?: Node[];
+ rels?: Node[];
+ is_vacuumcmd?: boolean;
+}
+export interface ExplainStmt {
+ query?: Node;
+ options?: Node[];
+}
+export interface CreateTableAsStmt {
+ query?: Node;
+ into?: IntoClause;
+ objtype?: ObjectType;
+ is_select_into?: boolean;
+ if_not_exists?: boolean;
+}
+export interface CreateSeqStmt {
+ sequence?: RangeVar;
+ options?: Node[];
+ ownerId?: number;
+ for_identity?: boolean;
+ if_not_exists?: boolean;
+}
+export interface AlterSeqStmt {
+ sequence?: RangeVar;
+ options?: Node[];
+ for_identity?: boolean;
+ missing_ok?: boolean;
+}
+export interface VariableSetStmt {
+ kind?: VariableSetKind;
+ name?: string;
+ args?: Node[];
+ is_local?: boolean;
+}
+export interface VariableShowStmt {
+ name?: string;
+}
+export interface DiscardStmt {
+ target?: DiscardMode;
+}
+export interface CreateTrigStmt {
+ replace?: boolean;
+ isconstraint?: boolean;
+ trigname?: string;
+ relation?: RangeVar;
+ funcname?: Node[];
+ args?: Node[];
+ row?: boolean;
+ timing?: number;
+ events?: number;
+ columns?: Node[];
+ whenClause?: Node;
+ transitionRels?: Node[];
+ deferrable?: boolean;
+ initdeferred?: boolean;
+ constrrel?: RangeVar;
+}
+export interface CreatePLangStmt {
+ replace?: boolean;
+ plname?: string;
+ plhandler?: Node[];
+ plinline?: Node[];
+ plvalidator?: Node[];
+ pltrusted?: boolean;
+}
+export interface CreateRoleStmt {
+ stmt_type?: RoleStmtType;
+ role?: string;
+ options?: Node[];
+}
+export interface AlterRoleStmt {
+ role?: RoleSpec;
+ options?: Node[];
+ action?: number;
+}
+export interface DropRoleStmt {
+ roles?: Node[];
+ missing_ok?: boolean;
+}
+export interface LockStmt {
+ relations?: Node[];
+ mode?: number;
+ nowait?: boolean;
+}
+export interface ConstraintsSetStmt {
+ constraints?: Node[];
+ deferred?: boolean;
+}
+export interface ReindexStmt {
+ kind?: ReindexObjectType;
+ relation?: RangeVar;
+ name?: string;
+ params?: Node[];
+}
+export interface CheckPointStmt {}
+export interface CreateSchemaStmt {
+ schemaname?: string;
+ authrole?: RoleSpec;
+ schemaElts?: Node[];
+ if_not_exists?: boolean;
+}
+export interface AlterDatabaseStmt {
+ dbname?: string;
+ options?: Node[];
+}
+export interface AlterDatabaseSetStmt {
+ dbname?: string;
+ setstmt?: VariableSetStmt;
+}
+export interface AlterRoleSetStmt {
+ role?: RoleSpec;
+ database?: string;
+ setstmt?: VariableSetStmt;
+}
+export interface CreateConversionStmt {
+ conversion_name?: Node[];
+ for_encoding_name?: string;
+ to_encoding_name?: string;
+ func_name?: Node[];
+ def?: boolean;
+}
+export interface CreateCastStmt {
+ sourcetype?: TypeName;
+ targettype?: TypeName;
+ func?: ObjectWithArgs;
+ context?: CoercionContext;
+ inout?: boolean;
+}
+export interface CreateOpClassStmt {
+ opclassname?: Node[];
+ opfamilyname?: Node[];
+ amname?: string;
+ datatype?: TypeName;
+ items?: Node[];
+ isDefault?: boolean;
+}
+export interface CreateOpFamilyStmt {
+ opfamilyname?: Node[];
+ amname?: string;
+}
+export interface AlterOpFamilyStmt {
+ opfamilyname?: Node[];
+ amname?: string;
+ isDrop?: boolean;
+ items?: Node[];
+}
+export interface PrepareStmt {
+ name?: string;
+ argtypes?: Node[];
+ query?: Node;
+}
+export interface ExecuteStmt {
+ name?: string;
+ params?: Node[];
+}
+export interface DeallocateStmt {
+ name?: string;
+}
+export interface DeclareCursorStmt {
+ portalname?: string;
+ options?: number;
+ query?: Node;
+}
+export interface CreateTableSpaceStmt {
+ tablespacename?: string;
+ owner?: RoleSpec;
+ location?: string;
+ options?: Node[];
+}
+export interface DropTableSpaceStmt {
+ tablespacename?: string;
+ missing_ok?: boolean;
+}
+export interface AlterObjectDependsStmt {
+ objectType?: ObjectType;
+ relation?: RangeVar;
+ object?: Node;
+ extname?: Node;
+ remove?: boolean;
+}
+export interface AlterObjectSchemaStmt {
+ objectType?: ObjectType;
+ relation?: RangeVar;
+ object?: Node;
+ newschema?: string;
+ missing_ok?: boolean;
+}
+export interface AlterOwnerStmt {
+ objectType?: ObjectType;
+ relation?: RangeVar;
+ object?: Node;
+ newowner?: RoleSpec;
+}
+export interface AlterOperatorStmt {
+ opername?: ObjectWithArgs;
+ options?: Node[];
+}
+export interface AlterTypeStmt {
+ typeName?: Node[];
+ options?: Node[];
+}
+export interface DropOwnedStmt {
+ roles?: Node[];
+ behavior?: DropBehavior;
+}
+export interface ReassignOwnedStmt {
+ roles?: Node[];
+ newrole?: RoleSpec;
+}
+export interface CompositeTypeStmt {
+ typevar?: RangeVar;
+ coldeflist?: Node[];
+}
+export interface CreateEnumStmt {
+ typeName?: Node[];
+ vals?: Node[];
+}
+export interface CreateRangeStmt {
+ typeName?: Node[];
+ params?: Node[];
+}
+export interface AlterEnumStmt {
+ typeName?: Node[];
+ oldVal?: string;
+ newVal?: string;
+ newValNeighbor?: string;
+ newValIsAfter?: boolean;
+ skipIfNewValExists?: boolean;
+}
+export interface AlterTSDictionaryStmt {
+ dictname?: Node[];
+ options?: Node[];
+}
+export interface AlterTSConfigurationStmt {
+ kind?: AlterTSConfigType;
+ cfgname?: Node[];
+ tokentype?: Node[];
+ dicts?: Node[];
+ override?: boolean;
+ replace?: boolean;
+ missing_ok?: boolean;
+}
+export interface CreateFdwStmt {
+ fdwname?: string;
+ func_options?: Node[];
+ options?: Node[];
+}
+export interface AlterFdwStmt {
+ fdwname?: string;
+ func_options?: Node[];
+ options?: Node[];
+}
+export interface CreateForeignServerStmt {
+ servername?: string;
+ servertype?: string;
+ version?: string;
+ fdwname?: string;
+ if_not_exists?: boolean;
+ options?: Node[];
+}
+export interface AlterForeignServerStmt {
+ servername?: string;
+ version?: string;
+ options?: Node[];
+ has_version?: boolean;
+}
+export interface CreateUserMappingStmt {
+ user?: RoleSpec;
+ servername?: string;
+ if_not_exists?: boolean;
+ options?: Node[];
+}
+export interface AlterUserMappingStmt {
+ user?: RoleSpec;
+ servername?: string;
+ options?: Node[];
+}
+export interface DropUserMappingStmt {
+ user?: RoleSpec;
+ servername?: string;
+ missing_ok?: boolean;
+}
+export interface AlterTableSpaceOptionsStmt {
+ tablespacename?: string;
+ options?: Node[];
+ isReset?: boolean;
+}
+export interface AlterTableMoveAllStmt {
+ orig_tablespacename?: string;
+ objtype?: ObjectType;
+ roles?: Node[];
+ new_tablespacename?: string;
+ nowait?: boolean;
+}
+export interface SecLabelStmt {
+ objtype?: ObjectType;
+ object?: Node;
+ provider?: string;
+ label?: string;
+}
+export interface CreateForeignTableStmt {
+ base?: CreateStmt;
+ servername?: string;
+ options?: Node[];
+}
+export interface ImportForeignSchemaStmt {
+ server_name?: string;
+ remote_schema?: string;
+ local_schema?: string;
+ list_type?: ImportForeignSchemaType;
+ table_list?: Node[];
+ options?: Node[];
+}
+export interface CreateExtensionStmt {
+ extname?: string;
+ if_not_exists?: boolean;
+ options?: Node[];
+}
+export interface AlterExtensionStmt {
+ extname?: string;
+ options?: Node[];
+}
+export interface AlterExtensionContentsStmt {
+ extname?: string;
+ action?: number;
+ objtype?: ObjectType;
+ object?: Node;
+}
+export interface CreateEventTrigStmt {
+ trigname?: string;
+ eventname?: string;
+ whenclause?: Node[];
+ funcname?: Node[];
+}
+export interface AlterEventTrigStmt {
+ trigname?: string;
+ tgenabled?: string;
+}
+export interface RefreshMatViewStmt {
+ concurrent?: boolean;
+ skipData?: boolean;
+ relation?: RangeVar;
+}
+export interface ReplicaIdentityStmt {
+ identity_type?: string;
+ name?: string;
+}
+export interface AlterSystemStmt {
+ setstmt?: VariableSetStmt;
+}
+export interface CreatePolicyStmt {
+ policy_name?: string;
+ table?: RangeVar;
+ cmd_name?: string;
+ permissive?: boolean;
+ roles?: Node[];
+ qual?: Node;
+ with_check?: Node;
+}
+export interface AlterPolicyStmt {
+ policy_name?: string;
+ table?: RangeVar;
+ roles?: Node[];
+ qual?: Node;
+ with_check?: Node;
+}
+export interface CreateTransformStmt {
+ replace?: boolean;
+ type_name?: TypeName;
+ lang?: string;
+ fromsql?: ObjectWithArgs;
+ tosql?: ObjectWithArgs;
+}
+export interface CreateAmStmt {
+ amname?: string;
+ handler_name?: Node[];
+ amtype?: string;
+}
+export interface CreatePublicationStmt {
+ pubname?: string;
+ options?: Node[];
+ tables?: Node[];
+ for_all_tables?: boolean;
+}
+export interface AlterPublicationStmt {
+ pubname?: string;
+ options?: Node[];
+ tables?: Node[];
+ for_all_tables?: boolean;
+ tableAction?: DefElemAction;
+}
+export interface CreateSubscriptionStmt {
+ subname?: string;
+ conninfo?: string;
+ publication?: Node[];
+ options?: Node[];
+}
+export interface AlterSubscriptionStmt {
+ kind?: AlterSubscriptionType;
+ subname?: string;
+ conninfo?: string;
+ publication?: Node[];
+ options?: Node[];
+}
+export interface DropSubscriptionStmt {
+ subname?: string;
+ missing_ok?: boolean;
+ behavior?: DropBehavior;
+}
+export interface CreateStatsStmt {
+ defnames?: Node[];
+ stat_types?: Node[];
+ exprs?: Node[];
+ relations?: Node[];
+ stxcomment?: string;
+ transformed?: boolean;
+ if_not_exists?: boolean;
+}
+export interface AlterCollationStmt {
+ collname?: Node[];
+}
+export interface CallStmt {
+ funccall?: FuncCall;
+ funcexpr?: FuncExpr;
+ outargs?: Node[];
+}
+export interface AlterStatsStmt {
+ defnames?: Node[];
+ stxstattarget?: number;
+ missing_ok?: boolean;
+}
+export interface A_Expr {
+ kind?: A_Expr_Kind;
+ name?: Node[];
+ lexpr?: Node;
+ rexpr?: Node;
+ location?: number;
+}
+export interface ColumnRef {
+ fields?: Node[];
+ location?: number;
+}
+export interface ParamRef {
+ number?: number;
+ location?: number;
+}
+export interface A_Const {
+ val?: Node;
+ location?: number;
+}
+export interface FuncCall {
+ funcname?: Node[];
+ args?: Node[];
+ agg_order?: Node[];
+ agg_filter?: Node;
+ over?: WindowDef;
+ agg_within_group?: boolean;
+ agg_star?: boolean;
+ agg_distinct?: boolean;
+ func_variadic?: boolean;
+ funcformat?: CoercionForm;
+ location?: number;
+}
+export interface A_Star {}
+export interface A_Indices {
+ is_slice?: boolean;
+ lidx?: Node;
+ uidx?: Node;
+}
+export interface A_Indirection {
+ arg?: Node;
+ indirection?: Node[];
+}
+export interface A_ArrayExpr {
+ elements?: Node[];
+ location?: number;
+}
+export interface ResTarget {
+ name?: string;
+ indirection?: Node[];
+ val?: Node;
+ location?: number;
+}
+export interface MultiAssignRef {
+ source?: Node;
+ colno?: number;
+ ncolumns?: number;
+}
+export interface TypeCast {
+ arg?: Node;
+ typeName?: TypeName;
+ location?: number;
+}
+export interface CollateClause {
+ arg?: Node;
+ collname?: Node[];
+ location?: number;
+}
+export interface SortBy {
+ node?: Node;
+ sortby_dir?: SortByDir;
+ sortby_nulls?: SortByNulls;
+ useOp?: Node[];
+ location?: number;
+}
+export interface WindowDef {
+ name?: string;
+ refname?: string;
+ partitionClause?: Node[];
+ orderClause?: Node[];
+ frameOptions?: number;
+ startOffset?: Node;
+ endOffset?: Node;
+ location?: number;
+}
+export interface RangeSubselect {
+ lateral?: boolean;
+ subquery?: Node;
+ alias?: Alias;
+}
+export interface RangeFunction {
+ lateral?: boolean;
+ ordinality?: boolean;
+ is_rowsfrom?: boolean;
+ functions?: Node[];
+ alias?: Alias;
+ coldeflist?: Node[];
+}
+export interface RangeTableSample {
+ relation?: Node;
+ method?: Node[];
+ args?: Node[];
+ repeatable?: Node;
+ location?: number;
+}
+export interface RangeTableFunc {
+ lateral?: boolean;
+ docexpr?: Node;
+ rowexpr?: Node;
+ namespaces?: Node[];
+ columns?: Node[];
+ alias?: Alias;
+ location?: number;
+}
+export interface RangeTableFuncCol {
+ colname?: string;
+ typeName?: TypeName;
+ for_ordinality?: boolean;
+ is_not_null?: boolean;
+ colexpr?: Node;
+ coldefexpr?: Node;
+ location?: number;
+}
+export interface TypeName {
+ names?: Node[];
+ typeOid?: number;
+ setof?: boolean;
+ pct_type?: boolean;
+ typmods?: Node[];
+ typemod?: number;
+ arrayBounds?: Node[];
+ location?: number;
+}
+export interface ColumnDef {
+ colname?: string;
+ typeName?: TypeName;
+ compression?: string;
+ inhcount?: number;
+ is_local?: boolean;
+ is_not_null?: boolean;
+ is_from_type?: boolean;
+ storage?: string;
+ raw_default?: Node;
+ cooked_default?: Node;
+ identity?: string;
+ identitySequence?: RangeVar;
+ generated?: string;
+ collClause?: CollateClause;
+ collOid?: number;
+ constraints?: Node[];
+ fdwoptions?: Node[];
+ location?: number;
+}
+export interface IndexElem {
+ name?: string;
+ expr?: Node;
+ indexcolname?: string;
+ collation?: Node[];
+ opclass?: Node[];
+ opclassopts?: Node[];
+ ordering?: SortByDir;
+ nulls_ordering?: SortByNulls;
+}
+export interface StatsElem {
+ name?: string;
+ expr?: Node;
+}
+export interface Constraint {
+ contype?: ConstrType;
+ conname?: string;
+ deferrable?: boolean;
+ initdeferred?: boolean;
+ location?: number;
+ is_no_inherit?: boolean;
+ raw_expr?: Node;
+ cooked_expr?: string;
+ generated_when?: string;
+ keys?: Node[];
+ including?: Node[];
+ exclusions?: Node[];
+ options?: Node[];
+ indexname?: string;
+ indexspace?: string;
+ reset_default_tblspc?: boolean;
+ access_method?: string;
+ where_clause?: Node;
+ pktable?: RangeVar;
+ fk_attrs?: Node[];
+ pk_attrs?: Node[];
+ fk_matchtype?: string;
+ fk_upd_action?: string;
+ fk_del_action?: string;
+ old_conpfeqop?: Node[];
+ old_pktable_oid?: number;
+ skip_validation?: boolean;
+ initially_valid?: boolean;
+}
+export interface DefElem {
+ defnamespace?: string;
+ defname?: string;
+ arg?: Node;
+ defaction?: DefElemAction;
+ location?: number;
+}
+export interface RangeTblEntry {
+ rtekind?: RTEKind;
+ relid?: number;
+ relkind?: string;
+ rellockmode?: number;
+ tablesample?: TableSampleClause;
+ subquery?: Query;
+ security_barrier?: boolean;
+ jointype?: JoinType;
+ joinmergedcols?: number;
+ joinaliasvars?: Node[];
+ joinleftcols?: Node[];
+ joinrightcols?: Node[];
+ join_using_alias?: Alias;
+ functions?: Node[];
+ funcordinality?: boolean;
+ tablefunc?: TableFunc;
+ values_lists?: Node[];
+ ctename?: string;
+ ctelevelsup?: number;
+ self_reference?: boolean;
+ coltypes?: Node[];
+ coltypmods?: Node[];
+ colcollations?: Node[];
+ enrname?: string;
+ enrtuples?: number;
+ alias?: Alias;
+ eref?: Alias;
+ lateral?: boolean;
+ inh?: boolean;
+ inFromCl?: boolean;
+ requiredPerms?: number;
+ checkAsUser?: number;
+ selectedCols?: bigint[];
+ insertedCols?: bigint[];
+ updatedCols?: bigint[];
+ extraUpdatedCols?: bigint[];
+ securityQuals?: Node[];
+}
+export interface RangeTblFunction {
+ funcexpr?: Node;
+ funccolcount?: number;
+ funccolnames?: Node[];
+ funccoltypes?: Node[];
+ funccoltypmods?: Node[];
+ funccolcollations?: Node[];
+ funcparams?: bigint[];
+}
+export interface TableSampleClause {
+ tsmhandler?: number;
+ args?: Node[];
+ repeatable?: Node;
+}
+export interface WithCheckOption {
+ kind?: WCOKind;
+ relname?: string;
+ polname?: string;
+ qual?: Node;
+ cascaded?: boolean;
+}
+export interface SortGroupClause {
+ tleSortGroupRef?: number;
+ eqop?: number;
+ sortop?: number;
+ nulls_first?: boolean;
+ hashable?: boolean;
+}
+export interface GroupingSet {
+ kind?: GroupingSetKind;
+ content?: Node[];
+ location?: number;
+}
+export interface WindowClause {
+ name?: string;
+ refname?: string;
+ partitionClause?: Node[];
+ orderClause?: Node[];
+ frameOptions?: number;
+ startOffset?: Node;
+ endOffset?: Node;
+ startInRangeFunc?: number;
+ endInRangeFunc?: number;
+ inRangeColl?: number;
+ inRangeAsc?: boolean;
+ inRangeNullsFirst?: boolean;
+ winref?: number;
+ copiedOrder?: boolean;
+}
+export interface ObjectWithArgs {
+ objname?: Node[];
+ objargs?: Node[];
+ objfuncargs?: Node[];
+ args_unspecified?: boolean;
+}
+export interface AccessPriv {
+ priv_name?: string;
+ cols?: Node[];
+}
+export interface CreateOpClassItem {
+ itemtype?: number;
+ name?: ObjectWithArgs;
+ number?: number;
+ order_family?: Node[];
+ class_args?: Node[];
+ storedtype?: TypeName;
+}
+export interface TableLikeClause {
+ relation?: RangeVar;
+ options?: number;
+ relationOid?: number;
+}
+export interface FunctionParameter {
+ name?: string;
+ argType?: TypeName;
+ mode?: FunctionParameterMode;
+ defexpr?: Node;
+}
+export interface LockingClause {
+ lockedRels?: Node[];
+ strength?: LockClauseStrength;
+ waitPolicy?: LockWaitPolicy;
+}
+export interface RowMarkClause {
+ rti?: number;
+ strength?: LockClauseStrength;
+ waitPolicy?: LockWaitPolicy;
+ pushedDown?: boolean;
+}
+export interface XmlSerialize {
+ xmloption?: XmlOptionType;
+ expr?: Node;
+ typeName?: TypeName;
+ location?: number;
+}
+export interface WithClause {
+ ctes?: Node[];
+ recursive?: boolean;
+ location?: number;
+}
+export interface InferClause {
+ indexElems?: Node[];
+ whereClause?: Node;
+ conname?: string;
+ location?: number;
+}
+export interface OnConflictClause {
+ action?: OnConflictAction;
+ infer?: InferClause;
+ targetList?: Node[];
+ whereClause?: Node;
+ location?: number;
+}
+export interface CTESearchClause {
+ search_col_list?: Node[];
+ search_breadth_first?: boolean;
+ search_seq_column?: string;
+ location?: number;
+}
+export interface CTECycleClause {
+ cycle_col_list?: Node[];
+ cycle_mark_column?: string;
+ cycle_mark_value?: Node;
+ cycle_mark_default?: Node;
+ cycle_path_column?: string;
+ location?: number;
+ cycle_mark_type?: number;
+ cycle_mark_typmod?: number;
+ cycle_mark_collation?: number;
+ cycle_mark_neop?: number;
+}
+export interface CommonTableExpr {
+ ctename?: string;
+ aliascolnames?: Node[];
+ ctematerialized?: CTEMaterialize;
+ ctequery?: Node;
+ search_clause?: CTESearchClause;
+ cycle_clause?: CTECycleClause;
+ location?: number;
+ cterecursive?: boolean;
+ cterefcount?: number;
+ ctecolnames?: Node[];
+ ctecoltypes?: Node[];
+ ctecoltypmods?: Node[];
+ ctecolcollations?: Node[];
+}
+export interface RoleSpec {
+ roletype?: RoleSpecType;
+ rolename?: string;
+ location?: number;
+}
+export interface TriggerTransition {
+ name?: string;
+ isNew?: boolean;
+ isTable?: boolean;
+}
+export interface PartitionElem {
+ name?: string;
+ expr?: Node;
+ collation?: Node[];
+ opclass?: Node[];
+ location?: number;
+}
+export interface PartitionSpec {
+ strategy?: string;
+ partParams?: Node[];
+ location?: number;
+}
+export interface PartitionBoundSpec {
+ strategy?: string;
+ is_default?: boolean;
+ modulus?: number;
+ remainder?: number;
+ listdatums?: Node[];
+ lowerdatums?: Node[];
+ upperdatums?: Node[];
+ location?: number;
+}
+export interface PartitionRangeDatum {
+ kind?: PartitionRangeDatumKind;
+ value?: Node;
+ location?: number;
+}
+export interface PartitionCmd {
+ name?: RangeVar;
+ bound?: PartitionBoundSpec;
+ concurrent?: boolean;
+}
+export interface VacuumRelation {
+ relation?: RangeVar;
+ oid?: number;
+ va_cols?: Node[];
+}
+export interface InlineCodeBlock {
+ source_text?: string;
+ langOid?: number;
+ langIsTrusted?: boolean;
+ atomic?: boolean;
+}
+export interface CallContext {
+ atomic?: boolean;
+}
+export interface ScanToken {
+ start?: number;
+ end?: number;
+ token?: Token;
+ keywordKind?: KeywordKind;
+}
\ No newline at end of file
diff --git a/types/14/tsconfig.esm.json b/types/14/tsconfig.esm.json
new file mode 100644
index 00000000..800d7506
--- /dev/null
+++ b/types/14/tsconfig.esm.json
@@ -0,0 +1,9 @@
+{
+ "extends": "./tsconfig.json",
+ "compilerOptions": {
+ "outDir": "dist/esm",
+ "module": "es2022",
+ "rootDir": "src/",
+ "declaration": false
+ }
+}
diff --git a/types/14/tsconfig.json b/types/14/tsconfig.json
new file mode 100644
index 00000000..1a9d5696
--- /dev/null
+++ b/types/14/tsconfig.json
@@ -0,0 +1,9 @@
+{
+ "extends": "../../tsconfig.json",
+ "compilerOptions": {
+ "outDir": "dist",
+ "rootDir": "src/"
+ },
+ "include": ["src/**/*.ts"],
+ "exclude": ["dist", "node_modules", "**/*.spec.*", "**/*.test.*"]
+}
diff --git a/types/15/CHANGELOG.md b/types/15/CHANGELOG.md
new file mode 100644
index 00000000..a96e990c
--- /dev/null
+++ b/types/15/CHANGELOG.md
@@ -0,0 +1,40 @@
+# Change Log
+
+All notable changes to this project will be documented in this file.
+See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [17.4.2](https://github.com/launchql/pgsql-parser/compare/@pgsql/types@17.4.1...@pgsql/types@17.4.2) (2025-06-22)
+
+**Note:** Version bump only for package @pgsql/types
+
+
+
+
+
+## [17.4.1](https://github.com/launchql/pgsql-parser/compare/@pgsql/types@17.4.0...@pgsql/types@17.4.1) (2025-06-21)
+
+**Note:** Version bump only for package @pgsql/types
+
+
+
+
+
+# [17.4.0](https://github.com/launchql/pgsql-parser/compare/@pgsql/types@17.1.0...@pgsql/types@17.4.0) (2025-06-21)
+
+**Note:** Version bump only for package @pgsql/types
+
+
+
+
+
+# [17.2.0](https://github.com/launchql/pgsql-parser/compare/@pgsql/types@17.1.0...@pgsql/types@17.2.0) (2025-06-21)
+
+**Note:** Version bump only for package @pgsql/types
+
+
+
+
+
+# [17.1.0](https://github.com/launchql/pgsql-parser/compare/@pgsql/types@13.9.0...@pgsql/types@17.1.0) (2025-06-21)
+
+**Note:** Version bump only for package @pgsql/types
diff --git a/types/15/README.md b/types/15/README.md
new file mode 100644
index 00000000..81c50431
--- /dev/null
+++ b/types/15/README.md
@@ -0,0 +1,99 @@
+# @pgsql/types
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+`@pgsql/types` is a TypeScript library providing type definitions for PostgreSQL AST nodes, primarily used in conjunction with [`pgsql-parser`](https://github.com/launchql/pgsql-parser). It offers a comprehensive and type-safe way to interact with the AST nodes generated by PostgreSQL query parsing.
+
+
+## Installation
+
+Install the package via npm:
+
+```bash
+npm install @pgsql/types
+```
+
+## Usage
+
+`@pgsql/types` provides TypeScript type definitions for PostgreSQL Abstract Syntax Tree (AST) nodes. These types are useful for constructing, analyzing, or manipulating ASTs in a type-safe manner.
+
+Here are a few examples of how you can use these types in your TypeScript projects:
+
+### Validating AST Nodes
+
+You can use the types to validate AST nodes, ensuring they conform to the expected structure:
+
+```ts
+import { CreateStmt } from '@pgsql/types';
+
+function validateCreateStmt(stmt: CreateStmt) {
+ if (!stmt.relation || !stmt.tableElts) {
+ throw new Error('Invalid CreateStmt: missing required fields');
+ }
+ // Add more validation logic as needed
+ console.log('CreateStmt is valid');
+}
+
+// Example usage
+validateCreateStmt(createStmtObject);
+```
+
+### Constructing AST Nodes
+
+Types help ensure that you construct AST nodes correctly:
+
+```ts
+import { CreateStmt, ColumnDef, Constraint } from '@pgsql/types';
+
+const newColumn: ColumnDef = {
+ colname: 'id',
+ typeName: { names: [{ String: { str: 'int4' } }] },
+ constraints: [{ Constraint: { contype: 'CONSTR_PRIMARY' } }],
+};
+
+const createStmt: CreateStmt = {
+ relation: { relname: 'new_table' },
+ tableElts: [newColumn],
+};
+
+console.log(createStmt);
+```
+
+## Versions
+
+Our latest is built with PostgreSQL 17 AST types.
+
+| PG Major Version | libpg_query | npm dist-tag
+|--------------------------|-------------|---------|
+| 17 | 17-6.1.0 | [`pg17`](https://www.npmjs.com/package/@pgsql/types/v/latest)
+| 16 | 16-5.2.0 | [`pg16`](https://www.npmjs.com/package/@pgsql/types/v/pg16)
+| 15 | 15-4.2.4 | [`pg15`](https://www.npmjs.com/package/@pgsql/types/v/pg15)
+| 14 | 14-3.0.0 | [`pg14`](https://www.npmjs.com/package/@pgsql/types/v/pg14)
+| 13 | 13-2.2.0 | [`pg13`](https://www.npmjs.com/package/@pgsql/types/v/pg13)
+
+## Related
+
+* [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.
+* [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`.
+* [@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.
+* [@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.
+* [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.
+* [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.
+
+## Disclaimer
+
+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.
\ No newline at end of file
diff --git a/types/15/jest.config.js b/types/15/jest.config.js
new file mode 100644
index 00000000..0aa3aaa4
--- /dev/null
+++ b/types/15/jest.config.js
@@ -0,0 +1,18 @@
+/** @type {import('ts-jest').JestConfigWithTsJest} */
+module.exports = {
+ preset: "ts-jest",
+ testEnvironment: "node",
+ transform: {
+ "^.+\\.tsx?$": [
+ "ts-jest",
+ {
+ babelConfig: false,
+ tsconfig: "tsconfig.json",
+ },
+ ],
+ },
+ transformIgnorePatterns: [`/node_modules/*`],
+ testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
+ moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
+ modulePathIgnorePatterns: ["dist/*"]
+};
diff --git a/types/15/package.json b/types/15/package.json
new file mode 100644
index 00000000..6d7a2c00
--- /dev/null
+++ b/types/15/package.json
@@ -0,0 +1,39 @@
+{
+ "name": "@libpg-query/types15",
+ "version": "15.0.3",
+ "author": "Dan Lynch ",
+ "description": "PostgreSQL AST types from the real Postgres parser",
+ "main": "index.js",
+ "module": "esm/index.js",
+ "types": "index.d.ts",
+ "homepage": "https://github.com/launchql/libpg-query-node",
+ "license": "SEE LICENSE IN LICENSE",
+ "publishConfig": {
+ "access": "public",
+ "directory": "dist"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/launchql/libpg-query-node"
+ },
+ "bugs": {
+ "url": "https://github.com/launchql/libpg-query-node/issues"
+ },
+ "x-publish": {
+ "publishName": "@pgsql/types",
+ "distTag": "pg15"
+ },
+ "scripts": {
+ "copy": "copyfiles -f ../../LICENSE README.md package.json dist",
+ "clean": "rimraf dist",
+ "build": "pnpm run clean && tsc && tsc -p tsconfig.esm.json && pnpm run copy",
+ "build:dev": "pnpm run clean && tsc --declarationMap && tsc -p tsconfig.esm.json && pnpm run copy",
+ "build:proto": "ts-node scripts/pg-proto-parser",
+ "prepare:types": "node -e \"require('../../scripts/prepare-types.js').preparePackageForPublish('.')\"",
+ "lint": "eslint . --fix"
+ },
+ "keywords": [],
+ "devDependencies": {
+ "pg-proto-parser": "^1.28.2"
+ }
+}
diff --git a/types/15/scripts/pg-proto-parser.ts b/types/15/scripts/pg-proto-parser.ts
new file mode 100644
index 00000000..8b3cc796
--- /dev/null
+++ b/types/15/scripts/pg-proto-parser.ts
@@ -0,0 +1,20 @@
+import { PgProtoParser, PgProtoParserOptions } from 'pg-proto-parser';
+import { resolve, join } from 'path';
+
+const inFile: string = join(__dirname, '../../../protos/15/pg_query.proto');
+const outDir: string = resolve(join(__dirname, '../src'));
+
+const options: PgProtoParserOptions = {
+ outDir,
+ types: {
+ enabled: true,
+ wrappedNodeTypeExport: true
+ },
+ enums: {
+ enabled: true,
+ enumsAsTypeUnion: true
+ }
+};
+const parser = new PgProtoParser(inFile, options);
+
+parser.write();
diff --git a/types/15/src/enums.ts b/types/15/src/enums.ts
new file mode 100644
index 00000000..f85e0a43
--- /dev/null
+++ b/types/15/src/enums.ts
@@ -0,0 +1,64 @@
+/**
+* This file was automatically generated by pg-proto-parser@1.28.2.
+* DO NOT MODIFY IT BY HAND. Instead, modify the source proto file,
+* and run the pg-proto-parser generate command to regenerate this file.
+*/
+export type OverridingKind = "OVERRIDING_NOT_SET" | "OVERRIDING_USER_VALUE" | "OVERRIDING_SYSTEM_VALUE";
+export type QuerySource = "QSRC_ORIGINAL" | "QSRC_PARSER" | "QSRC_INSTEAD_RULE" | "QSRC_QUAL_INSTEAD_RULE" | "QSRC_NON_INSTEAD_RULE";
+export type SortByDir = "SORTBY_DEFAULT" | "SORTBY_ASC" | "SORTBY_DESC" | "SORTBY_USING";
+export type SortByNulls = "SORTBY_NULLS_DEFAULT" | "SORTBY_NULLS_FIRST" | "SORTBY_NULLS_LAST";
+export type SetQuantifier = "SET_QUANTIFIER_DEFAULT" | "SET_QUANTIFIER_ALL" | "SET_QUANTIFIER_DISTINCT";
+export type A_Expr_Kind = "AEXPR_OP" | "AEXPR_OP_ANY" | "AEXPR_OP_ALL" | "AEXPR_DISTINCT" | "AEXPR_NOT_DISTINCT" | "AEXPR_NULLIF" | "AEXPR_IN" | "AEXPR_LIKE" | "AEXPR_ILIKE" | "AEXPR_SIMILAR" | "AEXPR_BETWEEN" | "AEXPR_NOT_BETWEEN" | "AEXPR_BETWEEN_SYM" | "AEXPR_NOT_BETWEEN_SYM";
+export type RoleSpecType = "ROLESPEC_CSTRING" | "ROLESPEC_CURRENT_ROLE" | "ROLESPEC_CURRENT_USER" | "ROLESPEC_SESSION_USER" | "ROLESPEC_PUBLIC";
+export type TableLikeOption = "CREATE_TABLE_LIKE_COMMENTS" | "CREATE_TABLE_LIKE_COMPRESSION" | "CREATE_TABLE_LIKE_CONSTRAINTS" | "CREATE_TABLE_LIKE_DEFAULTS" | "CREATE_TABLE_LIKE_GENERATED" | "CREATE_TABLE_LIKE_IDENTITY" | "CREATE_TABLE_LIKE_INDEXES" | "CREATE_TABLE_LIKE_STATISTICS" | "CREATE_TABLE_LIKE_STORAGE" | "CREATE_TABLE_LIKE_ALL";
+export type DefElemAction = "DEFELEM_UNSPEC" | "DEFELEM_SET" | "DEFELEM_ADD" | "DEFELEM_DROP";
+export type PartitionRangeDatumKind = "PARTITION_RANGE_DATUM_MINVALUE" | "PARTITION_RANGE_DATUM_VALUE" | "PARTITION_RANGE_DATUM_MAXVALUE";
+export type RTEKind = "RTE_RELATION" | "RTE_SUBQUERY" | "RTE_JOIN" | "RTE_FUNCTION" | "RTE_TABLEFUNC" | "RTE_VALUES" | "RTE_CTE" | "RTE_NAMEDTUPLESTORE" | "RTE_RESULT";
+export type WCOKind = "WCO_VIEW_CHECK" | "WCO_RLS_INSERT_CHECK" | "WCO_RLS_UPDATE_CHECK" | "WCO_RLS_CONFLICT_CHECK" | "WCO_RLS_MERGE_UPDATE_CHECK" | "WCO_RLS_MERGE_DELETE_CHECK";
+export type GroupingSetKind = "GROUPING_SET_EMPTY" | "GROUPING_SET_SIMPLE" | "GROUPING_SET_ROLLUP" | "GROUPING_SET_CUBE" | "GROUPING_SET_SETS";
+export type CTEMaterialize = "CTEMaterializeDefault" | "CTEMaterializeAlways" | "CTEMaterializeNever";
+export type SetOperation = "SETOP_NONE" | "SETOP_UNION" | "SETOP_INTERSECT" | "SETOP_EXCEPT";
+export type ObjectType = "OBJECT_ACCESS_METHOD" | "OBJECT_AGGREGATE" | "OBJECT_AMOP" | "OBJECT_AMPROC" | "OBJECT_ATTRIBUTE" | "OBJECT_CAST" | "OBJECT_COLUMN" | "OBJECT_COLLATION" | "OBJECT_CONVERSION" | "OBJECT_DATABASE" | "OBJECT_DEFAULT" | "OBJECT_DEFACL" | "OBJECT_DOMAIN" | "OBJECT_DOMCONSTRAINT" | "OBJECT_EVENT_TRIGGER" | "OBJECT_EXTENSION" | "OBJECT_FDW" | "OBJECT_FOREIGN_SERVER" | "OBJECT_FOREIGN_TABLE" | "OBJECT_FUNCTION" | "OBJECT_INDEX" | "OBJECT_LANGUAGE" | "OBJECT_LARGEOBJECT" | "OBJECT_MATVIEW" | "OBJECT_OPCLASS" | "OBJECT_OPERATOR" | "OBJECT_OPFAMILY" | "OBJECT_PARAMETER_ACL" | "OBJECT_POLICY" | "OBJECT_PROCEDURE" | "OBJECT_PUBLICATION" | "OBJECT_PUBLICATION_NAMESPACE" | "OBJECT_PUBLICATION_REL" | "OBJECT_ROLE" | "OBJECT_ROUTINE" | "OBJECT_RULE" | "OBJECT_SCHEMA" | "OBJECT_SEQUENCE" | "OBJECT_SUBSCRIPTION" | "OBJECT_STATISTIC_EXT" | "OBJECT_TABCONSTRAINT" | "OBJECT_TABLE" | "OBJECT_TABLESPACE" | "OBJECT_TRANSFORM" | "OBJECT_TRIGGER" | "OBJECT_TSCONFIGURATION" | "OBJECT_TSDICTIONARY" | "OBJECT_TSPARSER" | "OBJECT_TSTEMPLATE" | "OBJECT_TYPE" | "OBJECT_USER_MAPPING" | "OBJECT_VIEW";
+export type DropBehavior = "DROP_RESTRICT" | "DROP_CASCADE";
+export type AlterTableType = "AT_AddColumn" | "AT_AddColumnRecurse" | "AT_AddColumnToView" | "AT_ColumnDefault" | "AT_CookedColumnDefault" | "AT_DropNotNull" | "AT_SetNotNull" | "AT_DropExpression" | "AT_CheckNotNull" | "AT_SetStatistics" | "AT_SetOptions" | "AT_ResetOptions" | "AT_SetStorage" | "AT_SetCompression" | "AT_DropColumn" | "AT_DropColumnRecurse" | "AT_AddIndex" | "AT_ReAddIndex" | "AT_AddConstraint" | "AT_AddConstraintRecurse" | "AT_ReAddConstraint" | "AT_ReAddDomainConstraint" | "AT_AlterConstraint" | "AT_ValidateConstraint" | "AT_ValidateConstraintRecurse" | "AT_AddIndexConstraint" | "AT_DropConstraint" | "AT_DropConstraintRecurse" | "AT_ReAddComment" | "AT_AlterColumnType" | "AT_AlterColumnGenericOptions" | "AT_ChangeOwner" | "AT_ClusterOn" | "AT_DropCluster" | "AT_SetLogged" | "AT_SetUnLogged" | "AT_DropOids" | "AT_SetAccessMethod" | "AT_SetTableSpace" | "AT_SetRelOptions" | "AT_ResetRelOptions" | "AT_ReplaceRelOptions" | "AT_EnableTrig" | "AT_EnableAlwaysTrig" | "AT_EnableReplicaTrig" | "AT_DisableTrig" | "AT_EnableTrigAll" | "AT_DisableTrigAll" | "AT_EnableTrigUser" | "AT_DisableTrigUser" | "AT_EnableRule" | "AT_EnableAlwaysRule" | "AT_EnableReplicaRule" | "AT_DisableRule" | "AT_AddInherit" | "AT_DropInherit" | "AT_AddOf" | "AT_DropOf" | "AT_ReplicaIdentity" | "AT_EnableRowSecurity" | "AT_DisableRowSecurity" | "AT_ForceRowSecurity" | "AT_NoForceRowSecurity" | "AT_GenericOptions" | "AT_AttachPartition" | "AT_DetachPartition" | "AT_DetachPartitionFinalize" | "AT_AddIdentity" | "AT_SetIdentity" | "AT_DropIdentity" | "AT_ReAddStatistics";
+export type GrantTargetType = "ACL_TARGET_OBJECT" | "ACL_TARGET_ALL_IN_SCHEMA" | "ACL_TARGET_DEFAULTS";
+export type VariableSetKind = "VAR_SET_VALUE" | "VAR_SET_DEFAULT" | "VAR_SET_CURRENT" | "VAR_SET_MULTI" | "VAR_RESET" | "VAR_RESET_ALL";
+export type ConstrType = "CONSTR_NULL" | "CONSTR_NOTNULL" | "CONSTR_DEFAULT" | "CONSTR_IDENTITY" | "CONSTR_GENERATED" | "CONSTR_CHECK" | "CONSTR_PRIMARY" | "CONSTR_UNIQUE" | "CONSTR_EXCLUSION" | "CONSTR_FOREIGN" | "CONSTR_ATTR_DEFERRABLE" | "CONSTR_ATTR_NOT_DEFERRABLE" | "CONSTR_ATTR_DEFERRED" | "CONSTR_ATTR_IMMEDIATE";
+export type ImportForeignSchemaType = "FDW_IMPORT_SCHEMA_ALL" | "FDW_IMPORT_SCHEMA_LIMIT_TO" | "FDW_IMPORT_SCHEMA_EXCEPT";
+export type RoleStmtType = "ROLESTMT_ROLE" | "ROLESTMT_USER" | "ROLESTMT_GROUP";
+export type FetchDirection = "FETCH_FORWARD" | "FETCH_BACKWARD" | "FETCH_ABSOLUTE" | "FETCH_RELATIVE";
+export type FunctionParameterMode = "FUNC_PARAM_IN" | "FUNC_PARAM_OUT" | "FUNC_PARAM_INOUT" | "FUNC_PARAM_VARIADIC" | "FUNC_PARAM_TABLE" | "FUNC_PARAM_DEFAULT";
+export type TransactionStmtKind = "TRANS_STMT_BEGIN" | "TRANS_STMT_START" | "TRANS_STMT_COMMIT" | "TRANS_STMT_ROLLBACK" | "TRANS_STMT_SAVEPOINT" | "TRANS_STMT_RELEASE" | "TRANS_STMT_ROLLBACK_TO" | "TRANS_STMT_PREPARE" | "TRANS_STMT_COMMIT_PREPARED" | "TRANS_STMT_ROLLBACK_PREPARED";
+export type ViewCheckOption = "NO_CHECK_OPTION" | "LOCAL_CHECK_OPTION" | "CASCADED_CHECK_OPTION";
+export type DiscardMode = "DISCARD_ALL" | "DISCARD_PLANS" | "DISCARD_SEQUENCES" | "DISCARD_TEMP";
+export type ReindexObjectType = "REINDEX_OBJECT_INDEX" | "REINDEX_OBJECT_TABLE" | "REINDEX_OBJECT_SCHEMA" | "REINDEX_OBJECT_SYSTEM" | "REINDEX_OBJECT_DATABASE";
+export type AlterTSConfigType = "ALTER_TSCONFIG_ADD_MAPPING" | "ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN" | "ALTER_TSCONFIG_REPLACE_DICT" | "ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN" | "ALTER_TSCONFIG_DROP_MAPPING";
+export type PublicationObjSpecType = "PUBLICATIONOBJ_TABLE" | "PUBLICATIONOBJ_TABLES_IN_SCHEMA" | "PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA" | "PUBLICATIONOBJ_CONTINUATION";
+export type AlterPublicationAction = "AP_AddObjects" | "AP_DropObjects" | "AP_SetObjects";
+export type AlterSubscriptionType = "ALTER_SUBSCRIPTION_OPTIONS" | "ALTER_SUBSCRIPTION_CONNECTION" | "ALTER_SUBSCRIPTION_SET_PUBLICATION" | "ALTER_SUBSCRIPTION_ADD_PUBLICATION" | "ALTER_SUBSCRIPTION_DROP_PUBLICATION" | "ALTER_SUBSCRIPTION_REFRESH" | "ALTER_SUBSCRIPTION_ENABLED" | "ALTER_SUBSCRIPTION_SKIP";
+export type OnCommitAction = "ONCOMMIT_NOOP" | "ONCOMMIT_PRESERVE_ROWS" | "ONCOMMIT_DELETE_ROWS" | "ONCOMMIT_DROP";
+export type ParamKind = "PARAM_EXTERN" | "PARAM_EXEC" | "PARAM_SUBLINK" | "PARAM_MULTIEXPR";
+export type CoercionContext = "COERCION_IMPLICIT" | "COERCION_ASSIGNMENT" | "COERCION_PLPGSQL" | "COERCION_EXPLICIT";
+export type CoercionForm = "COERCE_EXPLICIT_CALL" | "COERCE_EXPLICIT_CAST" | "COERCE_IMPLICIT_CAST" | "COERCE_SQL_SYNTAX";
+export type BoolExprType = "AND_EXPR" | "OR_EXPR" | "NOT_EXPR";
+export type SubLinkType = "EXISTS_SUBLINK" | "ALL_SUBLINK" | "ANY_SUBLINK" | "ROWCOMPARE_SUBLINK" | "EXPR_SUBLINK" | "MULTIEXPR_SUBLINK" | "ARRAY_SUBLINK" | "CTE_SUBLINK";
+export type RowCompareType = "ROWCOMPARE_LT" | "ROWCOMPARE_LE" | "ROWCOMPARE_EQ" | "ROWCOMPARE_GE" | "ROWCOMPARE_GT" | "ROWCOMPARE_NE";
+export type MinMaxOp = "IS_GREATEST" | "IS_LEAST";
+export type SQLValueFunctionOp = "SVFOP_CURRENT_DATE" | "SVFOP_CURRENT_TIME" | "SVFOP_CURRENT_TIME_N" | "SVFOP_CURRENT_TIMESTAMP" | "SVFOP_CURRENT_TIMESTAMP_N" | "SVFOP_LOCALTIME" | "SVFOP_LOCALTIME_N" | "SVFOP_LOCALTIMESTAMP" | "SVFOP_LOCALTIMESTAMP_N" | "SVFOP_CURRENT_ROLE" | "SVFOP_CURRENT_USER" | "SVFOP_USER" | "SVFOP_SESSION_USER" | "SVFOP_CURRENT_CATALOG" | "SVFOP_CURRENT_SCHEMA";
+export type XmlExprOp = "IS_XMLCONCAT" | "IS_XMLELEMENT" | "IS_XMLFOREST" | "IS_XMLPARSE" | "IS_XMLPI" | "IS_XMLROOT" | "IS_XMLSERIALIZE" | "IS_DOCUMENT";
+export type XmlOptionType = "XMLOPTION_DOCUMENT" | "XMLOPTION_CONTENT";
+export type NullTestType = "IS_NULL" | "IS_NOT_NULL";
+export type BoolTestType = "IS_TRUE" | "IS_NOT_TRUE" | "IS_FALSE" | "IS_NOT_FALSE" | "IS_UNKNOWN" | "IS_NOT_UNKNOWN";
+export type CmdType = "CMD_UNKNOWN" | "CMD_SELECT" | "CMD_UPDATE" | "CMD_INSERT" | "CMD_DELETE" | "CMD_MERGE" | "CMD_UTILITY" | "CMD_NOTHING";
+export type JoinType = "JOIN_INNER" | "JOIN_LEFT" | "JOIN_FULL" | "JOIN_RIGHT" | "JOIN_SEMI" | "JOIN_ANTI" | "JOIN_UNIQUE_OUTER" | "JOIN_UNIQUE_INNER";
+export type AggStrategy = "AGG_PLAIN" | "AGG_SORTED" | "AGG_HASHED" | "AGG_MIXED";
+export type AggSplit = "AGGSPLIT_SIMPLE" | "AGGSPLIT_INITIAL_SERIAL" | "AGGSPLIT_FINAL_DESERIAL";
+export type SetOpCmd = "SETOPCMD_INTERSECT" | "SETOPCMD_INTERSECT_ALL" | "SETOPCMD_EXCEPT" | "SETOPCMD_EXCEPT_ALL";
+export type SetOpStrategy = "SETOP_SORTED" | "SETOP_HASHED";
+export type OnConflictAction = "ONCONFLICT_NONE" | "ONCONFLICT_NOTHING" | "ONCONFLICT_UPDATE";
+export type LimitOption = "LIMIT_OPTION_DEFAULT" | "LIMIT_OPTION_COUNT" | "LIMIT_OPTION_WITH_TIES";
+export type LockClauseStrength = "LCS_NONE" | "LCS_FORKEYSHARE" | "LCS_FORSHARE" | "LCS_FORNOKEYUPDATE" | "LCS_FORUPDATE";
+export type LockWaitPolicy = "LockWaitBlock" | "LockWaitSkip" | "LockWaitError";
+export type LockTupleMode = "LockTupleKeyShare" | "LockTupleShare" | "LockTupleNoKeyExclusive" | "LockTupleExclusive";
+export type KeywordKind = "NO_KEYWORD" | "UNRESERVED_KEYWORD" | "COL_NAME_KEYWORD" | "TYPE_FUNC_NAME_KEYWORD" | "RESERVED_KEYWORD";
+export type Token = "NUL" | "ASCII_36" | "ASCII_37" | "ASCII_40" | "ASCII_41" | "ASCII_42" | "ASCII_43" | "ASCII_44" | "ASCII_45" | "ASCII_46" | "ASCII_47" | "ASCII_58" | "ASCII_59" | "ASCII_60" | "ASCII_61" | "ASCII_62" | "ASCII_63" | "ASCII_91" | "ASCII_92" | "ASCII_93" | "ASCII_94" | "IDENT" | "UIDENT" | "FCONST" | "SCONST" | "USCONST" | "BCONST" | "XCONST" | "Op" | "ICONST" | "PARAM" | "TYPECAST" | "DOT_DOT" | "COLON_EQUALS" | "EQUALS_GREATER" | "LESS_EQUALS" | "GREATER_EQUALS" | "NOT_EQUALS" | "SQL_COMMENT" | "C_COMMENT" | "ABORT_P" | "ABSOLUTE_P" | "ACCESS" | "ACTION" | "ADD_P" | "ADMIN" | "AFTER" | "AGGREGATE" | "ALL" | "ALSO" | "ALTER" | "ALWAYS" | "ANALYSE" | "ANALYZE" | "AND" | "ANY" | "ARRAY" | "AS" | "ASC" | "ASENSITIVE" | "ASSERTION" | "ASSIGNMENT" | "ASYMMETRIC" | "ATOMIC" | "AT" | "ATTACH" | "ATTRIBUTE" | "AUTHORIZATION" | "BACKWARD" | "BEFORE" | "BEGIN_P" | "BETWEEN" | "BIGINT" | "BINARY" | "BIT" | "BOOLEAN_P" | "BOTH" | "BREADTH" | "BY" | "CACHE" | "CALL" | "CALLED" | "CASCADE" | "CASCADED" | "CASE" | "CAST" | "CATALOG_P" | "CHAIN" | "CHAR_P" | "CHARACTER" | "CHARACTERISTICS" | "CHECK" | "CHECKPOINT" | "CLASS" | "CLOSE" | "CLUSTER" | "COALESCE" | "COLLATE" | "COLLATION" | "COLUMN" | "COLUMNS" | "COMMENT" | "COMMENTS" | "COMMIT" | "COMMITTED" | "COMPRESSION" | "CONCURRENTLY" | "CONFIGURATION" | "CONFLICT" | "CONNECTION" | "CONSTRAINT" | "CONSTRAINTS" | "CONTENT_P" | "CONTINUE_P" | "CONVERSION_P" | "COPY" | "COST" | "CREATE" | "CROSS" | "CSV" | "CUBE" | "CURRENT_P" | "CURRENT_CATALOG" | "CURRENT_DATE" | "CURRENT_ROLE" | "CURRENT_SCHEMA" | "CURRENT_TIME" | "CURRENT_TIMESTAMP" | "CURRENT_USER" | "CURSOR" | "CYCLE" | "DATA_P" | "DATABASE" | "DAY_P" | "DEALLOCATE" | "DEC" | "DECIMAL_P" | "DECLARE" | "DEFAULT" | "DEFAULTS" | "DEFERRABLE" | "DEFERRED" | "DEFINER" | "DELETE_P" | "DELIMITER" | "DELIMITERS" | "DEPENDS" | "DEPTH" | "DESC" | "DETACH" | "DICTIONARY" | "DISABLE_P" | "DISCARD" | "DISTINCT" | "DO" | "DOCUMENT_P" | "DOMAIN_P" | "DOUBLE_P" | "DROP" | "EACH" | "ELSE" | "ENABLE_P" | "ENCODING" | "ENCRYPTED" | "END_P" | "ENUM_P" | "ESCAPE" | "EVENT" | "EXCEPT" | "EXCLUDE" | "EXCLUDING" | "EXCLUSIVE" | "EXECUTE" | "EXISTS" | "EXPLAIN" | "EXPRESSION" | "EXTENSION" | "EXTERNAL" | "EXTRACT" | "FALSE_P" | "FAMILY" | "FETCH" | "FILTER" | "FINALIZE" | "FIRST_P" | "FLOAT_P" | "FOLLOWING" | "FOR" | "FORCE" | "FOREIGN" | "FORWARD" | "FREEZE" | "FROM" | "FULL" | "FUNCTION" | "FUNCTIONS" | "GENERATED" | "GLOBAL" | "GRANT" | "GRANTED" | "GREATEST" | "GROUP_P" | "GROUPING" | "GROUPS" | "HANDLER" | "HAVING" | "HEADER_P" | "HOLD" | "HOUR_P" | "IDENTITY_P" | "IF_P" | "ILIKE" | "IMMEDIATE" | "IMMUTABLE" | "IMPLICIT_P" | "IMPORT_P" | "IN_P" | "INCLUDE" | "INCLUDING" | "INCREMENT" | "INDEX" | "INDEXES" | "INHERIT" | "INHERITS" | "INITIALLY" | "INLINE_P" | "INNER_P" | "INOUT" | "INPUT_P" | "INSENSITIVE" | "INSERT" | "INSTEAD" | "INT_P" | "INTEGER" | "INTERSECT" | "INTERVAL" | "INTO" | "INVOKER" | "IS" | "ISNULL" | "ISOLATION" | "JOIN" | "KEY" | "LABEL" | "LANGUAGE" | "LARGE_P" | "LAST_P" | "LATERAL_P" | "LEADING" | "LEAKPROOF" | "LEAST" | "LEFT" | "LEVEL" | "LIKE" | "LIMIT" | "LISTEN" | "LOAD" | "LOCAL" | "LOCALTIME" | "LOCALTIMESTAMP" | "LOCATION" | "LOCK_P" | "LOCKED" | "LOGGED" | "MAPPING" | "MATCH" | "MATCHED" | "MATERIALIZED" | "MAXVALUE" | "MERGE" | "METHOD" | "MINUTE_P" | "MINVALUE" | "MODE" | "MONTH_P" | "MOVE" | "NAME_P" | "NAMES" | "NATIONAL" | "NATURAL" | "NCHAR" | "NEW" | "NEXT" | "NFC" | "NFD" | "NFKC" | "NFKD" | "NO" | "NONE" | "NORMALIZE" | "NORMALIZED" | "NOT" | "NOTHING" | "NOTIFY" | "NOTNULL" | "NOWAIT" | "NULL_P" | "NULLIF" | "NULLS_P" | "NUMERIC" | "OBJECT_P" | "OF" | "OFF" | "OFFSET" | "OIDS" | "OLD" | "ON" | "ONLY" | "OPERATOR" | "OPTION" | "OPTIONS" | "OR" | "ORDER" | "ORDINALITY" | "OTHERS" | "OUT_P" | "OUTER_P" | "OVER" | "OVERLAPS" | "OVERLAY" | "OVERRIDING" | "OWNED" | "OWNER" | "PARALLEL" | "PARAMETER" | "PARSER" | "PARTIAL" | "PARTITION" | "PASSING" | "PASSWORD" | "PLACING" | "PLANS" | "POLICY" | "POSITION" | "PRECEDING" | "PRECISION" | "PRESERVE" | "PREPARE" | "PREPARED" | "PRIMARY" | "PRIOR" | "PRIVILEGES" | "PROCEDURAL" | "PROCEDURE" | "PROCEDURES" | "PROGRAM" | "PUBLICATION" | "QUOTE" | "RANGE" | "READ" | "REAL" | "REASSIGN" | "RECHECK" | "RECURSIVE" | "REF_P" | "REFERENCES" | "REFERENCING" | "REFRESH" | "REINDEX" | "RELATIVE_P" | "RELEASE" | "RENAME" | "REPEATABLE" | "REPLACE" | "REPLICA" | "RESET" | "RESTART" | "RESTRICT" | "RETURN" | "RETURNING" | "RETURNS" | "REVOKE" | "RIGHT" | "ROLE" | "ROLLBACK" | "ROLLUP" | "ROUTINE" | "ROUTINES" | "ROW" | "ROWS" | "RULE" | "SAVEPOINT" | "SCHEMA" | "SCHEMAS" | "SCROLL" | "SEARCH" | "SECOND_P" | "SECURITY" | "SELECT" | "SEQUENCE" | "SEQUENCES" | "SERIALIZABLE" | "SERVER" | "SESSION" | "SESSION_USER" | "SET" | "SETS" | "SETOF" | "SHARE" | "SHOW" | "SIMILAR" | "SIMPLE" | "SKIP" | "SMALLINT" | "SNAPSHOT" | "SOME" | "SQL_P" | "STABLE" | "STANDALONE_P" | "START" | "STATEMENT" | "STATISTICS" | "STDIN" | "STDOUT" | "STORAGE" | "STORED" | "STRICT_P" | "STRIP_P" | "SUBSCRIPTION" | "SUBSTRING" | "SUPPORT" | "SYMMETRIC" | "SYSID" | "SYSTEM_P" | "TABLE" | "TABLES" | "TABLESAMPLE" | "TABLESPACE" | "TEMP" | "TEMPLATE" | "TEMPORARY" | "TEXT_P" | "THEN" | "TIES" | "TIME" | "TIMESTAMP" | "TO" | "TRAILING" | "TRANSACTION" | "TRANSFORM" | "TREAT" | "TRIGGER" | "TRIM" | "TRUE_P" | "TRUNCATE" | "TRUSTED" | "TYPE_P" | "TYPES_P" | "UESCAPE" | "UNBOUNDED" | "UNCOMMITTED" | "UNENCRYPTED" | "UNION" | "UNIQUE" | "UNKNOWN" | "UNLISTEN" | "UNLOGGED" | "UNTIL" | "UPDATE" | "USER" | "USING" | "VACUUM" | "VALID" | "VALIDATE" | "VALIDATOR" | "VALUE_P" | "VALUES" | "VARCHAR" | "VARIADIC" | "VARYING" | "VERBOSE" | "VERSION_P" | "VIEW" | "VIEWS" | "VOLATILE" | "WHEN" | "WHERE" | "WHITESPACE_P" | "WINDOW" | "WITH" | "WITHIN" | "WITHOUT" | "WORK" | "WRAPPER" | "WRITE" | "XML_P" | "XMLATTRIBUTES" | "XMLCONCAT" | "XMLELEMENT" | "XMLEXISTS" | "XMLFOREST" | "XMLNAMESPACES" | "XMLPARSE" | "XMLPI" | "XMLROOT" | "XMLSERIALIZE" | "XMLTABLE" | "YEAR_P" | "YES_P" | "ZONE" | "NOT_LA" | "NULLS_LA" | "WITH_LA" | "MODE_TYPE_NAME" | "MODE_PLPGSQL_EXPR" | "MODE_PLPGSQL_ASSIGN1" | "MODE_PLPGSQL_ASSIGN2" | "MODE_PLPGSQL_ASSIGN3" | "UMINUS";
\ No newline at end of file
diff --git a/types/15/src/index.ts b/types/15/src/index.ts
new file mode 100644
index 00000000..dc5ee069
--- /dev/null
+++ b/types/15/src/index.ts
@@ -0,0 +1,2 @@
+export * from './types';
+export * from './enums';
diff --git a/types/15/src/types.ts b/types/15/src/types.ts
new file mode 100644
index 00000000..4b2fba14
--- /dev/null
+++ b/types/15/src/types.ts
@@ -0,0 +1,2220 @@
+/**
+* This file was automatically generated by pg-proto-parser@1.28.2.
+* DO NOT MODIFY IT BY HAND. Instead, modify the source proto file,
+* and run the pg-proto-parser generate command to regenerate this file.
+*/
+import { OverridingKind, QuerySource, SortByDir, SortByNulls, SetQuantifier, A_Expr_Kind, RoleSpecType, TableLikeOption, DefElemAction, PartitionRangeDatumKind, RTEKind, WCOKind, GroupingSetKind, CTEMaterialize, SetOperation, ObjectType, DropBehavior, AlterTableType, GrantTargetType, VariableSetKind, ConstrType, ImportForeignSchemaType, RoleStmtType, FetchDirection, FunctionParameterMode, TransactionStmtKind, ViewCheckOption, DiscardMode, ReindexObjectType, AlterTSConfigType, PublicationObjSpecType, AlterPublicationAction, AlterSubscriptionType, OnCommitAction, ParamKind, CoercionContext, CoercionForm, BoolExprType, SubLinkType, RowCompareType, MinMaxOp, SQLValueFunctionOp, XmlExprOp, XmlOptionType, NullTestType, BoolTestType, CmdType, JoinType, AggStrategy, AggSplit, SetOpCmd, SetOpStrategy, OnConflictAction, LimitOption, LockClauseStrength, LockWaitPolicy, LockTupleMode, KeywordKind, Token } from "./enums";
+export type Node = {
+ ParseResult: ParseResult;
+} | {
+ ScanResult: ScanResult;
+} | {
+ Integer: Integer;
+} | {
+ Float: Float;
+} | {
+ Boolean: Boolean;
+} | {
+ String: String;
+} | {
+ BitString: BitString;
+} | {
+ List: List;
+} | {
+ OidList: OidList;
+} | {
+ IntList: IntList;
+} | {
+ A_Const: A_Const;
+} | {
+ Alias: Alias;
+} | {
+ RangeVar: RangeVar;
+} | {
+ TableFunc: TableFunc;
+} | {
+ Var: Var;
+} | {
+ Param: Param;
+} | {
+ Aggref: Aggref;
+} | {
+ GroupingFunc: GroupingFunc;
+} | {
+ WindowFunc: WindowFunc;
+} | {
+ SubscriptingRef: SubscriptingRef;
+} | {
+ FuncExpr: FuncExpr;
+} | {
+ NamedArgExpr: NamedArgExpr;
+} | {
+ OpExpr: OpExpr;
+} | {
+ DistinctExpr: DistinctExpr;
+} | {
+ NullIfExpr: NullIfExpr;
+} | {
+ ScalarArrayOpExpr: ScalarArrayOpExpr;
+} | {
+ BoolExpr: BoolExpr;
+} | {
+ SubLink: SubLink;
+} | {
+ SubPlan: SubPlan;
+} | {
+ AlternativeSubPlan: AlternativeSubPlan;
+} | {
+ FieldSelect: FieldSelect;
+} | {
+ FieldStore: FieldStore;
+} | {
+ RelabelType: RelabelType;
+} | {
+ CoerceViaIO: CoerceViaIO;
+} | {
+ ArrayCoerceExpr: ArrayCoerceExpr;
+} | {
+ ConvertRowtypeExpr: ConvertRowtypeExpr;
+} | {
+ CollateExpr: CollateExpr;
+} | {
+ CaseExpr: CaseExpr;
+} | {
+ CaseWhen: CaseWhen;
+} | {
+ CaseTestExpr: CaseTestExpr;
+} | {
+ ArrayExpr: ArrayExpr;
+} | {
+ RowExpr: RowExpr;
+} | {
+ RowCompareExpr: RowCompareExpr;
+} | {
+ CoalesceExpr: CoalesceExpr;
+} | {
+ MinMaxExpr: MinMaxExpr;
+} | {
+ SQLValueFunction: SQLValueFunction;
+} | {
+ XmlExpr: XmlExpr;
+} | {
+ NullTest: NullTest;
+} | {
+ BooleanTest: BooleanTest;
+} | {
+ CoerceToDomain: CoerceToDomain;
+} | {
+ CoerceToDomainValue: CoerceToDomainValue;
+} | {
+ SetToDefault: SetToDefault;
+} | {
+ CurrentOfExpr: CurrentOfExpr;
+} | {
+ NextValueExpr: NextValueExpr;
+} | {
+ InferenceElem: InferenceElem;
+} | {
+ TargetEntry: TargetEntry;
+} | {
+ RangeTblRef: RangeTblRef;
+} | {
+ JoinExpr: JoinExpr;
+} | {
+ FromExpr: FromExpr;
+} | {
+ OnConflictExpr: OnConflictExpr;
+} | {
+ IntoClause: IntoClause;
+} | {
+ MergeAction: MergeAction;
+} | {
+ RawStmt: RawStmt;
+} | {
+ Query: Query;
+} | {
+ InsertStmt: InsertStmt;
+} | {
+ DeleteStmt: DeleteStmt;
+} | {
+ UpdateStmt: UpdateStmt;
+} | {
+ MergeStmt: MergeStmt;
+} | {
+ SelectStmt: SelectStmt;
+} | {
+ ReturnStmt: ReturnStmt;
+} | {
+ PLAssignStmt: PLAssignStmt;
+} | {
+ AlterTableStmt: AlterTableStmt;
+} | {
+ AlterTableCmd: AlterTableCmd;
+} | {
+ AlterDomainStmt: AlterDomainStmt;
+} | {
+ SetOperationStmt: SetOperationStmt;
+} | {
+ GrantStmt: GrantStmt;
+} | {
+ GrantRoleStmt: GrantRoleStmt;
+} | {
+ AlterDefaultPrivilegesStmt: AlterDefaultPrivilegesStmt;
+} | {
+ ClosePortalStmt: ClosePortalStmt;
+} | {
+ ClusterStmt: ClusterStmt;
+} | {
+ CopyStmt: CopyStmt;
+} | {
+ CreateStmt: CreateStmt;
+} | {
+ DefineStmt: DefineStmt;
+} | {
+ DropStmt: DropStmt;
+} | {
+ TruncateStmt: TruncateStmt;
+} | {
+ CommentStmt: CommentStmt;
+} | {
+ FetchStmt: FetchStmt;
+} | {
+ IndexStmt: IndexStmt;
+} | {
+ CreateFunctionStmt: CreateFunctionStmt;
+} | {
+ AlterFunctionStmt: AlterFunctionStmt;
+} | {
+ DoStmt: DoStmt;
+} | {
+ RenameStmt: RenameStmt;
+} | {
+ RuleStmt: RuleStmt;
+} | {
+ NotifyStmt: NotifyStmt;
+} | {
+ ListenStmt: ListenStmt;
+} | {
+ UnlistenStmt: UnlistenStmt;
+} | {
+ TransactionStmt: TransactionStmt;
+} | {
+ ViewStmt: ViewStmt;
+} | {
+ LoadStmt: LoadStmt;
+} | {
+ CreateDomainStmt: CreateDomainStmt;
+} | {
+ CreatedbStmt: CreatedbStmt;
+} | {
+ DropdbStmt: DropdbStmt;
+} | {
+ VacuumStmt: VacuumStmt;
+} | {
+ ExplainStmt: ExplainStmt;
+} | {
+ CreateTableAsStmt: CreateTableAsStmt;
+} | {
+ CreateSeqStmt: CreateSeqStmt;
+} | {
+ AlterSeqStmt: AlterSeqStmt;
+} | {
+ VariableSetStmt: VariableSetStmt;
+} | {
+ VariableShowStmt: VariableShowStmt;
+} | {
+ DiscardStmt: DiscardStmt;
+} | {
+ CreateTrigStmt: CreateTrigStmt;
+} | {
+ CreatePLangStmt: CreatePLangStmt;
+} | {
+ CreateRoleStmt: CreateRoleStmt;
+} | {
+ AlterRoleStmt: AlterRoleStmt;
+} | {
+ DropRoleStmt: DropRoleStmt;
+} | {
+ LockStmt: LockStmt;
+} | {
+ ConstraintsSetStmt: ConstraintsSetStmt;
+} | {
+ ReindexStmt: ReindexStmt;
+} | {
+ CheckPointStmt: CheckPointStmt;
+} | {
+ CreateSchemaStmt: CreateSchemaStmt;
+} | {
+ AlterDatabaseStmt: AlterDatabaseStmt;
+} | {
+ AlterDatabaseRefreshCollStmt: AlterDatabaseRefreshCollStmt;
+} | {
+ AlterDatabaseSetStmt: AlterDatabaseSetStmt;
+} | {
+ AlterRoleSetStmt: AlterRoleSetStmt;
+} | {
+ CreateConversionStmt: CreateConversionStmt;
+} | {
+ CreateCastStmt: CreateCastStmt;
+} | {
+ CreateOpClassStmt: CreateOpClassStmt;
+} | {
+ CreateOpFamilyStmt: CreateOpFamilyStmt;
+} | {
+ AlterOpFamilyStmt: AlterOpFamilyStmt;
+} | {
+ PrepareStmt: PrepareStmt;
+} | {
+ ExecuteStmt: ExecuteStmt;
+} | {
+ DeallocateStmt: DeallocateStmt;
+} | {
+ DeclareCursorStmt: DeclareCursorStmt;
+} | {
+ CreateTableSpaceStmt: CreateTableSpaceStmt;
+} | {
+ DropTableSpaceStmt: DropTableSpaceStmt;
+} | {
+ AlterObjectDependsStmt: AlterObjectDependsStmt;
+} | {
+ AlterObjectSchemaStmt: AlterObjectSchemaStmt;
+} | {
+ AlterOwnerStmt: AlterOwnerStmt;
+} | {
+ AlterOperatorStmt: AlterOperatorStmt;
+} | {
+ AlterTypeStmt: AlterTypeStmt;
+} | {
+ DropOwnedStmt: DropOwnedStmt;
+} | {
+ ReassignOwnedStmt: ReassignOwnedStmt;
+} | {
+ CompositeTypeStmt: CompositeTypeStmt;
+} | {
+ CreateEnumStmt: CreateEnumStmt;
+} | {
+ CreateRangeStmt: CreateRangeStmt;
+} | {
+ AlterEnumStmt: AlterEnumStmt;
+} | {
+ AlterTSDictionaryStmt: AlterTSDictionaryStmt;
+} | {
+ AlterTSConfigurationStmt: AlterTSConfigurationStmt;
+} | {
+ CreateFdwStmt: CreateFdwStmt;
+} | {
+ AlterFdwStmt: AlterFdwStmt;
+} | {
+ CreateForeignServerStmt: CreateForeignServerStmt;
+} | {
+ AlterForeignServerStmt: AlterForeignServerStmt;
+} | {
+ CreateUserMappingStmt: CreateUserMappingStmt;
+} | {
+ AlterUserMappingStmt: AlterUserMappingStmt;
+} | {
+ DropUserMappingStmt: DropUserMappingStmt;
+} | {
+ AlterTableSpaceOptionsStmt: AlterTableSpaceOptionsStmt;
+} | {
+ AlterTableMoveAllStmt: AlterTableMoveAllStmt;
+} | {
+ SecLabelStmt: SecLabelStmt;
+} | {
+ CreateForeignTableStmt: CreateForeignTableStmt;
+} | {
+ ImportForeignSchemaStmt: ImportForeignSchemaStmt;
+} | {
+ CreateExtensionStmt: CreateExtensionStmt;
+} | {
+ AlterExtensionStmt: AlterExtensionStmt;
+} | {
+ AlterExtensionContentsStmt: AlterExtensionContentsStmt;
+} | {
+ CreateEventTrigStmt: CreateEventTrigStmt;
+} | {
+ AlterEventTrigStmt: AlterEventTrigStmt;
+} | {
+ RefreshMatViewStmt: RefreshMatViewStmt;
+} | {
+ ReplicaIdentityStmt: ReplicaIdentityStmt;
+} | {
+ AlterSystemStmt: AlterSystemStmt;
+} | {
+ CreatePolicyStmt: CreatePolicyStmt;
+} | {
+ AlterPolicyStmt: AlterPolicyStmt;
+} | {
+ CreateTransformStmt: CreateTransformStmt;
+} | {
+ CreateAmStmt: CreateAmStmt;
+} | {
+ CreatePublicationStmt: CreatePublicationStmt;
+} | {
+ AlterPublicationStmt: AlterPublicationStmt;
+} | {
+ CreateSubscriptionStmt: CreateSubscriptionStmt;
+} | {
+ AlterSubscriptionStmt: AlterSubscriptionStmt;
+} | {
+ DropSubscriptionStmt: DropSubscriptionStmt;
+} | {
+ CreateStatsStmt: CreateStatsStmt;
+} | {
+ AlterCollationStmt: AlterCollationStmt;
+} | {
+ CallStmt: CallStmt;
+} | {
+ AlterStatsStmt: AlterStatsStmt;
+} | {
+ A_Expr: A_Expr;
+} | {
+ ColumnRef: ColumnRef;
+} | {
+ ParamRef: ParamRef;
+} | {
+ FuncCall: FuncCall;
+} | {
+ A_Star: A_Star;
+} | {
+ A_Indices: A_Indices;
+} | {
+ A_Indirection: A_Indirection;
+} | {
+ A_ArrayExpr: A_ArrayExpr;
+} | {
+ ResTarget: ResTarget;
+} | {
+ MultiAssignRef: MultiAssignRef;
+} | {
+ TypeCast: TypeCast;
+} | {
+ CollateClause: CollateClause;
+} | {
+ SortBy: SortBy;
+} | {
+ WindowDef: WindowDef;
+} | {
+ RangeSubselect: RangeSubselect;
+} | {
+ RangeFunction: RangeFunction;
+} | {
+ RangeTableSample: RangeTableSample;
+} | {
+ RangeTableFunc: RangeTableFunc;
+} | {
+ RangeTableFuncCol: RangeTableFuncCol;
+} | {
+ TypeName: TypeName;
+} | {
+ ColumnDef: ColumnDef;
+} | {
+ IndexElem: IndexElem;
+} | {
+ StatsElem: StatsElem;
+} | {
+ Constraint: Constraint;
+} | {
+ DefElem: DefElem;
+} | {
+ RangeTblEntry: RangeTblEntry;
+} | {
+ RangeTblFunction: RangeTblFunction;
+} | {
+ TableSampleClause: TableSampleClause;
+} | {
+ WithCheckOption: WithCheckOption;
+} | {
+ SortGroupClause: SortGroupClause;
+} | {
+ GroupingSet: GroupingSet;
+} | {
+ WindowClause: WindowClause;
+} | {
+ ObjectWithArgs: ObjectWithArgs;
+} | {
+ AccessPriv: AccessPriv;
+} | {
+ CreateOpClassItem: CreateOpClassItem;
+} | {
+ TableLikeClause: TableLikeClause;
+} | {
+ FunctionParameter: FunctionParameter;
+} | {
+ LockingClause: LockingClause;
+} | {
+ RowMarkClause: RowMarkClause;
+} | {
+ XmlSerialize: XmlSerialize;
+} | {
+ WithClause: WithClause;
+} | {
+ InferClause: InferClause;
+} | {
+ OnConflictClause: OnConflictClause;
+} | {
+ CTESearchClause: CTESearchClause;
+} | {
+ CTECycleClause: CTECycleClause;
+} | {
+ CommonTableExpr: CommonTableExpr;
+} | {
+ MergeWhenClause: MergeWhenClause;
+} | {
+ RoleSpec: RoleSpec;
+} | {
+ TriggerTransition: TriggerTransition;
+} | {
+ PartitionElem: PartitionElem;
+} | {
+ PartitionSpec: PartitionSpec;
+} | {
+ PartitionBoundSpec: PartitionBoundSpec;
+} | {
+ PartitionRangeDatum: PartitionRangeDatum;
+} | {
+ PartitionCmd: PartitionCmd;
+} | {
+ VacuumRelation: VacuumRelation;
+} | {
+ PublicationObjSpec: PublicationObjSpec;
+} | {
+ PublicationTable: PublicationTable;
+} | {
+ InlineCodeBlock: InlineCodeBlock;
+} | {
+ CallContext: CallContext;
+} | {
+ ScanToken: ScanToken;
+};
+export interface ParseResult {
+ version?: number;
+ stmts?: RawStmt[];
+}
+export interface ScanResult {
+ version?: number;
+ tokens?: ScanToken[];
+}
+export interface Integer {
+ ival?: number;
+}
+export interface Float {
+ fval?: string;
+}
+export interface Boolean {
+ boolval?: boolean;
+}
+export interface String {
+ sval?: string;
+}
+export interface BitString {
+ bsval?: string;
+}
+export interface List {
+ items?: Node[];
+}
+export interface OidList {
+ items?: Node[];
+}
+export interface IntList {
+ items?: Node[];
+}
+export interface A_Const {
+ ival?: Integer;
+ fval?: Float;
+ boolval?: Boolean;
+ sval?: String;
+ bsval?: BitString;
+ isnull?: boolean;
+ location?: number;
+}
+export interface Alias {
+ aliasname?: string;
+ colnames?: Node[];
+}
+export interface RangeVar {
+ catalogname?: string;
+ schemaname?: string;
+ relname?: string;
+ inh?: boolean;
+ relpersistence?: string;
+ alias?: Alias;
+ location?: number;
+}
+export interface TableFunc {
+ ns_uris?: Node[];
+ ns_names?: Node[];
+ docexpr?: Node;
+ rowexpr?: Node;
+ colnames?: Node[];
+ coltypes?: Node[];
+ coltypmods?: Node[];
+ colcollations?: Node[];
+ colexprs?: Node[];
+ coldefexprs?: Node[];
+ notnulls?: bigint[];
+ ordinalitycol?: number;
+ location?: number;
+}
+export interface Var {
+ xpr?: Node;
+ varno?: number;
+ varattno?: number;
+ vartype?: number;
+ vartypmod?: number;
+ varcollid?: number;
+ varlevelsup?: number;
+ varnosyn?: number;
+ varattnosyn?: number;
+ location?: number;
+}
+export interface Param {
+ xpr?: Node;
+ paramkind?: ParamKind;
+ paramid?: number;
+ paramtype?: number;
+ paramtypmod?: number;
+ paramcollid?: number;
+ location?: number;
+}
+export interface Aggref {
+ xpr?: Node;
+ aggfnoid?: number;
+ aggtype?: number;
+ aggcollid?: number;
+ inputcollid?: number;
+ aggtranstype?: number;
+ aggargtypes?: Node[];
+ aggdirectargs?: Node[];
+ args?: Node[];
+ aggorder?: Node[];
+ aggdistinct?: Node[];
+ aggfilter?: Node;
+ aggstar?: boolean;
+ aggvariadic?: boolean;
+ aggkind?: string;
+ agglevelsup?: number;
+ aggsplit?: AggSplit;
+ aggno?: number;
+ aggtransno?: number;
+ location?: number;
+}
+export interface GroupingFunc {
+ xpr?: Node;
+ args?: Node[];
+ refs?: Node[];
+ cols?: Node[];
+ agglevelsup?: number;
+ location?: number;
+}
+export interface WindowFunc {
+ xpr?: Node;
+ winfnoid?: number;
+ wintype?: number;
+ wincollid?: number;
+ inputcollid?: number;
+ args?: Node[];
+ aggfilter?: Node;
+ winref?: number;
+ winstar?: boolean;
+ winagg?: boolean;
+ location?: number;
+}
+export interface SubscriptingRef {
+ xpr?: Node;
+ refcontainertype?: number;
+ refelemtype?: number;
+ refrestype?: number;
+ reftypmod?: number;
+ refcollid?: number;
+ refupperindexpr?: Node[];
+ reflowerindexpr?: Node[];
+ refexpr?: Node;
+ refassgnexpr?: Node;
+}
+export interface FuncExpr {
+ xpr?: Node;
+ funcid?: number;
+ funcresulttype?: number;
+ funcretset?: boolean;
+ funcvariadic?: boolean;
+ funcformat?: CoercionForm;
+ funccollid?: number;
+ inputcollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface NamedArgExpr {
+ xpr?: Node;
+ arg?: Node;
+ name?: string;
+ argnumber?: number;
+ location?: number;
+}
+export interface OpExpr {
+ xpr?: Node;
+ opno?: number;
+ opfuncid?: number;
+ opresulttype?: number;
+ opretset?: boolean;
+ opcollid?: number;
+ inputcollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface DistinctExpr {
+ xpr?: Node;
+ opno?: number;
+ opfuncid?: number;
+ opresulttype?: number;
+ opretset?: boolean;
+ opcollid?: number;
+ inputcollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface NullIfExpr {
+ xpr?: Node;
+ opno?: number;
+ opfuncid?: number;
+ opresulttype?: number;
+ opretset?: boolean;
+ opcollid?: number;
+ inputcollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface ScalarArrayOpExpr {
+ xpr?: Node;
+ opno?: number;
+ opfuncid?: number;
+ hashfuncid?: number;
+ negfuncid?: number;
+ useOr?: boolean;
+ inputcollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface BoolExpr {
+ xpr?: Node;
+ boolop?: BoolExprType;
+ args?: Node[];
+ location?: number;
+}
+export interface SubLink {
+ xpr?: Node;
+ subLinkType?: SubLinkType;
+ subLinkId?: number;
+ testexpr?: Node;
+ operName?: Node[];
+ subselect?: Node;
+ location?: number;
+}
+export interface SubPlan {
+ xpr?: Node;
+ subLinkType?: SubLinkType;
+ testexpr?: Node;
+ paramIds?: Node[];
+ plan_id?: number;
+ plan_name?: string;
+ firstColType?: number;
+ firstColTypmod?: number;
+ firstColCollation?: number;
+ useHashTable?: boolean;
+ unknownEqFalse?: boolean;
+ parallel_safe?: boolean;
+ setParam?: Node[];
+ parParam?: Node[];
+ args?: Node[];
+ startup_cost?: number;
+ per_call_cost?: number;
+}
+export interface AlternativeSubPlan {
+ xpr?: Node;
+ subplans?: Node[];
+}
+export interface FieldSelect {
+ xpr?: Node;
+ arg?: Node;
+ fieldnum?: number;
+ resulttype?: number;
+ resulttypmod?: number;
+ resultcollid?: number;
+}
+export interface FieldStore {
+ xpr?: Node;
+ arg?: Node;
+ newvals?: Node[];
+ fieldnums?: Node[];
+ resulttype?: number;
+}
+export interface RelabelType {
+ xpr?: Node;
+ arg?: Node;
+ resulttype?: number;
+ resulttypmod?: number;
+ resultcollid?: number;
+ relabelformat?: CoercionForm;
+ location?: number;
+}
+export interface CoerceViaIO {
+ xpr?: Node;
+ arg?: Node;
+ resulttype?: number;
+ resultcollid?: number;
+ coerceformat?: CoercionForm;
+ location?: number;
+}
+export interface ArrayCoerceExpr {
+ xpr?: Node;
+ arg?: Node;
+ elemexpr?: Node;
+ resulttype?: number;
+ resulttypmod?: number;
+ resultcollid?: number;
+ coerceformat?: CoercionForm;
+ location?: number;
+}
+export interface ConvertRowtypeExpr {
+ xpr?: Node;
+ arg?: Node;
+ resulttype?: number;
+ convertformat?: CoercionForm;
+ location?: number;
+}
+export interface CollateExpr {
+ xpr?: Node;
+ arg?: Node;
+ collOid?: number;
+ location?: number;
+}
+export interface CaseExpr {
+ xpr?: Node;
+ casetype?: number;
+ casecollid?: number;
+ arg?: Node;
+ args?: Node[];
+ defresult?: Node;
+ location?: number;
+}
+export interface CaseWhen {
+ xpr?: Node;
+ expr?: Node;
+ result?: Node;
+ location?: number;
+}
+export interface CaseTestExpr {
+ xpr?: Node;
+ typeId?: number;
+ typeMod?: number;
+ collation?: number;
+}
+export interface ArrayExpr {
+ xpr?: Node;
+ array_typeid?: number;
+ array_collid?: number;
+ element_typeid?: number;
+ elements?: Node[];
+ multidims?: boolean;
+ location?: number;
+}
+export interface RowExpr {
+ xpr?: Node;
+ args?: Node[];
+ row_typeid?: number;
+ row_format?: CoercionForm;
+ colnames?: Node[];
+ location?: number;
+}
+export interface RowCompareExpr {
+ xpr?: Node;
+ rctype?: RowCompareType;
+ opnos?: Node[];
+ opfamilies?: Node[];
+ inputcollids?: Node[];
+ largs?: Node[];
+ rargs?: Node[];
+}
+export interface CoalesceExpr {
+ xpr?: Node;
+ coalescetype?: number;
+ coalescecollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface MinMaxExpr {
+ xpr?: Node;
+ minmaxtype?: number;
+ minmaxcollid?: number;
+ inputcollid?: number;
+ op?: MinMaxOp;
+ args?: Node[];
+ location?: number;
+}
+export interface SQLValueFunction {
+ xpr?: Node;
+ op?: SQLValueFunctionOp;
+ type?: number;
+ typmod?: number;
+ location?: number;
+}
+export interface XmlExpr {
+ xpr?: Node;
+ op?: XmlExprOp;
+ name?: string;
+ named_args?: Node[];
+ arg_names?: Node[];
+ args?: Node[];
+ xmloption?: XmlOptionType;
+ type?: number;
+ typmod?: number;
+ location?: number;
+}
+export interface NullTest {
+ xpr?: Node;
+ arg?: Node;
+ nulltesttype?: NullTestType;
+ argisrow?: boolean;
+ location?: number;
+}
+export interface BooleanTest {
+ xpr?: Node;
+ arg?: Node;
+ booltesttype?: BoolTestType;
+ location?: number;
+}
+export interface CoerceToDomain {
+ xpr?: Node;
+ arg?: Node;
+ resulttype?: number;
+ resulttypmod?: number;
+ resultcollid?: number;
+ coercionformat?: CoercionForm;
+ location?: number;
+}
+export interface CoerceToDomainValue {
+ xpr?: Node;
+ typeId?: number;
+ typeMod?: number;
+ collation?: number;
+ location?: number;
+}
+export interface SetToDefault {
+ xpr?: Node;
+ typeId?: number;
+ typeMod?: number;
+ collation?: number;
+ location?: number;
+}
+export interface CurrentOfExpr {
+ xpr?: Node;
+ cvarno?: number;
+ cursor_name?: string;
+ cursor_param?: number;
+}
+export interface NextValueExpr {
+ xpr?: Node;
+ seqid?: number;
+ typeId?: number;
+}
+export interface InferenceElem {
+ xpr?: Node;
+ expr?: Node;
+ infercollid?: number;
+ inferopclass?: number;
+}
+export interface TargetEntry {
+ xpr?: Node;
+ expr?: Node;
+ resno?: number;
+ resname?: string;
+ ressortgroupref?: number;
+ resorigtbl?: number;
+ resorigcol?: number;
+ resjunk?: boolean;
+}
+export interface RangeTblRef {
+ rtindex?: number;
+}
+export interface JoinExpr {
+ jointype?: JoinType;
+ isNatural?: boolean;
+ larg?: Node;
+ rarg?: Node;
+ usingClause?: Node[];
+ join_using_alias?: Alias;
+ quals?: Node;
+ alias?: Alias;
+ rtindex?: number;
+}
+export interface FromExpr {
+ fromlist?: Node[];
+ quals?: Node;
+}
+export interface OnConflictExpr {
+ action?: OnConflictAction;
+ arbiterElems?: Node[];
+ arbiterWhere?: Node;
+ constraint?: number;
+ onConflictSet?: Node[];
+ onConflictWhere?: Node;
+ exclRelIndex?: number;
+ exclRelTlist?: Node[];
+}
+export interface IntoClause {
+ rel?: RangeVar;
+ colNames?: Node[];
+ accessMethod?: string;
+ options?: Node[];
+ onCommit?: OnCommitAction;
+ tableSpaceName?: string;
+ viewQuery?: Node;
+ skipData?: boolean;
+}
+export interface MergeAction {
+ matched?: boolean;
+ commandType?: CmdType;
+ override?: OverridingKind;
+ qual?: Node;
+ targetList?: Node[];
+ updateColnos?: Node[];
+}
+export interface RawStmt {
+ stmt?: Node;
+ stmt_location?: number;
+ stmt_len?: number;
+}
+export interface Query {
+ commandType?: CmdType;
+ querySource?: QuerySource;
+ canSetTag?: boolean;
+ utilityStmt?: Node;
+ resultRelation?: number;
+ hasAggs?: boolean;
+ hasWindowFuncs?: boolean;
+ hasTargetSRFs?: boolean;
+ hasSubLinks?: boolean;
+ hasDistinctOn?: boolean;
+ hasRecursive?: boolean;
+ hasModifyingCTE?: boolean;
+ hasForUpdate?: boolean;
+ hasRowSecurity?: boolean;
+ isReturn?: boolean;
+ cteList?: Node[];
+ rtable?: Node[];
+ jointree?: FromExpr;
+ mergeActionList?: Node[];
+ mergeUseOuterJoin?: boolean;
+ targetList?: Node[];
+ override?: OverridingKind;
+ onConflict?: OnConflictExpr;
+ returningList?: Node[];
+ groupClause?: Node[];
+ groupDistinct?: boolean;
+ groupingSets?: Node[];
+ havingQual?: Node;
+ windowClause?: Node[];
+ distinctClause?: Node[];
+ sortClause?: Node[];
+ limitOffset?: Node;
+ limitCount?: Node;
+ limitOption?: LimitOption;
+ rowMarks?: Node[];
+ setOperations?: Node;
+ constraintDeps?: Node[];
+ withCheckOptions?: Node[];
+ stmt_location?: number;
+ stmt_len?: number;
+}
+export interface InsertStmt {
+ relation?: RangeVar;
+ cols?: Node[];
+ selectStmt?: Node;
+ onConflictClause?: OnConflictClause;
+ returningList?: Node[];
+ withClause?: WithClause;
+ override?: OverridingKind;
+}
+export interface DeleteStmt {
+ relation?: RangeVar;
+ usingClause?: Node[];
+ whereClause?: Node;
+ returningList?: Node[];
+ withClause?: WithClause;
+}
+export interface UpdateStmt {
+ relation?: RangeVar;
+ targetList?: Node[];
+ whereClause?: Node;
+ fromClause?: Node[];
+ returningList?: Node[];
+ withClause?: WithClause;
+}
+export interface MergeStmt {
+ relation?: RangeVar;
+ sourceRelation?: Node;
+ joinCondition?: Node;
+ mergeWhenClauses?: Node[];
+ withClause?: WithClause;
+}
+export interface SelectStmt {
+ distinctClause?: Node[];
+ intoClause?: IntoClause;
+ targetList?: Node[];
+ fromClause?: Node[];
+ whereClause?: Node;
+ groupClause?: Node[];
+ groupDistinct?: boolean;
+ havingClause?: Node;
+ windowClause?: Node[];
+ valuesLists?: Node[];
+ sortClause?: Node[];
+ limitOffset?: Node;
+ limitCount?: Node;
+ limitOption?: LimitOption;
+ lockingClause?: Node[];
+ withClause?: WithClause;
+ op?: SetOperation;
+ all?: boolean;
+ larg?: SelectStmt;
+ rarg?: SelectStmt;
+}
+export interface ReturnStmt {
+ returnval?: Node;
+}
+export interface PLAssignStmt {
+ name?: string;
+ indirection?: Node[];
+ nnames?: number;
+ val?: SelectStmt;
+ location?: number;
+}
+export interface AlterTableStmt {
+ relation?: RangeVar;
+ cmds?: Node[];
+ objtype?: ObjectType;
+ missing_ok?: boolean;
+}
+export interface AlterTableCmd {
+ subtype?: AlterTableType;
+ name?: string;
+ num?: number;
+ newowner?: RoleSpec;
+ def?: Node;
+ behavior?: DropBehavior;
+ missing_ok?: boolean;
+ recurse?: boolean;
+}
+export interface AlterDomainStmt {
+ subtype?: string;
+ typeName?: Node[];
+ name?: string;
+ def?: Node;
+ behavior?: DropBehavior;
+ missing_ok?: boolean;
+}
+export interface SetOperationStmt {
+ op?: SetOperation;
+ all?: boolean;
+ larg?: Node;
+ rarg?: Node;
+ colTypes?: Node[];
+ colTypmods?: Node[];
+ colCollations?: Node[];
+ groupClauses?: Node[];
+}
+export interface GrantStmt {
+ is_grant?: boolean;
+ targtype?: GrantTargetType;
+ objtype?: ObjectType;
+ objects?: Node[];
+ privileges?: Node[];
+ grantees?: Node[];
+ grant_option?: boolean;
+ grantor?: RoleSpec;
+ behavior?: DropBehavior;
+}
+export interface GrantRoleStmt {
+ granted_roles?: Node[];
+ grantee_roles?: Node[];
+ is_grant?: boolean;
+ admin_opt?: boolean;
+ grantor?: RoleSpec;
+ behavior?: DropBehavior;
+}
+export interface AlterDefaultPrivilegesStmt {
+ options?: Node[];
+ action?: GrantStmt;
+}
+export interface ClosePortalStmt {
+ portalname?: string;
+}
+export interface ClusterStmt {
+ relation?: RangeVar;
+ indexname?: string;
+ params?: Node[];
+}
+export interface CopyStmt {
+ relation?: RangeVar;
+ query?: Node;
+ attlist?: Node[];
+ is_from?: boolean;
+ is_program?: boolean;
+ filename?: string;
+ options?: Node[];
+ whereClause?: Node;
+}
+export interface CreateStmt {
+ relation?: RangeVar;
+ tableElts?: Node[];
+ inhRelations?: Node[];
+ partbound?: PartitionBoundSpec;
+ partspec?: PartitionSpec;
+ ofTypename?: TypeName;
+ constraints?: Node[];
+ options?: Node[];
+ oncommit?: OnCommitAction;
+ tablespacename?: string;
+ accessMethod?: string;
+ if_not_exists?: boolean;
+}
+export interface DefineStmt {
+ kind?: ObjectType;
+ oldstyle?: boolean;
+ defnames?: Node[];
+ args?: Node[];
+ definition?: Node[];
+ if_not_exists?: boolean;
+ replace?: boolean;
+}
+export interface DropStmt {
+ objects?: Node[];
+ removeType?: ObjectType;
+ behavior?: DropBehavior;
+ missing_ok?: boolean;
+ concurrent?: boolean;
+}
+export interface TruncateStmt {
+ relations?: Node[];
+ restart_seqs?: boolean;
+ behavior?: DropBehavior;
+}
+export interface CommentStmt {
+ objtype?: ObjectType;
+ object?: Node;
+ comment?: string;
+}
+export interface FetchStmt {
+ direction?: FetchDirection;
+ howMany?: bigint;
+ portalname?: string;
+ ismove?: boolean;
+}
+export interface IndexStmt {
+ idxname?: string;
+ relation?: RangeVar;
+ accessMethod?: string;
+ tableSpace?: string;
+ indexParams?: Node[];
+ indexIncludingParams?: Node[];
+ options?: Node[];
+ whereClause?: Node;
+ excludeOpNames?: Node[];
+ idxcomment?: string;
+ indexOid?: number;
+ oldNode?: number;
+ oldCreateSubid?: number;
+ oldFirstRelfilenodeSubid?: number;
+ unique?: boolean;
+ nulls_not_distinct?: boolean;
+ primary?: boolean;
+ isconstraint?: boolean;
+ deferrable?: boolean;
+ initdeferred?: boolean;
+ transformed?: boolean;
+ concurrent?: boolean;
+ if_not_exists?: boolean;
+ reset_default_tblspc?: boolean;
+}
+export interface CreateFunctionStmt {
+ is_procedure?: boolean;
+ replace?: boolean;
+ funcname?: Node[];
+ parameters?: Node[];
+ returnType?: TypeName;
+ options?: Node[];
+ sql_body?: Node;
+}
+export interface AlterFunctionStmt {
+ objtype?: ObjectType;
+ func?: ObjectWithArgs;
+ actions?: Node[];
+}
+export interface DoStmt {
+ args?: Node[];
+}
+export interface RenameStmt {
+ renameType?: ObjectType;
+ relationType?: ObjectType;
+ relation?: RangeVar;
+ object?: Node;
+ subname?: string;
+ newname?: string;
+ behavior?: DropBehavior;
+ missing_ok?: boolean;
+}
+export interface RuleStmt {
+ relation?: RangeVar;
+ rulename?: string;
+ whereClause?: Node;
+ event?: CmdType;
+ instead?: boolean;
+ actions?: Node[];
+ replace?: boolean;
+}
+export interface NotifyStmt {
+ conditionname?: string;
+ payload?: string;
+}
+export interface ListenStmt {
+ conditionname?: string;
+}
+export interface UnlistenStmt {
+ conditionname?: string;
+}
+export interface TransactionStmt {
+ kind?: TransactionStmtKind;
+ options?: Node[];
+ savepoint_name?: string;
+ gid?: string;
+ chain?: boolean;
+}
+export interface ViewStmt {
+ view?: RangeVar;
+ aliases?: Node[];
+ query?: Node;
+ replace?: boolean;
+ options?: Node[];
+ withCheckOption?: ViewCheckOption;
+}
+export interface LoadStmt {
+ filename?: string;
+}
+export interface CreateDomainStmt {
+ domainname?: Node[];
+ typeName?: TypeName;
+ collClause?: CollateClause;
+ constraints?: Node[];
+}
+export interface CreatedbStmt {
+ dbname?: string;
+ options?: Node[];
+}
+export interface DropdbStmt {
+ dbname?: string;
+ missing_ok?: boolean;
+ options?: Node[];
+}
+export interface VacuumStmt {
+ options?: Node[];
+ rels?: Node[];
+ is_vacuumcmd?: boolean;
+}
+export interface ExplainStmt {
+ query?: Node;
+ options?: Node[];
+}
+export interface CreateTableAsStmt {
+ query?: Node;
+ into?: IntoClause;
+ objtype?: ObjectType;
+ is_select_into?: boolean;
+ if_not_exists?: boolean;
+}
+export interface CreateSeqStmt {
+ sequence?: RangeVar;
+ options?: Node[];
+ ownerId?: number;
+ for_identity?: boolean;
+ if_not_exists?: boolean;
+}
+export interface AlterSeqStmt {
+ sequence?: RangeVar;
+ options?: Node[];
+ for_identity?: boolean;
+ missing_ok?: boolean;
+}
+export interface VariableSetStmt {
+ kind?: VariableSetKind;
+ name?: string;
+ args?: Node[];
+ is_local?: boolean;
+}
+export interface VariableShowStmt {
+ name?: string;
+}
+export interface DiscardStmt {
+ target?: DiscardMode;
+}
+export interface CreateTrigStmt {
+ replace?: boolean;
+ isconstraint?: boolean;
+ trigname?: string;
+ relation?: RangeVar;
+ funcname?: Node[];
+ args?: Node[];
+ row?: boolean;
+ timing?: number;
+ events?: number;
+ columns?: Node[];
+ whenClause?: Node;
+ transitionRels?: Node[];
+ deferrable?: boolean;
+ initdeferred?: boolean;
+ constrrel?: RangeVar;
+}
+export interface CreatePLangStmt {
+ replace?: boolean;
+ plname?: string;
+ plhandler?: Node[];
+ plinline?: Node[];
+ plvalidator?: Node[];
+ pltrusted?: boolean;
+}
+export interface CreateRoleStmt {
+ stmt_type?: RoleStmtType;
+ role?: string;
+ options?: Node[];
+}
+export interface AlterRoleStmt {
+ role?: RoleSpec;
+ options?: Node[];
+ action?: number;
+}
+export interface DropRoleStmt {
+ roles?: Node[];
+ missing_ok?: boolean;
+}
+export interface LockStmt {
+ relations?: Node[];
+ mode?: number;
+ nowait?: boolean;
+}
+export interface ConstraintsSetStmt {
+ constraints?: Node[];
+ deferred?: boolean;
+}
+export interface ReindexStmt {
+ kind?: ReindexObjectType;
+ relation?: RangeVar;
+ name?: string;
+ params?: Node[];
+}
+export interface CheckPointStmt {}
+export interface CreateSchemaStmt {
+ schemaname?: string;
+ authrole?: RoleSpec;
+ schemaElts?: Node[];
+ if_not_exists?: boolean;
+}
+export interface AlterDatabaseStmt {
+ dbname?: string;
+ options?: Node[];
+}
+export interface AlterDatabaseRefreshCollStmt {
+ dbname?: string;
+}
+export interface AlterDatabaseSetStmt {
+ dbname?: string;
+ setstmt?: VariableSetStmt;
+}
+export interface AlterRoleSetStmt {
+ role?: RoleSpec;
+ database?: string;
+ setstmt?: VariableSetStmt;
+}
+export interface CreateConversionStmt {
+ conversion_name?: Node[];
+ for_encoding_name?: string;
+ to_encoding_name?: string;
+ func_name?: Node[];
+ def?: boolean;
+}
+export interface CreateCastStmt {
+ sourcetype?: TypeName;
+ targettype?: TypeName;
+ func?: ObjectWithArgs;
+ context?: CoercionContext;
+ inout?: boolean;
+}
+export interface CreateOpClassStmt {
+ opclassname?: Node[];
+ opfamilyname?: Node[];
+ amname?: string;
+ datatype?: TypeName;
+ items?: Node[];
+ isDefault?: boolean;
+}
+export interface CreateOpFamilyStmt {
+ opfamilyname?: Node[];
+ amname?: string;
+}
+export interface AlterOpFamilyStmt {
+ opfamilyname?: Node[];
+ amname?: string;
+ isDrop?: boolean;
+ items?: Node[];
+}
+export interface PrepareStmt {
+ name?: string;
+ argtypes?: Node[];
+ query?: Node;
+}
+export interface ExecuteStmt {
+ name?: string;
+ params?: Node[];
+}
+export interface DeallocateStmt {
+ name?: string;
+}
+export interface DeclareCursorStmt {
+ portalname?: string;
+ options?: number;
+ query?: Node;
+}
+export interface CreateTableSpaceStmt {
+ tablespacename?: string;
+ owner?: RoleSpec;
+ location?: string;
+ options?: Node[];
+}
+export interface DropTableSpaceStmt {
+ tablespacename?: string;
+ missing_ok?: boolean;
+}
+export interface AlterObjectDependsStmt {
+ objectType?: ObjectType;
+ relation?: RangeVar;
+ object?: Node;
+ extname?: String;
+ remove?: boolean;
+}
+export interface AlterObjectSchemaStmt {
+ objectType?: ObjectType;
+ relation?: RangeVar;
+ object?: Node;
+ newschema?: string;
+ missing_ok?: boolean;
+}
+export interface AlterOwnerStmt {
+ objectType?: ObjectType;
+ relation?: RangeVar;
+ object?: Node;
+ newowner?: RoleSpec;
+}
+export interface AlterOperatorStmt {
+ opername?: ObjectWithArgs;
+ options?: Node[];
+}
+export interface AlterTypeStmt {
+ typeName?: Node[];
+ options?: Node[];
+}
+export interface DropOwnedStmt {
+ roles?: Node[];
+ behavior?: DropBehavior;
+}
+export interface ReassignOwnedStmt {
+ roles?: Node[];
+ newrole?: RoleSpec;
+}
+export interface CompositeTypeStmt {
+ typevar?: RangeVar;
+ coldeflist?: Node[];
+}
+export interface CreateEnumStmt {
+ typeName?: Node[];
+ vals?: Node[];
+}
+export interface CreateRangeStmt {
+ typeName?: Node[];
+ params?: Node[];
+}
+export interface AlterEnumStmt {
+ typeName?: Node[];
+ oldVal?: string;
+ newVal?: string;
+ newValNeighbor?: string;
+ newValIsAfter?: boolean;
+ skipIfNewValExists?: boolean;
+}
+export interface AlterTSDictionaryStmt {
+ dictname?: Node[];
+ options?: Node[];
+}
+export interface AlterTSConfigurationStmt {
+ kind?: AlterTSConfigType;
+ cfgname?: Node[];
+ tokentype?: Node[];
+ dicts?: Node[];
+ override?: boolean;
+ replace?: boolean;
+ missing_ok?: boolean;
+}
+export interface CreateFdwStmt {
+ fdwname?: string;
+ func_options?: Node[];
+ options?: Node[];
+}
+export interface AlterFdwStmt {
+ fdwname?: string;
+ func_options?: Node[];
+ options?: Node[];
+}
+export interface CreateForeignServerStmt {
+ servername?: string;
+ servertype?: string;
+ version?: string;
+ fdwname?: string;
+ if_not_exists?: boolean;
+ options?: Node[];
+}
+export interface AlterForeignServerStmt {
+ servername?: string;
+ version?: string;
+ options?: Node[];
+ has_version?: boolean;
+}
+export interface CreateUserMappingStmt {
+ user?: RoleSpec;
+ servername?: string;
+ if_not_exists?: boolean;
+ options?: Node[];
+}
+export interface AlterUserMappingStmt {
+ user?: RoleSpec;
+ servername?: string;
+ options?: Node[];
+}
+export interface DropUserMappingStmt {
+ user?: RoleSpec;
+ servername?: string;
+ missing_ok?: boolean;
+}
+export interface AlterTableSpaceOptionsStmt {
+ tablespacename?: string;
+ options?: Node[];
+ isReset?: boolean;
+}
+export interface AlterTableMoveAllStmt {
+ orig_tablespacename?: string;
+ objtype?: ObjectType;
+ roles?: Node[];
+ new_tablespacename?: string;
+ nowait?: boolean;
+}
+export interface SecLabelStmt {
+ objtype?: ObjectType;
+ object?: Node;
+ provider?: string;
+ label?: string;
+}
+export interface CreateForeignTableStmt {
+ base?: CreateStmt;
+ servername?: string;
+ options?: Node[];
+}
+export interface ImportForeignSchemaStmt {
+ server_name?: string;
+ remote_schema?: string;
+ local_schema?: string;
+ list_type?: ImportForeignSchemaType;
+ table_list?: Node[];
+ options?: Node[];
+}
+export interface CreateExtensionStmt {
+ extname?: string;
+ if_not_exists?: boolean;
+ options?: Node[];
+}
+export interface AlterExtensionStmt {
+ extname?: string;
+ options?: Node[];
+}
+export interface AlterExtensionContentsStmt {
+ extname?: string;
+ action?: number;
+ objtype?: ObjectType;
+ object?: Node;
+}
+export interface CreateEventTrigStmt {
+ trigname?: string;
+ eventname?: string;
+ whenclause?: Node[];
+ funcname?: Node[];
+}
+export interface AlterEventTrigStmt {
+ trigname?: string;
+ tgenabled?: string;
+}
+export interface RefreshMatViewStmt {
+ concurrent?: boolean;
+ skipData?: boolean;
+ relation?: RangeVar;
+}
+export interface ReplicaIdentityStmt {
+ identity_type?: string;
+ name?: string;
+}
+export interface AlterSystemStmt {
+ setstmt?: VariableSetStmt;
+}
+export interface CreatePolicyStmt {
+ policy_name?: string;
+ table?: RangeVar;
+ cmd_name?: string;
+ permissive?: boolean;
+ roles?: Node[];
+ qual?: Node;
+ with_check?: Node;
+}
+export interface AlterPolicyStmt {
+ policy_name?: string;
+ table?: RangeVar;
+ roles?: Node[];
+ qual?: Node;
+ with_check?: Node;
+}
+export interface CreateTransformStmt {
+ replace?: boolean;
+ type_name?: TypeName;
+ lang?: string;
+ fromsql?: ObjectWithArgs;
+ tosql?: ObjectWithArgs;
+}
+export interface CreateAmStmt {
+ amname?: string;
+ handler_name?: Node[];
+ amtype?: string;
+}
+export interface CreatePublicationStmt {
+ pubname?: string;
+ options?: Node[];
+ pubobjects?: Node[];
+ for_all_tables?: boolean;
+}
+export interface AlterPublicationStmt {
+ pubname?: string;
+ options?: Node[];
+ pubobjects?: Node[];
+ for_all_tables?: boolean;
+ action?: AlterPublicationAction;
+}
+export interface CreateSubscriptionStmt {
+ subname?: string;
+ conninfo?: string;
+ publication?: Node[];
+ options?: Node[];
+}
+export interface AlterSubscriptionStmt {
+ kind?: AlterSubscriptionType;
+ subname?: string;
+ conninfo?: string;
+ publication?: Node[];
+ options?: Node[];
+}
+export interface DropSubscriptionStmt {
+ subname?: string;
+ missing_ok?: boolean;
+ behavior?: DropBehavior;
+}
+export interface CreateStatsStmt {
+ defnames?: Node[];
+ stat_types?: Node[];
+ exprs?: Node[];
+ relations?: Node[];
+ stxcomment?: string;
+ transformed?: boolean;
+ if_not_exists?: boolean;
+}
+export interface AlterCollationStmt {
+ collname?: Node[];
+}
+export interface CallStmt {
+ funccall?: FuncCall;
+ funcexpr?: FuncExpr;
+ outargs?: Node[];
+}
+export interface AlterStatsStmt {
+ defnames?: Node[];
+ stxstattarget?: number;
+ missing_ok?: boolean;
+}
+export interface A_Expr {
+ kind?: A_Expr_Kind;
+ name?: Node[];
+ lexpr?: Node;
+ rexpr?: Node;
+ location?: number;
+}
+export interface ColumnRef {
+ fields?: Node[];
+ location?: number;
+}
+export interface ParamRef {
+ number?: number;
+ location?: number;
+}
+export interface FuncCall {
+ funcname?: Node[];
+ args?: Node[];
+ agg_order?: Node[];
+ agg_filter?: Node;
+ over?: WindowDef;
+ agg_within_group?: boolean;
+ agg_star?: boolean;
+ agg_distinct?: boolean;
+ func_variadic?: boolean;
+ funcformat?: CoercionForm;
+ location?: number;
+}
+export interface A_Star {}
+export interface A_Indices {
+ is_slice?: boolean;
+ lidx?: Node;
+ uidx?: Node;
+}
+export interface A_Indirection {
+ arg?: Node;
+ indirection?: Node[];
+}
+export interface A_ArrayExpr {
+ elements?: Node[];
+ location?: number;
+}
+export interface ResTarget {
+ name?: string;
+ indirection?: Node[];
+ val?: Node;
+ location?: number;
+}
+export interface MultiAssignRef {
+ source?: Node;
+ colno?: number;
+ ncolumns?: number;
+}
+export interface TypeCast {
+ arg?: Node;
+ typeName?: TypeName;
+ location?: number;
+}
+export interface CollateClause {
+ arg?: Node;
+ collname?: Node[];
+ location?: number;
+}
+export interface SortBy {
+ node?: Node;
+ sortby_dir?: SortByDir;
+ sortby_nulls?: SortByNulls;
+ useOp?: Node[];
+ location?: number;
+}
+export interface WindowDef {
+ name?: string;
+ refname?: string;
+ partitionClause?: Node[];
+ orderClause?: Node[];
+ frameOptions?: number;
+ startOffset?: Node;
+ endOffset?: Node;
+ location?: number;
+}
+export interface RangeSubselect {
+ lateral?: boolean;
+ subquery?: Node;
+ alias?: Alias;
+}
+export interface RangeFunction {
+ lateral?: boolean;
+ ordinality?: boolean;
+ is_rowsfrom?: boolean;
+ functions?: Node[];
+ alias?: Alias;
+ coldeflist?: Node[];
+}
+export interface RangeTableSample {
+ relation?: Node;
+ method?: Node[];
+ args?: Node[];
+ repeatable?: Node;
+ location?: number;
+}
+export interface RangeTableFunc {
+ lateral?: boolean;
+ docexpr?: Node;
+ rowexpr?: Node;
+ namespaces?: Node[];
+ columns?: Node[];
+ alias?: Alias;
+ location?: number;
+}
+export interface RangeTableFuncCol {
+ colname?: string;
+ typeName?: TypeName;
+ for_ordinality?: boolean;
+ is_not_null?: boolean;
+ colexpr?: Node;
+ coldefexpr?: Node;
+ location?: number;
+}
+export interface TypeName {
+ names?: Node[];
+ typeOid?: number;
+ setof?: boolean;
+ pct_type?: boolean;
+ typmods?: Node[];
+ typemod?: number;
+ arrayBounds?: Node[];
+ location?: number;
+}
+export interface ColumnDef {
+ colname?: string;
+ typeName?: TypeName;
+ compression?: string;
+ inhcount?: number;
+ is_local?: boolean;
+ is_not_null?: boolean;
+ is_from_type?: boolean;
+ storage?: string;
+ raw_default?: Node;
+ cooked_default?: Node;
+ identity?: string;
+ identitySequence?: RangeVar;
+ generated?: string;
+ collClause?: CollateClause;
+ collOid?: number;
+ constraints?: Node[];
+ fdwoptions?: Node[];
+ location?: number;
+}
+export interface IndexElem {
+ name?: string;
+ expr?: Node;
+ indexcolname?: string;
+ collation?: Node[];
+ opclass?: Node[];
+ opclassopts?: Node[];
+ ordering?: SortByDir;
+ nulls_ordering?: SortByNulls;
+}
+export interface StatsElem {
+ name?: string;
+ expr?: Node;
+}
+export interface Constraint {
+ contype?: ConstrType;
+ conname?: string;
+ deferrable?: boolean;
+ initdeferred?: boolean;
+ location?: number;
+ is_no_inherit?: boolean;
+ raw_expr?: Node;
+ cooked_expr?: string;
+ generated_when?: string;
+ nulls_not_distinct?: boolean;
+ keys?: Node[];
+ including?: Node[];
+ exclusions?: Node[];
+ options?: Node[];
+ indexname?: string;
+ indexspace?: string;
+ reset_default_tblspc?: boolean;
+ access_method?: string;
+ where_clause?: Node;
+ pktable?: RangeVar;
+ fk_attrs?: Node[];
+ pk_attrs?: Node[];
+ fk_matchtype?: string;
+ fk_upd_action?: string;
+ fk_del_action?: string;
+ fk_del_set_cols?: Node[];
+ old_conpfeqop?: Node[];
+ old_pktable_oid?: number;
+ skip_validation?: boolean;
+ initially_valid?: boolean;
+}
+export interface DefElem {
+ defnamespace?: string;
+ defname?: string;
+ arg?: Node;
+ defaction?: DefElemAction;
+ location?: number;
+}
+export interface RangeTblEntry {
+ rtekind?: RTEKind;
+ relid?: number;
+ relkind?: string;
+ rellockmode?: number;
+ tablesample?: TableSampleClause;
+ subquery?: Query;
+ security_barrier?: boolean;
+ jointype?: JoinType;
+ joinmergedcols?: number;
+ joinaliasvars?: Node[];
+ joinleftcols?: Node[];
+ joinrightcols?: Node[];
+ join_using_alias?: Alias;
+ functions?: Node[];
+ funcordinality?: boolean;
+ tablefunc?: TableFunc;
+ values_lists?: Node[];
+ ctename?: string;
+ ctelevelsup?: number;
+ self_reference?: boolean;
+ coltypes?: Node[];
+ coltypmods?: Node[];
+ colcollations?: Node[];
+ enrname?: string;
+ enrtuples?: number;
+ alias?: Alias;
+ eref?: Alias;
+ lateral?: boolean;
+ inh?: boolean;
+ inFromCl?: boolean;
+ requiredPerms?: number;
+ checkAsUser?: number;
+ selectedCols?: bigint[];
+ insertedCols?: bigint[];
+ updatedCols?: bigint[];
+ extraUpdatedCols?: bigint[];
+ securityQuals?: Node[];
+}
+export interface RangeTblFunction {
+ funcexpr?: Node;
+ funccolcount?: number;
+ funccolnames?: Node[];
+ funccoltypes?: Node[];
+ funccoltypmods?: Node[];
+ funccolcollations?: Node[];
+ funcparams?: bigint[];
+}
+export interface TableSampleClause {
+ tsmhandler?: number;
+ args?: Node[];
+ repeatable?: Node;
+}
+export interface WithCheckOption {
+ kind?: WCOKind;
+ relname?: string;
+ polname?: string;
+ qual?: Node;
+ cascaded?: boolean;
+}
+export interface SortGroupClause {
+ tleSortGroupRef?: number;
+ eqop?: number;
+ sortop?: number;
+ nulls_first?: boolean;
+ hashable?: boolean;
+}
+export interface GroupingSet {
+ kind?: GroupingSetKind;
+ content?: Node[];
+ location?: number;
+}
+export interface WindowClause {
+ name?: string;
+ refname?: string;
+ partitionClause?: Node[];
+ orderClause?: Node[];
+ frameOptions?: number;
+ startOffset?: Node;
+ endOffset?: Node;
+ runCondition?: Node[];
+ startInRangeFunc?: number;
+ endInRangeFunc?: number;
+ inRangeColl?: number;
+ inRangeAsc?: boolean;
+ inRangeNullsFirst?: boolean;
+ winref?: number;
+ copiedOrder?: boolean;
+}
+export interface ObjectWithArgs {
+ objname?: Node[];
+ objargs?: Node[];
+ objfuncargs?: Node[];
+ args_unspecified?: boolean;
+}
+export interface AccessPriv {
+ priv_name?: string;
+ cols?: Node[];
+}
+export interface CreateOpClassItem {
+ itemtype?: number;
+ name?: ObjectWithArgs;
+ number?: number;
+ order_family?: Node[];
+ class_args?: Node[];
+ storedtype?: TypeName;
+}
+export interface TableLikeClause {
+ relation?: RangeVar;
+ options?: number;
+ relationOid?: number;
+}
+export interface FunctionParameter {
+ name?: string;
+ argType?: TypeName;
+ mode?: FunctionParameterMode;
+ defexpr?: Node;
+}
+export interface LockingClause {
+ lockedRels?: Node[];
+ strength?: LockClauseStrength;
+ waitPolicy?: LockWaitPolicy;
+}
+export interface RowMarkClause {
+ rti?: number;
+ strength?: LockClauseStrength;
+ waitPolicy?: LockWaitPolicy;
+ pushedDown?: boolean;
+}
+export interface XmlSerialize {
+ xmloption?: XmlOptionType;
+ expr?: Node;
+ typeName?: TypeName;
+ location?: number;
+}
+export interface WithClause {
+ ctes?: Node[];
+ recursive?: boolean;
+ location?: number;
+}
+export interface InferClause {
+ indexElems?: Node[];
+ whereClause?: Node;
+ conname?: string;
+ location?: number;
+}
+export interface OnConflictClause {
+ action?: OnConflictAction;
+ infer?: InferClause;
+ targetList?: Node[];
+ whereClause?: Node;
+ location?: number;
+}
+export interface CTESearchClause {
+ search_col_list?: Node[];
+ search_breadth_first?: boolean;
+ search_seq_column?: string;
+ location?: number;
+}
+export interface CTECycleClause {
+ cycle_col_list?: Node[];
+ cycle_mark_column?: string;
+ cycle_mark_value?: Node;
+ cycle_mark_default?: Node;
+ cycle_path_column?: string;
+ location?: number;
+ cycle_mark_type?: number;
+ cycle_mark_typmod?: number;
+ cycle_mark_collation?: number;
+ cycle_mark_neop?: number;
+}
+export interface CommonTableExpr {
+ ctename?: string;
+ aliascolnames?: Node[];
+ ctematerialized?: CTEMaterialize;
+ ctequery?: Node;
+ search_clause?: CTESearchClause;
+ cycle_clause?: CTECycleClause;
+ location?: number;
+ cterecursive?: boolean;
+ cterefcount?: number;
+ ctecolnames?: Node[];
+ ctecoltypes?: Node[];
+ ctecoltypmods?: Node[];
+ ctecolcollations?: Node[];
+}
+export interface MergeWhenClause {
+ matched?: boolean;
+ commandType?: CmdType;
+ override?: OverridingKind;
+ condition?: Node;
+ targetList?: Node[];
+ values?: Node[];
+}
+export interface RoleSpec {
+ roletype?: RoleSpecType;
+ rolename?: string;
+ location?: number;
+}
+export interface TriggerTransition {
+ name?: string;
+ isNew?: boolean;
+ isTable?: boolean;
+}
+export interface PartitionElem {
+ name?: string;
+ expr?: Node;
+ collation?: Node[];
+ opclass?: Node[];
+ location?: number;
+}
+export interface PartitionSpec {
+ strategy?: string;
+ partParams?: Node[];
+ location?: number;
+}
+export interface PartitionBoundSpec {
+ strategy?: string;
+ is_default?: boolean;
+ modulus?: number;
+ remainder?: number;
+ listdatums?: Node[];
+ lowerdatums?: Node[];
+ upperdatums?: Node[];
+ location?: number;
+}
+export interface PartitionRangeDatum {
+ kind?: PartitionRangeDatumKind;
+ value?: Node;
+ location?: number;
+}
+export interface PartitionCmd {
+ name?: RangeVar;
+ bound?: PartitionBoundSpec;
+ concurrent?: boolean;
+}
+export interface VacuumRelation {
+ relation?: RangeVar;
+ oid?: number;
+ va_cols?: Node[];
+}
+export interface PublicationObjSpec {
+ pubobjtype?: PublicationObjSpecType;
+ name?: string;
+ pubtable?: PublicationTable;
+ location?: number;
+}
+export interface PublicationTable {
+ relation?: RangeVar;
+ whereClause?: Node;
+ columns?: Node[];
+}
+export interface InlineCodeBlock {
+ source_text?: string;
+ langOid?: number;
+ langIsTrusted?: boolean;
+ atomic?: boolean;
+}
+export interface CallContext {
+ atomic?: boolean;
+}
+export interface ScanToken {
+ start?: number;
+ end?: number;
+ token?: Token;
+ keywordKind?: KeywordKind;
+}
\ No newline at end of file
diff --git a/types/15/tsconfig.esm.json b/types/15/tsconfig.esm.json
new file mode 100644
index 00000000..800d7506
--- /dev/null
+++ b/types/15/tsconfig.esm.json
@@ -0,0 +1,9 @@
+{
+ "extends": "./tsconfig.json",
+ "compilerOptions": {
+ "outDir": "dist/esm",
+ "module": "es2022",
+ "rootDir": "src/",
+ "declaration": false
+ }
+}
diff --git a/types/15/tsconfig.json b/types/15/tsconfig.json
new file mode 100644
index 00000000..1a9d5696
--- /dev/null
+++ b/types/15/tsconfig.json
@@ -0,0 +1,9 @@
+{
+ "extends": "../../tsconfig.json",
+ "compilerOptions": {
+ "outDir": "dist",
+ "rootDir": "src/"
+ },
+ "include": ["src/**/*.ts"],
+ "exclude": ["dist", "node_modules", "**/*.spec.*", "**/*.test.*"]
+}
diff --git a/types/16/CHANGELOG.md b/types/16/CHANGELOG.md
new file mode 100644
index 00000000..a96e990c
--- /dev/null
+++ b/types/16/CHANGELOG.md
@@ -0,0 +1,40 @@
+# Change Log
+
+All notable changes to this project will be documented in this file.
+See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [17.4.2](https://github.com/launchql/pgsql-parser/compare/@pgsql/types@17.4.1...@pgsql/types@17.4.2) (2025-06-22)
+
+**Note:** Version bump only for package @pgsql/types
+
+
+
+
+
+## [17.4.1](https://github.com/launchql/pgsql-parser/compare/@pgsql/types@17.4.0...@pgsql/types@17.4.1) (2025-06-21)
+
+**Note:** Version bump only for package @pgsql/types
+
+
+
+
+
+# [17.4.0](https://github.com/launchql/pgsql-parser/compare/@pgsql/types@17.1.0...@pgsql/types@17.4.0) (2025-06-21)
+
+**Note:** Version bump only for package @pgsql/types
+
+
+
+
+
+# [17.2.0](https://github.com/launchql/pgsql-parser/compare/@pgsql/types@17.1.0...@pgsql/types@17.2.0) (2025-06-21)
+
+**Note:** Version bump only for package @pgsql/types
+
+
+
+
+
+# [17.1.0](https://github.com/launchql/pgsql-parser/compare/@pgsql/types@13.9.0...@pgsql/types@17.1.0) (2025-06-21)
+
+**Note:** Version bump only for package @pgsql/types
diff --git a/types/16/README.md b/types/16/README.md
new file mode 100644
index 00000000..81c50431
--- /dev/null
+++ b/types/16/README.md
@@ -0,0 +1,99 @@
+# @pgsql/types
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+`@pgsql/types` is a TypeScript library providing type definitions for PostgreSQL AST nodes, primarily used in conjunction with [`pgsql-parser`](https://github.com/launchql/pgsql-parser). It offers a comprehensive and type-safe way to interact with the AST nodes generated by PostgreSQL query parsing.
+
+
+## Installation
+
+Install the package via npm:
+
+```bash
+npm install @pgsql/types
+```
+
+## Usage
+
+`@pgsql/types` provides TypeScript type definitions for PostgreSQL Abstract Syntax Tree (AST) nodes. These types are useful for constructing, analyzing, or manipulating ASTs in a type-safe manner.
+
+Here are a few examples of how you can use these types in your TypeScript projects:
+
+### Validating AST Nodes
+
+You can use the types to validate AST nodes, ensuring they conform to the expected structure:
+
+```ts
+import { CreateStmt } from '@pgsql/types';
+
+function validateCreateStmt(stmt: CreateStmt) {
+ if (!stmt.relation || !stmt.tableElts) {
+ throw new Error('Invalid CreateStmt: missing required fields');
+ }
+ // Add more validation logic as needed
+ console.log('CreateStmt is valid');
+}
+
+// Example usage
+validateCreateStmt(createStmtObject);
+```
+
+### Constructing AST Nodes
+
+Types help ensure that you construct AST nodes correctly:
+
+```ts
+import { CreateStmt, ColumnDef, Constraint } from '@pgsql/types';
+
+const newColumn: ColumnDef = {
+ colname: 'id',
+ typeName: { names: [{ String: { str: 'int4' } }] },
+ constraints: [{ Constraint: { contype: 'CONSTR_PRIMARY' } }],
+};
+
+const createStmt: CreateStmt = {
+ relation: { relname: 'new_table' },
+ tableElts: [newColumn],
+};
+
+console.log(createStmt);
+```
+
+## Versions
+
+Our latest is built with PostgreSQL 17 AST types.
+
+| PG Major Version | libpg_query | npm dist-tag
+|--------------------------|-------------|---------|
+| 17 | 17-6.1.0 | [`pg17`](https://www.npmjs.com/package/@pgsql/types/v/latest)
+| 16 | 16-5.2.0 | [`pg16`](https://www.npmjs.com/package/@pgsql/types/v/pg16)
+| 15 | 15-4.2.4 | [`pg15`](https://www.npmjs.com/package/@pgsql/types/v/pg15)
+| 14 | 14-3.0.0 | [`pg14`](https://www.npmjs.com/package/@pgsql/types/v/pg14)
+| 13 | 13-2.2.0 | [`pg13`](https://www.npmjs.com/package/@pgsql/types/v/pg13)
+
+## Related
+
+* [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.
+* [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`.
+* [@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.
+* [@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.
+* [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.
+* [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.
+
+## Disclaimer
+
+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.
\ No newline at end of file
diff --git a/types/16/jest.config.js b/types/16/jest.config.js
new file mode 100644
index 00000000..0aa3aaa4
--- /dev/null
+++ b/types/16/jest.config.js
@@ -0,0 +1,18 @@
+/** @type {import('ts-jest').JestConfigWithTsJest} */
+module.exports = {
+ preset: "ts-jest",
+ testEnvironment: "node",
+ transform: {
+ "^.+\\.tsx?$": [
+ "ts-jest",
+ {
+ babelConfig: false,
+ tsconfig: "tsconfig.json",
+ },
+ ],
+ },
+ transformIgnorePatterns: [`/node_modules/*`],
+ testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
+ moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
+ modulePathIgnorePatterns: ["dist/*"]
+};
diff --git a/types/16/package.json b/types/16/package.json
new file mode 100644
index 00000000..67f088c2
--- /dev/null
+++ b/types/16/package.json
@@ -0,0 +1,39 @@
+{
+ "name": "@libpg-query/types16",
+ "version": "16.0.1",
+ "author": "Dan Lynch ",
+ "description": "PostgreSQL AST types from the real Postgres parser",
+ "main": "index.js",
+ "module": "esm/index.js",
+ "types": "index.d.ts",
+ "homepage": "https://github.com/launchql/libpg-query-node",
+ "license": "SEE LICENSE IN LICENSE",
+ "publishConfig": {
+ "access": "public",
+ "directory": "dist"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/launchql/libpg-query-node"
+ },
+ "bugs": {
+ "url": "https://github.com/launchql/libpg-query-node/issues"
+ },
+ "x-publish": {
+ "publishName": "@pgsql/types",
+ "distTag": "pg16"
+ },
+ "scripts": {
+ "copy": "copyfiles -f ../../LICENSE README.md package.json dist",
+ "clean": "rimraf dist",
+ "build": "pnpm run clean && tsc && tsc -p tsconfig.esm.json && pnpm run copy",
+ "build:dev": "pnpm run clean && tsc --declarationMap && tsc -p tsconfig.esm.json && pnpm run copy",
+ "build:proto": "ts-node scripts/pg-proto-parser",
+ "prepare:types": "node -e \"require('../../scripts/prepare-types.js').preparePackageForPublish('.')\"",
+ "lint": "eslint . --fix"
+ },
+ "keywords": [],
+ "devDependencies": {
+ "pg-proto-parser": "^1.28.2"
+ }
+}
diff --git a/types/16/scripts/pg-proto-parser.ts b/types/16/scripts/pg-proto-parser.ts
new file mode 100644
index 00000000..d536b2ff
--- /dev/null
+++ b/types/16/scripts/pg-proto-parser.ts
@@ -0,0 +1,20 @@
+import { PgProtoParser, PgProtoParserOptions } from 'pg-proto-parser';
+import { resolve, join } from 'path';
+
+const inFile: string = join(__dirname, '../../../protos/16/pg_query.proto');
+const outDir: string = resolve(join(__dirname, '../src'));
+
+const options: PgProtoParserOptions = {
+ outDir,
+ types: {
+ enabled: true,
+ wrappedNodeTypeExport: true
+ },
+ enums: {
+ enabled: true,
+ enumsAsTypeUnion: true
+ }
+};
+const parser = new PgProtoParser(inFile, options);
+
+parser.write();
diff --git a/types/16/src/enums.ts b/types/16/src/enums.ts
new file mode 100644
index 00000000..b755dd46
--- /dev/null
+++ b/types/16/src/enums.ts
@@ -0,0 +1,69 @@
+/**
+* This file was automatically generated by pg-proto-parser@1.28.2.
+* DO NOT MODIFY IT BY HAND. Instead, modify the source proto file,
+* and run the pg-proto-parser generate command to regenerate this file.
+*/
+export type OverridingKind = "OVERRIDING_NOT_SET" | "OVERRIDING_USER_VALUE" | "OVERRIDING_SYSTEM_VALUE";
+export type QuerySource = "QSRC_ORIGINAL" | "QSRC_PARSER" | "QSRC_INSTEAD_RULE" | "QSRC_QUAL_INSTEAD_RULE" | "QSRC_NON_INSTEAD_RULE";
+export type SortByDir = "SORTBY_DEFAULT" | "SORTBY_ASC" | "SORTBY_DESC" | "SORTBY_USING";
+export type SortByNulls = "SORTBY_NULLS_DEFAULT" | "SORTBY_NULLS_FIRST" | "SORTBY_NULLS_LAST";
+export type SetQuantifier = "SET_QUANTIFIER_DEFAULT" | "SET_QUANTIFIER_ALL" | "SET_QUANTIFIER_DISTINCT";
+export type A_Expr_Kind = "AEXPR_OP" | "AEXPR_OP_ANY" | "AEXPR_OP_ALL" | "AEXPR_DISTINCT" | "AEXPR_NOT_DISTINCT" | "AEXPR_NULLIF" | "AEXPR_IN" | "AEXPR_LIKE" | "AEXPR_ILIKE" | "AEXPR_SIMILAR" | "AEXPR_BETWEEN" | "AEXPR_NOT_BETWEEN" | "AEXPR_BETWEEN_SYM" | "AEXPR_NOT_BETWEEN_SYM";
+export type RoleSpecType = "ROLESPEC_CSTRING" | "ROLESPEC_CURRENT_ROLE" | "ROLESPEC_CURRENT_USER" | "ROLESPEC_SESSION_USER" | "ROLESPEC_PUBLIC";
+export type TableLikeOption = "CREATE_TABLE_LIKE_COMMENTS" | "CREATE_TABLE_LIKE_COMPRESSION" | "CREATE_TABLE_LIKE_CONSTRAINTS" | "CREATE_TABLE_LIKE_DEFAULTS" | "CREATE_TABLE_LIKE_GENERATED" | "CREATE_TABLE_LIKE_IDENTITY" | "CREATE_TABLE_LIKE_INDEXES" | "CREATE_TABLE_LIKE_STATISTICS" | "CREATE_TABLE_LIKE_STORAGE" | "CREATE_TABLE_LIKE_ALL";
+export type DefElemAction = "DEFELEM_UNSPEC" | "DEFELEM_SET" | "DEFELEM_ADD" | "DEFELEM_DROP";
+export type PartitionStrategy = "PARTITION_STRATEGY_LIST" | "PARTITION_STRATEGY_RANGE" | "PARTITION_STRATEGY_HASH";
+export type PartitionRangeDatumKind = "PARTITION_RANGE_DATUM_MINVALUE" | "PARTITION_RANGE_DATUM_VALUE" | "PARTITION_RANGE_DATUM_MAXVALUE";
+export type RTEKind = "RTE_RELATION" | "RTE_SUBQUERY" | "RTE_JOIN" | "RTE_FUNCTION" | "RTE_TABLEFUNC" | "RTE_VALUES" | "RTE_CTE" | "RTE_NAMEDTUPLESTORE" | "RTE_RESULT";
+export type WCOKind = "WCO_VIEW_CHECK" | "WCO_RLS_INSERT_CHECK" | "WCO_RLS_UPDATE_CHECK" | "WCO_RLS_CONFLICT_CHECK" | "WCO_RLS_MERGE_UPDATE_CHECK" | "WCO_RLS_MERGE_DELETE_CHECK";
+export type GroupingSetKind = "GROUPING_SET_EMPTY" | "GROUPING_SET_SIMPLE" | "GROUPING_SET_ROLLUP" | "GROUPING_SET_CUBE" | "GROUPING_SET_SETS";
+export type CTEMaterialize = "CTEMaterializeDefault" | "CTEMaterializeAlways" | "CTEMaterializeNever";
+export type SetOperation = "SETOP_NONE" | "SETOP_UNION" | "SETOP_INTERSECT" | "SETOP_EXCEPT";
+export type ObjectType = "OBJECT_ACCESS_METHOD" | "OBJECT_AGGREGATE" | "OBJECT_AMOP" | "OBJECT_AMPROC" | "OBJECT_ATTRIBUTE" | "OBJECT_CAST" | "OBJECT_COLUMN" | "OBJECT_COLLATION" | "OBJECT_CONVERSION" | "OBJECT_DATABASE" | "OBJECT_DEFAULT" | "OBJECT_DEFACL" | "OBJECT_DOMAIN" | "OBJECT_DOMCONSTRAINT" | "OBJECT_EVENT_TRIGGER" | "OBJECT_EXTENSION" | "OBJECT_FDW" | "OBJECT_FOREIGN_SERVER" | "OBJECT_FOREIGN_TABLE" | "OBJECT_FUNCTION" | "OBJECT_INDEX" | "OBJECT_LANGUAGE" | "OBJECT_LARGEOBJECT" | "OBJECT_MATVIEW" | "OBJECT_OPCLASS" | "OBJECT_OPERATOR" | "OBJECT_OPFAMILY" | "OBJECT_PARAMETER_ACL" | "OBJECT_POLICY" | "OBJECT_PROCEDURE" | "OBJECT_PUBLICATION" | "OBJECT_PUBLICATION_NAMESPACE" | "OBJECT_PUBLICATION_REL" | "OBJECT_ROLE" | "OBJECT_ROUTINE" | "OBJECT_RULE" | "OBJECT_SCHEMA" | "OBJECT_SEQUENCE" | "OBJECT_SUBSCRIPTION" | "OBJECT_STATISTIC_EXT" | "OBJECT_TABCONSTRAINT" | "OBJECT_TABLE" | "OBJECT_TABLESPACE" | "OBJECT_TRANSFORM" | "OBJECT_TRIGGER" | "OBJECT_TSCONFIGURATION" | "OBJECT_TSDICTIONARY" | "OBJECT_TSPARSER" | "OBJECT_TSTEMPLATE" | "OBJECT_TYPE" | "OBJECT_USER_MAPPING" | "OBJECT_VIEW";
+export type DropBehavior = "DROP_RESTRICT" | "DROP_CASCADE";
+export type AlterTableType = "AT_AddColumn" | "AT_AddColumnToView" | "AT_ColumnDefault" | "AT_CookedColumnDefault" | "AT_DropNotNull" | "AT_SetNotNull" | "AT_DropExpression" | "AT_CheckNotNull" | "AT_SetStatistics" | "AT_SetOptions" | "AT_ResetOptions" | "AT_SetStorage" | "AT_SetCompression" | "AT_DropColumn" | "AT_AddIndex" | "AT_ReAddIndex" | "AT_AddConstraint" | "AT_ReAddConstraint" | "AT_ReAddDomainConstraint" | "AT_AlterConstraint" | "AT_ValidateConstraint" | "AT_AddIndexConstraint" | "AT_DropConstraint" | "AT_ReAddComment" | "AT_AlterColumnType" | "AT_AlterColumnGenericOptions" | "AT_ChangeOwner" | "AT_ClusterOn" | "AT_DropCluster" | "AT_SetLogged" | "AT_SetUnLogged" | "AT_DropOids" | "AT_SetAccessMethod" | "AT_SetTableSpace" | "AT_SetRelOptions" | "AT_ResetRelOptions" | "AT_ReplaceRelOptions" | "AT_EnableTrig" | "AT_EnableAlwaysTrig" | "AT_EnableReplicaTrig" | "AT_DisableTrig" | "AT_EnableTrigAll" | "AT_DisableTrigAll" | "AT_EnableTrigUser" | "AT_DisableTrigUser" | "AT_EnableRule" | "AT_EnableAlwaysRule" | "AT_EnableReplicaRule" | "AT_DisableRule" | "AT_AddInherit" | "AT_DropInherit" | "AT_AddOf" | "AT_DropOf" | "AT_ReplicaIdentity" | "AT_EnableRowSecurity" | "AT_DisableRowSecurity" | "AT_ForceRowSecurity" | "AT_NoForceRowSecurity" | "AT_GenericOptions" | "AT_AttachPartition" | "AT_DetachPartition" | "AT_DetachPartitionFinalize" | "AT_AddIdentity" | "AT_SetIdentity" | "AT_DropIdentity" | "AT_ReAddStatistics";
+export type GrantTargetType = "ACL_TARGET_OBJECT" | "ACL_TARGET_ALL_IN_SCHEMA" | "ACL_TARGET_DEFAULTS";
+export type VariableSetKind = "VAR_SET_VALUE" | "VAR_SET_DEFAULT" | "VAR_SET_CURRENT" | "VAR_SET_MULTI" | "VAR_RESET" | "VAR_RESET_ALL";
+export type ConstrType = "CONSTR_NULL" | "CONSTR_NOTNULL" | "CONSTR_DEFAULT" | "CONSTR_IDENTITY" | "CONSTR_GENERATED" | "CONSTR_CHECK" | "CONSTR_PRIMARY" | "CONSTR_UNIQUE" | "CONSTR_EXCLUSION" | "CONSTR_FOREIGN" | "CONSTR_ATTR_DEFERRABLE" | "CONSTR_ATTR_NOT_DEFERRABLE" | "CONSTR_ATTR_DEFERRED" | "CONSTR_ATTR_IMMEDIATE";
+export type ImportForeignSchemaType = "FDW_IMPORT_SCHEMA_ALL" | "FDW_IMPORT_SCHEMA_LIMIT_TO" | "FDW_IMPORT_SCHEMA_EXCEPT";
+export type RoleStmtType = "ROLESTMT_ROLE" | "ROLESTMT_USER" | "ROLESTMT_GROUP";
+export type FetchDirection = "FETCH_FORWARD" | "FETCH_BACKWARD" | "FETCH_ABSOLUTE" | "FETCH_RELATIVE";
+export type FunctionParameterMode = "FUNC_PARAM_IN" | "FUNC_PARAM_OUT" | "FUNC_PARAM_INOUT" | "FUNC_PARAM_VARIADIC" | "FUNC_PARAM_TABLE" | "FUNC_PARAM_DEFAULT";
+export type TransactionStmtKind = "TRANS_STMT_BEGIN" | "TRANS_STMT_START" | "TRANS_STMT_COMMIT" | "TRANS_STMT_ROLLBACK" | "TRANS_STMT_SAVEPOINT" | "TRANS_STMT_RELEASE" | "TRANS_STMT_ROLLBACK_TO" | "TRANS_STMT_PREPARE" | "TRANS_STMT_COMMIT_PREPARED" | "TRANS_STMT_ROLLBACK_PREPARED";
+export type ViewCheckOption = "NO_CHECK_OPTION" | "LOCAL_CHECK_OPTION" | "CASCADED_CHECK_OPTION";
+export type DiscardMode = "DISCARD_ALL" | "DISCARD_PLANS" | "DISCARD_SEQUENCES" | "DISCARD_TEMP";
+export type ReindexObjectType = "REINDEX_OBJECT_INDEX" | "REINDEX_OBJECT_TABLE" | "REINDEX_OBJECT_SCHEMA" | "REINDEX_OBJECT_SYSTEM" | "REINDEX_OBJECT_DATABASE";
+export type AlterTSConfigType = "ALTER_TSCONFIG_ADD_MAPPING" | "ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN" | "ALTER_TSCONFIG_REPLACE_DICT" | "ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN" | "ALTER_TSCONFIG_DROP_MAPPING";
+export type PublicationObjSpecType = "PUBLICATIONOBJ_TABLE" | "PUBLICATIONOBJ_TABLES_IN_SCHEMA" | "PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA" | "PUBLICATIONOBJ_CONTINUATION";
+export type AlterPublicationAction = "AP_AddObjects" | "AP_DropObjects" | "AP_SetObjects";
+export type AlterSubscriptionType = "ALTER_SUBSCRIPTION_OPTIONS" | "ALTER_SUBSCRIPTION_CONNECTION" | "ALTER_SUBSCRIPTION_SET_PUBLICATION" | "ALTER_SUBSCRIPTION_ADD_PUBLICATION" | "ALTER_SUBSCRIPTION_DROP_PUBLICATION" | "ALTER_SUBSCRIPTION_REFRESH" | "ALTER_SUBSCRIPTION_ENABLED" | "ALTER_SUBSCRIPTION_SKIP";
+export type OnCommitAction = "ONCOMMIT_NOOP" | "ONCOMMIT_PRESERVE_ROWS" | "ONCOMMIT_DELETE_ROWS" | "ONCOMMIT_DROP";
+export type ParamKind = "PARAM_EXTERN" | "PARAM_EXEC" | "PARAM_SUBLINK" | "PARAM_MULTIEXPR";
+export type CoercionContext = "COERCION_IMPLICIT" | "COERCION_ASSIGNMENT" | "COERCION_PLPGSQL" | "COERCION_EXPLICIT";
+export type CoercionForm = "COERCE_EXPLICIT_CALL" | "COERCE_EXPLICIT_CAST" | "COERCE_IMPLICIT_CAST" | "COERCE_SQL_SYNTAX";
+export type BoolExprType = "AND_EXPR" | "OR_EXPR" | "NOT_EXPR";
+export type SubLinkType = "EXISTS_SUBLINK" | "ALL_SUBLINK" | "ANY_SUBLINK" | "ROWCOMPARE_SUBLINK" | "EXPR_SUBLINK" | "MULTIEXPR_SUBLINK" | "ARRAY_SUBLINK" | "CTE_SUBLINK";
+export type RowCompareType = "ROWCOMPARE_LT" | "ROWCOMPARE_LE" | "ROWCOMPARE_EQ" | "ROWCOMPARE_GE" | "ROWCOMPARE_GT" | "ROWCOMPARE_NE";
+export type MinMaxOp = "IS_GREATEST" | "IS_LEAST";
+export type SQLValueFunctionOp = "SVFOP_CURRENT_DATE" | "SVFOP_CURRENT_TIME" | "SVFOP_CURRENT_TIME_N" | "SVFOP_CURRENT_TIMESTAMP" | "SVFOP_CURRENT_TIMESTAMP_N" | "SVFOP_LOCALTIME" | "SVFOP_LOCALTIME_N" | "SVFOP_LOCALTIMESTAMP" | "SVFOP_LOCALTIMESTAMP_N" | "SVFOP_CURRENT_ROLE" | "SVFOP_CURRENT_USER" | "SVFOP_USER" | "SVFOP_SESSION_USER" | "SVFOP_CURRENT_CATALOG" | "SVFOP_CURRENT_SCHEMA";
+export type XmlExprOp = "IS_XMLCONCAT" | "IS_XMLELEMENT" | "IS_XMLFOREST" | "IS_XMLPARSE" | "IS_XMLPI" | "IS_XMLROOT" | "IS_XMLSERIALIZE" | "IS_DOCUMENT";
+export type XmlOptionType = "XMLOPTION_DOCUMENT" | "XMLOPTION_CONTENT";
+export type JsonEncoding = "JS_ENC_DEFAULT" | "JS_ENC_UTF8" | "JS_ENC_UTF16" | "JS_ENC_UTF32";
+export type JsonFormatType = "JS_FORMAT_DEFAULT" | "JS_FORMAT_JSON" | "JS_FORMAT_JSONB";
+export type JsonConstructorType = "JSCTOR_JSON_OBJECT" | "JSCTOR_JSON_ARRAY" | "JSCTOR_JSON_OBJECTAGG" | "JSCTOR_JSON_ARRAYAGG";
+export type JsonValueType = "JS_TYPE_ANY" | "JS_TYPE_OBJECT" | "JS_TYPE_ARRAY" | "JS_TYPE_SCALAR";
+export type NullTestType = "IS_NULL" | "IS_NOT_NULL";
+export type BoolTestType = "IS_TRUE" | "IS_NOT_TRUE" | "IS_FALSE" | "IS_NOT_FALSE" | "IS_UNKNOWN" | "IS_NOT_UNKNOWN";
+export type CmdType = "CMD_UNKNOWN" | "CMD_SELECT" | "CMD_UPDATE" | "CMD_INSERT" | "CMD_DELETE" | "CMD_MERGE" | "CMD_UTILITY" | "CMD_NOTHING";
+export type JoinType = "JOIN_INNER" | "JOIN_LEFT" | "JOIN_FULL" | "JOIN_RIGHT" | "JOIN_SEMI" | "JOIN_ANTI" | "JOIN_RIGHT_ANTI" | "JOIN_UNIQUE_OUTER" | "JOIN_UNIQUE_INNER";
+export type AggStrategy = "AGG_PLAIN" | "AGG_SORTED" | "AGG_HASHED" | "AGG_MIXED";
+export type AggSplit = "AGGSPLIT_SIMPLE" | "AGGSPLIT_INITIAL_SERIAL" | "AGGSPLIT_FINAL_DESERIAL";
+export type SetOpCmd = "SETOPCMD_INTERSECT" | "SETOPCMD_INTERSECT_ALL" | "SETOPCMD_EXCEPT" | "SETOPCMD_EXCEPT_ALL";
+export type SetOpStrategy = "SETOP_SORTED" | "SETOP_HASHED";
+export type OnConflictAction = "ONCONFLICT_NONE" | "ONCONFLICT_NOTHING" | "ONCONFLICT_UPDATE";
+export type LimitOption = "LIMIT_OPTION_DEFAULT" | "LIMIT_OPTION_COUNT" | "LIMIT_OPTION_WITH_TIES";
+export type LockClauseStrength = "LCS_NONE" | "LCS_FORKEYSHARE" | "LCS_FORSHARE" | "LCS_FORNOKEYUPDATE" | "LCS_FORUPDATE";
+export type LockWaitPolicy = "LockWaitBlock" | "LockWaitSkip" | "LockWaitError";
+export type LockTupleMode = "LockTupleKeyShare" | "LockTupleShare" | "LockTupleNoKeyExclusive" | "LockTupleExclusive";
+export type KeywordKind = "NO_KEYWORD" | "UNRESERVED_KEYWORD" | "COL_NAME_KEYWORD" | "TYPE_FUNC_NAME_KEYWORD" | "RESERVED_KEYWORD";
+export type Token = "NUL" | "ASCII_36" | "ASCII_37" | "ASCII_40" | "ASCII_41" | "ASCII_42" | "ASCII_43" | "ASCII_44" | "ASCII_45" | "ASCII_46" | "ASCII_47" | "ASCII_58" | "ASCII_59" | "ASCII_60" | "ASCII_61" | "ASCII_62" | "ASCII_63" | "ASCII_91" | "ASCII_92" | "ASCII_93" | "ASCII_94" | "IDENT" | "UIDENT" | "FCONST" | "SCONST" | "USCONST" | "BCONST" | "XCONST" | "Op" | "ICONST" | "PARAM" | "TYPECAST" | "DOT_DOT" | "COLON_EQUALS" | "EQUALS_GREATER" | "LESS_EQUALS" | "GREATER_EQUALS" | "NOT_EQUALS" | "SQL_COMMENT" | "C_COMMENT" | "ABORT_P" | "ABSENT" | "ABSOLUTE_P" | "ACCESS" | "ACTION" | "ADD_P" | "ADMIN" | "AFTER" | "AGGREGATE" | "ALL" | "ALSO" | "ALTER" | "ALWAYS" | "ANALYSE" | "ANALYZE" | "AND" | "ANY" | "ARRAY" | "AS" | "ASC" | "ASENSITIVE" | "ASSERTION" | "ASSIGNMENT" | "ASYMMETRIC" | "ATOMIC" | "AT" | "ATTACH" | "ATTRIBUTE" | "AUTHORIZATION" | "BACKWARD" | "BEFORE" | "BEGIN_P" | "BETWEEN" | "BIGINT" | "BINARY" | "BIT" | "BOOLEAN_P" | "BOTH" | "BREADTH" | "BY" | "CACHE" | "CALL" | "CALLED" | "CASCADE" | "CASCADED" | "CASE" | "CAST" | "CATALOG_P" | "CHAIN" | "CHAR_P" | "CHARACTER" | "CHARACTERISTICS" | "CHECK" | "CHECKPOINT" | "CLASS" | "CLOSE" | "CLUSTER" | "COALESCE" | "COLLATE" | "COLLATION" | "COLUMN" | "COLUMNS" | "COMMENT" | "COMMENTS" | "COMMIT" | "COMMITTED" | "COMPRESSION" | "CONCURRENTLY" | "CONFIGURATION" | "CONFLICT" | "CONNECTION" | "CONSTRAINT" | "CONSTRAINTS" | "CONTENT_P" | "CONTINUE_P" | "CONVERSION_P" | "COPY" | "COST" | "CREATE" | "CROSS" | "CSV" | "CUBE" | "CURRENT_P" | "CURRENT_CATALOG" | "CURRENT_DATE" | "CURRENT_ROLE" | "CURRENT_SCHEMA" | "CURRENT_TIME" | "CURRENT_TIMESTAMP" | "CURRENT_USER" | "CURSOR" | "CYCLE" | "DATA_P" | "DATABASE" | "DAY_P" | "DEALLOCATE" | "DEC" | "DECIMAL_P" | "DECLARE" | "DEFAULT" | "DEFAULTS" | "DEFERRABLE" | "DEFERRED" | "DEFINER" | "DELETE_P" | "DELIMITER" | "DELIMITERS" | "DEPENDS" | "DEPTH" | "DESC" | "DETACH" | "DICTIONARY" | "DISABLE_P" | "DISCARD" | "DISTINCT" | "DO" | "DOCUMENT_P" | "DOMAIN_P" | "DOUBLE_P" | "DROP" | "EACH" | "ELSE" | "ENABLE_P" | "ENCODING" | "ENCRYPTED" | "END_P" | "ENUM_P" | "ESCAPE" | "EVENT" | "EXCEPT" | "EXCLUDE" | "EXCLUDING" | "EXCLUSIVE" | "EXECUTE" | "EXISTS" | "EXPLAIN" | "EXPRESSION" | "EXTENSION" | "EXTERNAL" | "EXTRACT" | "FALSE_P" | "FAMILY" | "FETCH" | "FILTER" | "FINALIZE" | "FIRST_P" | "FLOAT_P" | "FOLLOWING" | "FOR" | "FORCE" | "FOREIGN" | "FORMAT" | "FORWARD" | "FREEZE" | "FROM" | "FULL" | "FUNCTION" | "FUNCTIONS" | "GENERATED" | "GLOBAL" | "GRANT" | "GRANTED" | "GREATEST" | "GROUP_P" | "GROUPING" | "GROUPS" | "HANDLER" | "HAVING" | "HEADER_P" | "HOLD" | "HOUR_P" | "IDENTITY_P" | "IF_P" | "ILIKE" | "IMMEDIATE" | "IMMUTABLE" | "IMPLICIT_P" | "IMPORT_P" | "IN_P" | "INCLUDE" | "INCLUDING" | "INCREMENT" | "INDENT" | "INDEX" | "INDEXES" | "INHERIT" | "INHERITS" | "INITIALLY" | "INLINE_P" | "INNER_P" | "INOUT" | "INPUT_P" | "INSENSITIVE" | "INSERT" | "INSTEAD" | "INT_P" | "INTEGER" | "INTERSECT" | "INTERVAL" | "INTO" | "INVOKER" | "IS" | "ISNULL" | "ISOLATION" | "JOIN" | "JSON" | "JSON_ARRAY" | "JSON_ARRAYAGG" | "JSON_OBJECT" | "JSON_OBJECTAGG" | "KEY" | "KEYS" | "LABEL" | "LANGUAGE" | "LARGE_P" | "LAST_P" | "LATERAL_P" | "LEADING" | "LEAKPROOF" | "LEAST" | "LEFT" | "LEVEL" | "LIKE" | "LIMIT" | "LISTEN" | "LOAD" | "LOCAL" | "LOCALTIME" | "LOCALTIMESTAMP" | "LOCATION" | "LOCK_P" | "LOCKED" | "LOGGED" | "MAPPING" | "MATCH" | "MATCHED" | "MATERIALIZED" | "MAXVALUE" | "MERGE" | "METHOD" | "MINUTE_P" | "MINVALUE" | "MODE" | "MONTH_P" | "MOVE" | "NAME_P" | "NAMES" | "NATIONAL" | "NATURAL" | "NCHAR" | "NEW" | "NEXT" | "NFC" | "NFD" | "NFKC" | "NFKD" | "NO" | "NONE" | "NORMALIZE" | "NORMALIZED" | "NOT" | "NOTHING" | "NOTIFY" | "NOTNULL" | "NOWAIT" | "NULL_P" | "NULLIF" | "NULLS_P" | "NUMERIC" | "OBJECT_P" | "OF" | "OFF" | "OFFSET" | "OIDS" | "OLD" | "ON" | "ONLY" | "OPERATOR" | "OPTION" | "OPTIONS" | "OR" | "ORDER" | "ORDINALITY" | "OTHERS" | "OUT_P" | "OUTER_P" | "OVER" | "OVERLAPS" | "OVERLAY" | "OVERRIDING" | "OWNED" | "OWNER" | "PARALLEL" | "PARAMETER" | "PARSER" | "PARTIAL" | "PARTITION" | "PASSING" | "PASSWORD" | "PLACING" | "PLANS" | "POLICY" | "POSITION" | "PRECEDING" | "PRECISION" | "PRESERVE" | "PREPARE" | "PREPARED" | "PRIMARY" | "PRIOR" | "PRIVILEGES" | "PROCEDURAL" | "PROCEDURE" | "PROCEDURES" | "PROGRAM" | "PUBLICATION" | "QUOTE" | "RANGE" | "READ" | "REAL" | "REASSIGN" | "RECHECK" | "RECURSIVE" | "REF_P" | "REFERENCES" | "REFERENCING" | "REFRESH" | "REINDEX" | "RELATIVE_P" | "RELEASE" | "RENAME" | "REPEATABLE" | "REPLACE" | "REPLICA" | "RESET" | "RESTART" | "RESTRICT" | "RETURN" | "RETURNING" | "RETURNS" | "REVOKE" | "RIGHT" | "ROLE" | "ROLLBACK" | "ROLLUP" | "ROUTINE" | "ROUTINES" | "ROW" | "ROWS" | "RULE" | "SAVEPOINT" | "SCALAR" | "SCHEMA" | "SCHEMAS" | "SCROLL" | "SEARCH" | "SECOND_P" | "SECURITY" | "SELECT" | "SEQUENCE" | "SEQUENCES" | "SERIALIZABLE" | "SERVER" | "SESSION" | "SESSION_USER" | "SET" | "SETS" | "SETOF" | "SHARE" | "SHOW" | "SIMILAR" | "SIMPLE" | "SKIP" | "SMALLINT" | "SNAPSHOT" | "SOME" | "SQL_P" | "STABLE" | "STANDALONE_P" | "START" | "STATEMENT" | "STATISTICS" | "STDIN" | "STDOUT" | "STORAGE" | "STORED" | "STRICT_P" | "STRIP_P" | "SUBSCRIPTION" | "SUBSTRING" | "SUPPORT" | "SYMMETRIC" | "SYSID" | "SYSTEM_P" | "SYSTEM_USER" | "TABLE" | "TABLES" | "TABLESAMPLE" | "TABLESPACE" | "TEMP" | "TEMPLATE" | "TEMPORARY" | "TEXT_P" | "THEN" | "TIES" | "TIME" | "TIMESTAMP" | "TO" | "TRAILING" | "TRANSACTION" | "TRANSFORM" | "TREAT" | "TRIGGER" | "TRIM" | "TRUE_P" | "TRUNCATE" | "TRUSTED" | "TYPE_P" | "TYPES_P" | "UESCAPE" | "UNBOUNDED" | "UNCOMMITTED" | "UNENCRYPTED" | "UNION" | "UNIQUE" | "UNKNOWN" | "UNLISTEN" | "UNLOGGED" | "UNTIL" | "UPDATE" | "USER" | "USING" | "VACUUM" | "VALID" | "VALIDATE" | "VALIDATOR" | "VALUE_P" | "VALUES" | "VARCHAR" | "VARIADIC" | "VARYING" | "VERBOSE" | "VERSION_P" | "VIEW" | "VIEWS" | "VOLATILE" | "WHEN" | "WHERE" | "WHITESPACE_P" | "WINDOW" | "WITH" | "WITHIN" | "WITHOUT" | "WORK" | "WRAPPER" | "WRITE" | "XML_P" | "XMLATTRIBUTES" | "XMLCONCAT" | "XMLELEMENT" | "XMLEXISTS" | "XMLFOREST" | "XMLNAMESPACES" | "XMLPARSE" | "XMLPI" | "XMLROOT" | "XMLSERIALIZE" | "XMLTABLE" | "YEAR_P" | "YES_P" | "ZONE" | "FORMAT_LA" | "NOT_LA" | "NULLS_LA" | "WITH_LA" | "WITHOUT_LA" | "MODE_TYPE_NAME" | "MODE_PLPGSQL_EXPR" | "MODE_PLPGSQL_ASSIGN1" | "MODE_PLPGSQL_ASSIGN2" | "MODE_PLPGSQL_ASSIGN3" | "UMINUS";
\ No newline at end of file
diff --git a/types/16/src/index.ts b/types/16/src/index.ts
new file mode 100644
index 00000000..dc5ee069
--- /dev/null
+++ b/types/16/src/index.ts
@@ -0,0 +1,2 @@
+export * from './types';
+export * from './enums';
diff --git a/types/16/src/types.ts b/types/16/src/types.ts
new file mode 100644
index 00000000..50eb3a30
--- /dev/null
+++ b/types/16/src/types.ts
@@ -0,0 +1,2326 @@
+/**
+* This file was automatically generated by pg-proto-parser@1.28.2.
+* DO NOT MODIFY IT BY HAND. Instead, modify the source proto file,
+* and run the pg-proto-parser generate command to regenerate this file.
+*/
+import { OverridingKind, QuerySource, SortByDir, SortByNulls, SetQuantifier, A_Expr_Kind, RoleSpecType, TableLikeOption, DefElemAction, PartitionStrategy, PartitionRangeDatumKind, RTEKind, WCOKind, GroupingSetKind, CTEMaterialize, SetOperation, ObjectType, DropBehavior, AlterTableType, GrantTargetType, VariableSetKind, ConstrType, ImportForeignSchemaType, RoleStmtType, FetchDirection, FunctionParameterMode, TransactionStmtKind, ViewCheckOption, DiscardMode, ReindexObjectType, AlterTSConfigType, PublicationObjSpecType, AlterPublicationAction, AlterSubscriptionType, OnCommitAction, ParamKind, CoercionContext, CoercionForm, BoolExprType, SubLinkType, RowCompareType, MinMaxOp, SQLValueFunctionOp, XmlExprOp, XmlOptionType, JsonEncoding, JsonFormatType, JsonConstructorType, JsonValueType, NullTestType, BoolTestType, CmdType, JoinType, AggStrategy, AggSplit, SetOpCmd, SetOpStrategy, OnConflictAction, LimitOption, LockClauseStrength, LockWaitPolicy, LockTupleMode, KeywordKind, Token } from "./enums";
+export type Node = {
+ ParseResult: ParseResult;
+} | {
+ ScanResult: ScanResult;
+} | {
+ Integer: Integer;
+} | {
+ Float: Float;
+} | {
+ Boolean: Boolean;
+} | {
+ String: String;
+} | {
+ BitString: BitString;
+} | {
+ List: List;
+} | {
+ OidList: OidList;
+} | {
+ IntList: IntList;
+} | {
+ A_Const: A_Const;
+} | {
+ Alias: Alias;
+} | {
+ RangeVar: RangeVar;
+} | {
+ TableFunc: TableFunc;
+} | {
+ IntoClause: IntoClause;
+} | {
+ Var: Var;
+} | {
+ Param: Param;
+} | {
+ Aggref: Aggref;
+} | {
+ GroupingFunc: GroupingFunc;
+} | {
+ WindowFunc: WindowFunc;
+} | {
+ SubscriptingRef: SubscriptingRef;
+} | {
+ FuncExpr: FuncExpr;
+} | {
+ NamedArgExpr: NamedArgExpr;
+} | {
+ OpExpr: OpExpr;
+} | {
+ DistinctExpr: DistinctExpr;
+} | {
+ NullIfExpr: NullIfExpr;
+} | {
+ ScalarArrayOpExpr: ScalarArrayOpExpr;
+} | {
+ BoolExpr: BoolExpr;
+} | {
+ SubLink: SubLink;
+} | {
+ SubPlan: SubPlan;
+} | {
+ AlternativeSubPlan: AlternativeSubPlan;
+} | {
+ FieldSelect: FieldSelect;
+} | {
+ FieldStore: FieldStore;
+} | {
+ RelabelType: RelabelType;
+} | {
+ CoerceViaIO: CoerceViaIO;
+} | {
+ ArrayCoerceExpr: ArrayCoerceExpr;
+} | {
+ ConvertRowtypeExpr: ConvertRowtypeExpr;
+} | {
+ CollateExpr: CollateExpr;
+} | {
+ CaseExpr: CaseExpr;
+} | {
+ CaseWhen: CaseWhen;
+} | {
+ CaseTestExpr: CaseTestExpr;
+} | {
+ ArrayExpr: ArrayExpr;
+} | {
+ RowExpr: RowExpr;
+} | {
+ RowCompareExpr: RowCompareExpr;
+} | {
+ CoalesceExpr: CoalesceExpr;
+} | {
+ MinMaxExpr: MinMaxExpr;
+} | {
+ SQLValueFunction: SQLValueFunction;
+} | {
+ XmlExpr: XmlExpr;
+} | {
+ JsonFormat: JsonFormat;
+} | {
+ JsonReturning: JsonReturning;
+} | {
+ JsonValueExpr: JsonValueExpr;
+} | {
+ JsonConstructorExpr: JsonConstructorExpr;
+} | {
+ JsonIsPredicate: JsonIsPredicate;
+} | {
+ NullTest: NullTest;
+} | {
+ BooleanTest: BooleanTest;
+} | {
+ CoerceToDomain: CoerceToDomain;
+} | {
+ CoerceToDomainValue: CoerceToDomainValue;
+} | {
+ SetToDefault: SetToDefault;
+} | {
+ CurrentOfExpr: CurrentOfExpr;
+} | {
+ NextValueExpr: NextValueExpr;
+} | {
+ InferenceElem: InferenceElem;
+} | {
+ TargetEntry: TargetEntry;
+} | {
+ RangeTblRef: RangeTblRef;
+} | {
+ JoinExpr: JoinExpr;
+} | {
+ FromExpr: FromExpr;
+} | {
+ OnConflictExpr: OnConflictExpr;
+} | {
+ Query: Query;
+} | {
+ TypeName: TypeName;
+} | {
+ ColumnRef: ColumnRef;
+} | {
+ ParamRef: ParamRef;
+} | {
+ A_Expr: A_Expr;
+} | {
+ TypeCast: TypeCast;
+} | {
+ CollateClause: CollateClause;
+} | {
+ RoleSpec: RoleSpec;
+} | {
+ FuncCall: FuncCall;
+} | {
+ A_Star: A_Star;
+} | {
+ A_Indices: A_Indices;
+} | {
+ A_Indirection: A_Indirection;
+} | {
+ A_ArrayExpr: A_ArrayExpr;
+} | {
+ ResTarget: ResTarget;
+} | {
+ MultiAssignRef: MultiAssignRef;
+} | {
+ SortBy: SortBy;
+} | {
+ WindowDef: WindowDef;
+} | {
+ RangeSubselect: RangeSubselect;
+} | {
+ RangeFunction: RangeFunction;
+} | {
+ RangeTableFunc: RangeTableFunc;
+} | {
+ RangeTableFuncCol: RangeTableFuncCol;
+} | {
+ RangeTableSample: RangeTableSample;
+} | {
+ ColumnDef: ColumnDef;
+} | {
+ TableLikeClause: TableLikeClause;
+} | {
+ IndexElem: IndexElem;
+} | {
+ DefElem: DefElem;
+} | {
+ LockingClause: LockingClause;
+} | {
+ XmlSerialize: XmlSerialize;
+} | {
+ PartitionElem: PartitionElem;
+} | {
+ PartitionSpec: PartitionSpec;
+} | {
+ PartitionBoundSpec: PartitionBoundSpec;
+} | {
+ PartitionRangeDatum: PartitionRangeDatum;
+} | {
+ PartitionCmd: PartitionCmd;
+} | {
+ RangeTblEntry: RangeTblEntry;
+} | {
+ RTEPermissionInfo: RTEPermissionInfo;
+} | {
+ RangeTblFunction: RangeTblFunction;
+} | {
+ TableSampleClause: TableSampleClause;
+} | {
+ WithCheckOption: WithCheckOption;
+} | {
+ SortGroupClause: SortGroupClause;
+} | {
+ GroupingSet: GroupingSet;
+} | {
+ WindowClause: WindowClause;
+} | {
+ RowMarkClause: RowMarkClause;
+} | {
+ WithClause: WithClause;
+} | {
+ InferClause: InferClause;
+} | {
+ OnConflictClause: OnConflictClause;
+} | {
+ CTESearchClause: CTESearchClause;
+} | {
+ CTECycleClause: CTECycleClause;
+} | {
+ CommonTableExpr: CommonTableExpr;
+} | {
+ MergeWhenClause: MergeWhenClause;
+} | {
+ MergeAction: MergeAction;
+} | {
+ TriggerTransition: TriggerTransition;
+} | {
+ JsonOutput: JsonOutput;
+} | {
+ JsonKeyValue: JsonKeyValue;
+} | {
+ JsonObjectConstructor: JsonObjectConstructor;
+} | {
+ JsonArrayConstructor: JsonArrayConstructor;
+} | {
+ JsonArrayQueryConstructor: JsonArrayQueryConstructor;
+} | {
+ JsonAggConstructor: JsonAggConstructor;
+} | {
+ JsonObjectAgg: JsonObjectAgg;
+} | {
+ JsonArrayAgg: JsonArrayAgg;
+} | {
+ RawStmt: RawStmt;
+} | {
+ InsertStmt: InsertStmt;
+} | {
+ DeleteStmt: DeleteStmt;
+} | {
+ UpdateStmt: UpdateStmt;
+} | {
+ MergeStmt: MergeStmt;
+} | {
+ SelectStmt: SelectStmt;
+} | {
+ SetOperationStmt: SetOperationStmt;
+} | {
+ ReturnStmt: ReturnStmt;
+} | {
+ PLAssignStmt: PLAssignStmt;
+} | {
+ CreateSchemaStmt: CreateSchemaStmt;
+} | {
+ AlterTableStmt: AlterTableStmt;
+} | {
+ ReplicaIdentityStmt: ReplicaIdentityStmt;
+} | {
+ AlterTableCmd: AlterTableCmd;
+} | {
+ AlterCollationStmt: AlterCollationStmt;
+} | {
+ AlterDomainStmt: AlterDomainStmt;
+} | {
+ GrantStmt: GrantStmt;
+} | {
+ ObjectWithArgs: ObjectWithArgs;
+} | {
+ AccessPriv: AccessPriv;
+} | {
+ GrantRoleStmt: GrantRoleStmt;
+} | {
+ AlterDefaultPrivilegesStmt: AlterDefaultPrivilegesStmt;
+} | {
+ CopyStmt: CopyStmt;
+} | {
+ VariableSetStmt: VariableSetStmt;
+} | {
+ VariableShowStmt: VariableShowStmt;
+} | {
+ CreateStmt: CreateStmt;
+} | {
+ Constraint: Constraint;
+} | {
+ CreateTableSpaceStmt: CreateTableSpaceStmt;
+} | {
+ DropTableSpaceStmt: DropTableSpaceStmt;
+} | {
+ AlterTableSpaceOptionsStmt: AlterTableSpaceOptionsStmt;
+} | {
+ AlterTableMoveAllStmt: AlterTableMoveAllStmt;
+} | {
+ CreateExtensionStmt: CreateExtensionStmt;
+} | {
+ AlterExtensionStmt: AlterExtensionStmt;
+} | {
+ AlterExtensionContentsStmt: AlterExtensionContentsStmt;
+} | {
+ CreateFdwStmt: CreateFdwStmt;
+} | {
+ AlterFdwStmt: AlterFdwStmt;
+} | {
+ CreateForeignServerStmt: CreateForeignServerStmt;
+} | {
+ AlterForeignServerStmt: AlterForeignServerStmt;
+} | {
+ CreateForeignTableStmt: CreateForeignTableStmt;
+} | {
+ CreateUserMappingStmt: CreateUserMappingStmt;
+} | {
+ AlterUserMappingStmt: AlterUserMappingStmt;
+} | {
+ DropUserMappingStmt: DropUserMappingStmt;
+} | {
+ ImportForeignSchemaStmt: ImportForeignSchemaStmt;
+} | {
+ CreatePolicyStmt: CreatePolicyStmt;
+} | {
+ AlterPolicyStmt: AlterPolicyStmt;
+} | {
+ CreateAmStmt: CreateAmStmt;
+} | {
+ CreateTrigStmt: CreateTrigStmt;
+} | {
+ CreateEventTrigStmt: CreateEventTrigStmt;
+} | {
+ AlterEventTrigStmt: AlterEventTrigStmt;
+} | {
+ CreatePLangStmt: CreatePLangStmt;
+} | {
+ CreateRoleStmt: CreateRoleStmt;
+} | {
+ AlterRoleStmt: AlterRoleStmt;
+} | {
+ AlterRoleSetStmt: AlterRoleSetStmt;
+} | {
+ DropRoleStmt: DropRoleStmt;
+} | {
+ CreateSeqStmt: CreateSeqStmt;
+} | {
+ AlterSeqStmt: AlterSeqStmt;
+} | {
+ DefineStmt: DefineStmt;
+} | {
+ CreateDomainStmt: CreateDomainStmt;
+} | {
+ CreateOpClassStmt: CreateOpClassStmt;
+} | {
+ CreateOpClassItem: CreateOpClassItem;
+} | {
+ CreateOpFamilyStmt: CreateOpFamilyStmt;
+} | {
+ AlterOpFamilyStmt: AlterOpFamilyStmt;
+} | {
+ DropStmt: DropStmt;
+} | {
+ TruncateStmt: TruncateStmt;
+} | {
+ CommentStmt: CommentStmt;
+} | {
+ SecLabelStmt: SecLabelStmt;
+} | {
+ DeclareCursorStmt: DeclareCursorStmt;
+} | {
+ ClosePortalStmt: ClosePortalStmt;
+} | {
+ FetchStmt: FetchStmt;
+} | {
+ IndexStmt: IndexStmt;
+} | {
+ CreateStatsStmt: CreateStatsStmt;
+} | {
+ StatsElem: StatsElem;
+} | {
+ AlterStatsStmt: AlterStatsStmt;
+} | {
+ CreateFunctionStmt: CreateFunctionStmt;
+} | {
+ FunctionParameter: FunctionParameter;
+} | {
+ AlterFunctionStmt: AlterFunctionStmt;
+} | {
+ DoStmt: DoStmt;
+} | {
+ InlineCodeBlock: InlineCodeBlock;
+} | {
+ CallStmt: CallStmt;
+} | {
+ CallContext: CallContext;
+} | {
+ RenameStmt: RenameStmt;
+} | {
+ AlterObjectDependsStmt: AlterObjectDependsStmt;
+} | {
+ AlterObjectSchemaStmt: AlterObjectSchemaStmt;
+} | {
+ AlterOwnerStmt: AlterOwnerStmt;
+} | {
+ AlterOperatorStmt: AlterOperatorStmt;
+} | {
+ AlterTypeStmt: AlterTypeStmt;
+} | {
+ RuleStmt: RuleStmt;
+} | {
+ NotifyStmt: NotifyStmt;
+} | {
+ ListenStmt: ListenStmt;
+} | {
+ UnlistenStmt: UnlistenStmt;
+} | {
+ TransactionStmt: TransactionStmt;
+} | {
+ CompositeTypeStmt: CompositeTypeStmt;
+} | {
+ CreateEnumStmt: CreateEnumStmt;
+} | {
+ CreateRangeStmt: CreateRangeStmt;
+} | {
+ AlterEnumStmt: AlterEnumStmt;
+} | {
+ ViewStmt: ViewStmt;
+} | {
+ LoadStmt: LoadStmt;
+} | {
+ CreatedbStmt: CreatedbStmt;
+} | {
+ AlterDatabaseStmt: AlterDatabaseStmt;
+} | {
+ AlterDatabaseRefreshCollStmt: AlterDatabaseRefreshCollStmt;
+} | {
+ AlterDatabaseSetStmt: AlterDatabaseSetStmt;
+} | {
+ DropdbStmt: DropdbStmt;
+} | {
+ AlterSystemStmt: AlterSystemStmt;
+} | {
+ ClusterStmt: ClusterStmt;
+} | {
+ VacuumStmt: VacuumStmt;
+} | {
+ VacuumRelation: VacuumRelation;
+} | {
+ ExplainStmt: ExplainStmt;
+} | {
+ CreateTableAsStmt: CreateTableAsStmt;
+} | {
+ RefreshMatViewStmt: RefreshMatViewStmt;
+} | {
+ CheckPointStmt: CheckPointStmt;
+} | {
+ DiscardStmt: DiscardStmt;
+} | {
+ LockStmt: LockStmt;
+} | {
+ ConstraintsSetStmt: ConstraintsSetStmt;
+} | {
+ ReindexStmt: ReindexStmt;
+} | {
+ CreateConversionStmt: CreateConversionStmt;
+} | {
+ CreateCastStmt: CreateCastStmt;
+} | {
+ CreateTransformStmt: CreateTransformStmt;
+} | {
+ PrepareStmt: PrepareStmt;
+} | {
+ ExecuteStmt: ExecuteStmt;
+} | {
+ DeallocateStmt: DeallocateStmt;
+} | {
+ DropOwnedStmt: DropOwnedStmt;
+} | {
+ ReassignOwnedStmt: ReassignOwnedStmt;
+} | {
+ AlterTSDictionaryStmt: AlterTSDictionaryStmt;
+} | {
+ AlterTSConfigurationStmt: AlterTSConfigurationStmt;
+} | {
+ PublicationTable: PublicationTable;
+} | {
+ PublicationObjSpec: PublicationObjSpec;
+} | {
+ CreatePublicationStmt: CreatePublicationStmt;
+} | {
+ AlterPublicationStmt: AlterPublicationStmt;
+} | {
+ CreateSubscriptionStmt: CreateSubscriptionStmt;
+} | {
+ AlterSubscriptionStmt: AlterSubscriptionStmt;
+} | {
+ DropSubscriptionStmt: DropSubscriptionStmt;
+} | {
+ ScanToken: ScanToken;
+};
+export interface ParseResult {
+ version?: number;
+ stmts?: RawStmt[];
+}
+export interface ScanResult {
+ version?: number;
+ tokens?: ScanToken[];
+}
+export interface Integer {
+ ival?: number;
+}
+export interface Float {
+ fval?: string;
+}
+export interface Boolean {
+ boolval?: boolean;
+}
+export interface String {
+ sval?: string;
+}
+export interface BitString {
+ bsval?: string;
+}
+export interface List {
+ items?: Node[];
+}
+export interface OidList {
+ items?: Node[];
+}
+export interface IntList {
+ items?: Node[];
+}
+export interface A_Const {
+ ival?: Integer;
+ fval?: Float;
+ boolval?: Boolean;
+ sval?: String;
+ bsval?: BitString;
+ isnull?: boolean;
+ location?: number;
+}
+export interface Alias {
+ aliasname?: string;
+ colnames?: Node[];
+}
+export interface RangeVar {
+ catalogname?: string;
+ schemaname?: string;
+ relname?: string;
+ inh?: boolean;
+ relpersistence?: string;
+ alias?: Alias;
+ location?: number;
+}
+export interface TableFunc {
+ ns_uris?: Node[];
+ ns_names?: Node[];
+ docexpr?: Node;
+ rowexpr?: Node;
+ colnames?: Node[];
+ coltypes?: Node[];
+ coltypmods?: Node[];
+ colcollations?: Node[];
+ colexprs?: Node[];
+ coldefexprs?: Node[];
+ notnulls?: bigint[];
+ ordinalitycol?: number;
+ location?: number;
+}
+export interface IntoClause {
+ rel?: RangeVar;
+ colNames?: Node[];
+ accessMethod?: string;
+ options?: Node[];
+ onCommit?: OnCommitAction;
+ tableSpaceName?: string;
+ viewQuery?: Node;
+ skipData?: boolean;
+}
+export interface Var {
+ xpr?: Node;
+ varno?: number;
+ varattno?: number;
+ vartype?: number;
+ vartypmod?: number;
+ varcollid?: number;
+ varnullingrels?: bigint[];
+ varlevelsup?: number;
+ location?: number;
+}
+export interface Param {
+ xpr?: Node;
+ paramkind?: ParamKind;
+ paramid?: number;
+ paramtype?: number;
+ paramtypmod?: number;
+ paramcollid?: number;
+ location?: number;
+}
+export interface Aggref {
+ xpr?: Node;
+ aggfnoid?: number;
+ aggtype?: number;
+ aggcollid?: number;
+ inputcollid?: number;
+ aggargtypes?: Node[];
+ aggdirectargs?: Node[];
+ args?: Node[];
+ aggorder?: Node[];
+ aggdistinct?: Node[];
+ aggfilter?: Node;
+ aggstar?: boolean;
+ aggvariadic?: boolean;
+ aggkind?: string;
+ agglevelsup?: number;
+ aggsplit?: AggSplit;
+ aggno?: number;
+ aggtransno?: number;
+ location?: number;
+}
+export interface GroupingFunc {
+ xpr?: Node;
+ args?: Node[];
+ refs?: Node[];
+ agglevelsup?: number;
+ location?: number;
+}
+export interface WindowFunc {
+ xpr?: Node;
+ winfnoid?: number;
+ wintype?: number;
+ wincollid?: number;
+ inputcollid?: number;
+ args?: Node[];
+ aggfilter?: Node;
+ winref?: number;
+ winstar?: boolean;
+ winagg?: boolean;
+ location?: number;
+}
+export interface SubscriptingRef {
+ xpr?: Node;
+ refcontainertype?: number;
+ refelemtype?: number;
+ refrestype?: number;
+ reftypmod?: number;
+ refcollid?: number;
+ refupperindexpr?: Node[];
+ reflowerindexpr?: Node[];
+ refexpr?: Node;
+ refassgnexpr?: Node;
+}
+export interface FuncExpr {
+ xpr?: Node;
+ funcid?: number;
+ funcresulttype?: number;
+ funcretset?: boolean;
+ funcvariadic?: boolean;
+ funcformat?: CoercionForm;
+ funccollid?: number;
+ inputcollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface NamedArgExpr {
+ xpr?: Node;
+ arg?: Node;
+ name?: string;
+ argnumber?: number;
+ location?: number;
+}
+export interface OpExpr {
+ xpr?: Node;
+ opno?: number;
+ opresulttype?: number;
+ opretset?: boolean;
+ opcollid?: number;
+ inputcollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface DistinctExpr {
+ xpr?: Node;
+ opno?: number;
+ opresulttype?: number;
+ opretset?: boolean;
+ opcollid?: number;
+ inputcollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface NullIfExpr {
+ xpr?: Node;
+ opno?: number;
+ opresulttype?: number;
+ opretset?: boolean;
+ opcollid?: number;
+ inputcollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface ScalarArrayOpExpr {
+ xpr?: Node;
+ opno?: number;
+ useOr?: boolean;
+ inputcollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface BoolExpr {
+ xpr?: Node;
+ boolop?: BoolExprType;
+ args?: Node[];
+ location?: number;
+}
+export interface SubLink {
+ xpr?: Node;
+ subLinkType?: SubLinkType;
+ subLinkId?: number;
+ testexpr?: Node;
+ operName?: Node[];
+ subselect?: Node;
+ location?: number;
+}
+export interface SubPlan {
+ xpr?: Node;
+ subLinkType?: SubLinkType;
+ testexpr?: Node;
+ paramIds?: Node[];
+ plan_id?: number;
+ plan_name?: string;
+ firstColType?: number;
+ firstColTypmod?: number;
+ firstColCollation?: number;
+ useHashTable?: boolean;
+ unknownEqFalse?: boolean;
+ parallel_safe?: boolean;
+ setParam?: Node[];
+ parParam?: Node[];
+ args?: Node[];
+ startup_cost?: number;
+ per_call_cost?: number;
+}
+export interface AlternativeSubPlan {
+ xpr?: Node;
+ subplans?: Node[];
+}
+export interface FieldSelect {
+ xpr?: Node;
+ arg?: Node;
+ fieldnum?: number;
+ resulttype?: number;
+ resulttypmod?: number;
+ resultcollid?: number;
+}
+export interface FieldStore {
+ xpr?: Node;
+ arg?: Node;
+ newvals?: Node[];
+ fieldnums?: Node[];
+ resulttype?: number;
+}
+export interface RelabelType {
+ xpr?: Node;
+ arg?: Node;
+ resulttype?: number;
+ resulttypmod?: number;
+ resultcollid?: number;
+ relabelformat?: CoercionForm;
+ location?: number;
+}
+export interface CoerceViaIO {
+ xpr?: Node;
+ arg?: Node;
+ resulttype?: number;
+ resultcollid?: number;
+ coerceformat?: CoercionForm;
+ location?: number;
+}
+export interface ArrayCoerceExpr {
+ xpr?: Node;
+ arg?: Node;
+ elemexpr?: Node;
+ resulttype?: number;
+ resulttypmod?: number;
+ resultcollid?: number;
+ coerceformat?: CoercionForm;
+ location?: number;
+}
+export interface ConvertRowtypeExpr {
+ xpr?: Node;
+ arg?: Node;
+ resulttype?: number;
+ convertformat?: CoercionForm;
+ location?: number;
+}
+export interface CollateExpr {
+ xpr?: Node;
+ arg?: Node;
+ collOid?: number;
+ location?: number;
+}
+export interface CaseExpr {
+ xpr?: Node;
+ casetype?: number;
+ casecollid?: number;
+ arg?: Node;
+ args?: Node[];
+ defresult?: Node;
+ location?: number;
+}
+export interface CaseWhen {
+ xpr?: Node;
+ expr?: Node;
+ result?: Node;
+ location?: number;
+}
+export interface CaseTestExpr {
+ xpr?: Node;
+ typeId?: number;
+ typeMod?: number;
+ collation?: number;
+}
+export interface ArrayExpr {
+ xpr?: Node;
+ array_typeid?: number;
+ array_collid?: number;
+ element_typeid?: number;
+ elements?: Node[];
+ multidims?: boolean;
+ location?: number;
+}
+export interface RowExpr {
+ xpr?: Node;
+ args?: Node[];
+ row_typeid?: number;
+ row_format?: CoercionForm;
+ colnames?: Node[];
+ location?: number;
+}
+export interface RowCompareExpr {
+ xpr?: Node;
+ rctype?: RowCompareType;
+ opnos?: Node[];
+ opfamilies?: Node[];
+ inputcollids?: Node[];
+ largs?: Node[];
+ rargs?: Node[];
+}
+export interface CoalesceExpr {
+ xpr?: Node;
+ coalescetype?: number;
+ coalescecollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface MinMaxExpr {
+ xpr?: Node;
+ minmaxtype?: number;
+ minmaxcollid?: number;
+ inputcollid?: number;
+ op?: MinMaxOp;
+ args?: Node[];
+ location?: number;
+}
+export interface SQLValueFunction {
+ xpr?: Node;
+ op?: SQLValueFunctionOp;
+ type?: number;
+ typmod?: number;
+ location?: number;
+}
+export interface XmlExpr {
+ xpr?: Node;
+ op?: XmlExprOp;
+ name?: string;
+ named_args?: Node[];
+ arg_names?: Node[];
+ args?: Node[];
+ xmloption?: XmlOptionType;
+ indent?: boolean;
+ type?: number;
+ typmod?: number;
+ location?: number;
+}
+export interface JsonFormat {
+ format_type?: JsonFormatType;
+ encoding?: JsonEncoding;
+ location?: number;
+}
+export interface JsonReturning {
+ format?: JsonFormat;
+ typid?: number;
+ typmod?: number;
+}
+export interface JsonValueExpr {
+ raw_expr?: Node;
+ formatted_expr?: Node;
+ format?: JsonFormat;
+}
+export interface JsonConstructorExpr {
+ xpr?: Node;
+ type?: JsonConstructorType;
+ args?: Node[];
+ func?: Node;
+ coercion?: Node;
+ returning?: JsonReturning;
+ absent_on_null?: boolean;
+ unique?: boolean;
+ location?: number;
+}
+export interface JsonIsPredicate {
+ expr?: Node;
+ format?: JsonFormat;
+ item_type?: JsonValueType;
+ unique_keys?: boolean;
+ location?: number;
+}
+export interface NullTest {
+ xpr?: Node;
+ arg?: Node;
+ nulltesttype?: NullTestType;
+ argisrow?: boolean;
+ location?: number;
+}
+export interface BooleanTest {
+ xpr?: Node;
+ arg?: Node;
+ booltesttype?: BoolTestType;
+ location?: number;
+}
+export interface CoerceToDomain {
+ xpr?: Node;
+ arg?: Node;
+ resulttype?: number;
+ resulttypmod?: number;
+ resultcollid?: number;
+ coercionformat?: CoercionForm;
+ location?: number;
+}
+export interface CoerceToDomainValue {
+ xpr?: Node;
+ typeId?: number;
+ typeMod?: number;
+ collation?: number;
+ location?: number;
+}
+export interface SetToDefault {
+ xpr?: Node;
+ typeId?: number;
+ typeMod?: number;
+ collation?: number;
+ location?: number;
+}
+export interface CurrentOfExpr {
+ xpr?: Node;
+ cvarno?: number;
+ cursor_name?: string;
+ cursor_param?: number;
+}
+export interface NextValueExpr {
+ xpr?: Node;
+ seqid?: number;
+ typeId?: number;
+}
+export interface InferenceElem {
+ xpr?: Node;
+ expr?: Node;
+ infercollid?: number;
+ inferopclass?: number;
+}
+export interface TargetEntry {
+ xpr?: Node;
+ expr?: Node;
+ resno?: number;
+ resname?: string;
+ ressortgroupref?: number;
+ resorigtbl?: number;
+ resorigcol?: number;
+ resjunk?: boolean;
+}
+export interface RangeTblRef {
+ rtindex?: number;
+}
+export interface JoinExpr {
+ jointype?: JoinType;
+ isNatural?: boolean;
+ larg?: Node;
+ rarg?: Node;
+ usingClause?: Node[];
+ join_using_alias?: Alias;
+ quals?: Node;
+ alias?: Alias;
+ rtindex?: number;
+}
+export interface FromExpr {
+ fromlist?: Node[];
+ quals?: Node;
+}
+export interface OnConflictExpr {
+ action?: OnConflictAction;
+ arbiterElems?: Node[];
+ arbiterWhere?: Node;
+ constraint?: number;
+ onConflictSet?: Node[];
+ onConflictWhere?: Node;
+ exclRelIndex?: number;
+ exclRelTlist?: Node[];
+}
+export interface Query {
+ commandType?: CmdType;
+ querySource?: QuerySource;
+ canSetTag?: boolean;
+ utilityStmt?: Node;
+ resultRelation?: number;
+ hasAggs?: boolean;
+ hasWindowFuncs?: boolean;
+ hasTargetSRFs?: boolean;
+ hasSubLinks?: boolean;
+ hasDistinctOn?: boolean;
+ hasRecursive?: boolean;
+ hasModifyingCTE?: boolean;
+ hasForUpdate?: boolean;
+ hasRowSecurity?: boolean;
+ isReturn?: boolean;
+ cteList?: Node[];
+ rtable?: Node[];
+ rteperminfos?: Node[];
+ jointree?: FromExpr;
+ mergeActionList?: Node[];
+ mergeUseOuterJoin?: boolean;
+ targetList?: Node[];
+ override?: OverridingKind;
+ onConflict?: OnConflictExpr;
+ returningList?: Node[];
+ groupClause?: Node[];
+ groupDistinct?: boolean;
+ groupingSets?: Node[];
+ havingQual?: Node;
+ windowClause?: Node[];
+ distinctClause?: Node[];
+ sortClause?: Node[];
+ limitOffset?: Node;
+ limitCount?: Node;
+ limitOption?: LimitOption;
+ rowMarks?: Node[];
+ setOperations?: Node;
+ constraintDeps?: Node[];
+ withCheckOptions?: Node[];
+ stmt_location?: number;
+ stmt_len?: number;
+}
+export interface TypeName {
+ names?: Node[];
+ typeOid?: number;
+ setof?: boolean;
+ pct_type?: boolean;
+ typmods?: Node[];
+ typemod?: number;
+ arrayBounds?: Node[];
+ location?: number;
+}
+export interface ColumnRef {
+ fields?: Node[];
+ location?: number;
+}
+export interface ParamRef {
+ number?: number;
+ location?: number;
+}
+export interface A_Expr {
+ kind?: A_Expr_Kind;
+ name?: Node[];
+ lexpr?: Node;
+ rexpr?: Node;
+ location?: number;
+}
+export interface TypeCast {
+ arg?: Node;
+ typeName?: TypeName;
+ location?: number;
+}
+export interface CollateClause {
+ arg?: Node;
+ collname?: Node[];
+ location?: number;
+}
+export interface RoleSpec {
+ roletype?: RoleSpecType;
+ rolename?: string;
+ location?: number;
+}
+export interface FuncCall {
+ funcname?: Node[];
+ args?: Node[];
+ agg_order?: Node[];
+ agg_filter?: Node;
+ over?: WindowDef;
+ agg_within_group?: boolean;
+ agg_star?: boolean;
+ agg_distinct?: boolean;
+ func_variadic?: boolean;
+ funcformat?: CoercionForm;
+ location?: number;
+}
+export interface A_Star {}
+export interface A_Indices {
+ is_slice?: boolean;
+ lidx?: Node;
+ uidx?: Node;
+}
+export interface A_Indirection {
+ arg?: Node;
+ indirection?: Node[];
+}
+export interface A_ArrayExpr {
+ elements?: Node[];
+ location?: number;
+}
+export interface ResTarget {
+ name?: string;
+ indirection?: Node[];
+ val?: Node;
+ location?: number;
+}
+export interface MultiAssignRef {
+ source?: Node;
+ colno?: number;
+ ncolumns?: number;
+}
+export interface SortBy {
+ node?: Node;
+ sortby_dir?: SortByDir;
+ sortby_nulls?: SortByNulls;
+ useOp?: Node[];
+ location?: number;
+}
+export interface WindowDef {
+ name?: string;
+ refname?: string;
+ partitionClause?: Node[];
+ orderClause?: Node[];
+ frameOptions?: number;
+ startOffset?: Node;
+ endOffset?: Node;
+ location?: number;
+}
+export interface RangeSubselect {
+ lateral?: boolean;
+ subquery?: Node;
+ alias?: Alias;
+}
+export interface RangeFunction {
+ lateral?: boolean;
+ ordinality?: boolean;
+ is_rowsfrom?: boolean;
+ functions?: Node[];
+ alias?: Alias;
+ coldeflist?: Node[];
+}
+export interface RangeTableFunc {
+ lateral?: boolean;
+ docexpr?: Node;
+ rowexpr?: Node;
+ namespaces?: Node[];
+ columns?: Node[];
+ alias?: Alias;
+ location?: number;
+}
+export interface RangeTableFuncCol {
+ colname?: string;
+ typeName?: TypeName;
+ for_ordinality?: boolean;
+ is_not_null?: boolean;
+ colexpr?: Node;
+ coldefexpr?: Node;
+ location?: number;
+}
+export interface RangeTableSample {
+ relation?: Node;
+ method?: Node[];
+ args?: Node[];
+ repeatable?: Node;
+ location?: number;
+}
+export interface ColumnDef {
+ colname?: string;
+ typeName?: TypeName;
+ compression?: string;
+ inhcount?: number;
+ is_local?: boolean;
+ is_not_null?: boolean;
+ is_from_type?: boolean;
+ storage?: string;
+ storage_name?: string;
+ raw_default?: Node;
+ cooked_default?: Node;
+ identity?: string;
+ identitySequence?: RangeVar;
+ generated?: string;
+ collClause?: CollateClause;
+ collOid?: number;
+ constraints?: Node[];
+ fdwoptions?: Node[];
+ location?: number;
+}
+export interface TableLikeClause {
+ relation?: RangeVar;
+ options?: number;
+ relationOid?: number;
+}
+export interface IndexElem {
+ name?: string;
+ expr?: Node;
+ indexcolname?: string;
+ collation?: Node[];
+ opclass?: Node[];
+ opclassopts?: Node[];
+ ordering?: SortByDir;
+ nulls_ordering?: SortByNulls;
+}
+export interface DefElem {
+ defnamespace?: string;
+ defname?: string;
+ arg?: Node;
+ defaction?: DefElemAction;
+ location?: number;
+}
+export interface LockingClause {
+ lockedRels?: Node[];
+ strength?: LockClauseStrength;
+ waitPolicy?: LockWaitPolicy;
+}
+export interface XmlSerialize {
+ xmloption?: XmlOptionType;
+ expr?: Node;
+ typeName?: TypeName;
+ indent?: boolean;
+ location?: number;
+}
+export interface PartitionElem {
+ name?: string;
+ expr?: Node;
+ collation?: Node[];
+ opclass?: Node[];
+ location?: number;
+}
+export interface PartitionSpec {
+ strategy?: PartitionStrategy;
+ partParams?: Node[];
+ location?: number;
+}
+export interface PartitionBoundSpec {
+ strategy?: string;
+ is_default?: boolean;
+ modulus?: number;
+ remainder?: number;
+ listdatums?: Node[];
+ lowerdatums?: Node[];
+ upperdatums?: Node[];
+ location?: number;
+}
+export interface PartitionRangeDatum {
+ kind?: PartitionRangeDatumKind;
+ value?: Node;
+ location?: number;
+}
+export interface PartitionCmd {
+ name?: RangeVar;
+ bound?: PartitionBoundSpec;
+ concurrent?: boolean;
+}
+export interface RangeTblEntry {
+ rtekind?: RTEKind;
+ relid?: number;
+ relkind?: string;
+ rellockmode?: number;
+ tablesample?: TableSampleClause;
+ perminfoindex?: number;
+ subquery?: Query;
+ security_barrier?: boolean;
+ jointype?: JoinType;
+ joinmergedcols?: number;
+ joinaliasvars?: Node[];
+ joinleftcols?: Node[];
+ joinrightcols?: Node[];
+ join_using_alias?: Alias;
+ functions?: Node[];
+ funcordinality?: boolean;
+ tablefunc?: TableFunc;
+ values_lists?: Node[];
+ ctename?: string;
+ ctelevelsup?: number;
+ self_reference?: boolean;
+ coltypes?: Node[];
+ coltypmods?: Node[];
+ colcollations?: Node[];
+ enrname?: string;
+ enrtuples?: number;
+ alias?: Alias;
+ eref?: Alias;
+ lateral?: boolean;
+ inh?: boolean;
+ inFromCl?: boolean;
+ securityQuals?: Node[];
+}
+export interface RTEPermissionInfo {
+ relid?: number;
+ inh?: boolean;
+ requiredPerms?: bigint;
+ checkAsUser?: number;
+ selectedCols?: bigint[];
+ insertedCols?: bigint[];
+ updatedCols?: bigint[];
+}
+export interface RangeTblFunction {
+ funcexpr?: Node;
+ funccolcount?: number;
+ funccolnames?: Node[];
+ funccoltypes?: Node[];
+ funccoltypmods?: Node[];
+ funccolcollations?: Node[];
+ funcparams?: bigint[];
+}
+export interface TableSampleClause {
+ tsmhandler?: number;
+ args?: Node[];
+ repeatable?: Node;
+}
+export interface WithCheckOption {
+ kind?: WCOKind;
+ relname?: string;
+ polname?: string;
+ qual?: Node;
+ cascaded?: boolean;
+}
+export interface SortGroupClause {
+ tleSortGroupRef?: number;
+ eqop?: number;
+ sortop?: number;
+ nulls_first?: boolean;
+ hashable?: boolean;
+}
+export interface GroupingSet {
+ kind?: GroupingSetKind;
+ content?: Node[];
+ location?: number;
+}
+export interface WindowClause {
+ name?: string;
+ refname?: string;
+ partitionClause?: Node[];
+ orderClause?: Node[];
+ frameOptions?: number;
+ startOffset?: Node;
+ endOffset?: Node;
+ runCondition?: Node[];
+ startInRangeFunc?: number;
+ endInRangeFunc?: number;
+ inRangeColl?: number;
+ inRangeAsc?: boolean;
+ inRangeNullsFirst?: boolean;
+ winref?: number;
+ copiedOrder?: boolean;
+}
+export interface RowMarkClause {
+ rti?: number;
+ strength?: LockClauseStrength;
+ waitPolicy?: LockWaitPolicy;
+ pushedDown?: boolean;
+}
+export interface WithClause {
+ ctes?: Node[];
+ recursive?: boolean;
+ location?: number;
+}
+export interface InferClause {
+ indexElems?: Node[];
+ whereClause?: Node;
+ conname?: string;
+ location?: number;
+}
+export interface OnConflictClause {
+ action?: OnConflictAction;
+ infer?: InferClause;
+ targetList?: Node[];
+ whereClause?: Node;
+ location?: number;
+}
+export interface CTESearchClause {
+ search_col_list?: Node[];
+ search_breadth_first?: boolean;
+ search_seq_column?: string;
+ location?: number;
+}
+export interface CTECycleClause {
+ cycle_col_list?: Node[];
+ cycle_mark_column?: string;
+ cycle_mark_value?: Node;
+ cycle_mark_default?: Node;
+ cycle_path_column?: string;
+ location?: number;
+ cycle_mark_type?: number;
+ cycle_mark_typmod?: number;
+ cycle_mark_collation?: number;
+ cycle_mark_neop?: number;
+}
+export interface CommonTableExpr {
+ ctename?: string;
+ aliascolnames?: Node[];
+ ctematerialized?: CTEMaterialize;
+ ctequery?: Node;
+ search_clause?: CTESearchClause;
+ cycle_clause?: CTECycleClause;
+ location?: number;
+ cterecursive?: boolean;
+ cterefcount?: number;
+ ctecolnames?: Node[];
+ ctecoltypes?: Node[];
+ ctecoltypmods?: Node[];
+ ctecolcollations?: Node[];
+}
+export interface MergeWhenClause {
+ matched?: boolean;
+ commandType?: CmdType;
+ override?: OverridingKind;
+ condition?: Node;
+ targetList?: Node[];
+ values?: Node[];
+}
+export interface MergeAction {
+ matched?: boolean;
+ commandType?: CmdType;
+ override?: OverridingKind;
+ qual?: Node;
+ targetList?: Node[];
+ updateColnos?: Node[];
+}
+export interface TriggerTransition {
+ name?: string;
+ isNew?: boolean;
+ isTable?: boolean;
+}
+export interface JsonOutput {
+ typeName?: TypeName;
+ returning?: JsonReturning;
+}
+export interface JsonKeyValue {
+ key?: Node;
+ value?: JsonValueExpr;
+}
+export interface JsonObjectConstructor {
+ exprs?: Node[];
+ output?: JsonOutput;
+ absent_on_null?: boolean;
+ unique?: boolean;
+ location?: number;
+}
+export interface JsonArrayConstructor {
+ exprs?: Node[];
+ output?: JsonOutput;
+ absent_on_null?: boolean;
+ location?: number;
+}
+export interface JsonArrayQueryConstructor {
+ query?: Node;
+ output?: JsonOutput;
+ format?: JsonFormat;
+ absent_on_null?: boolean;
+ location?: number;
+}
+export interface JsonAggConstructor {
+ output?: JsonOutput;
+ agg_filter?: Node;
+ agg_order?: Node[];
+ over?: WindowDef;
+ location?: number;
+}
+export interface JsonObjectAgg {
+ constructor?: JsonAggConstructor;
+ arg?: JsonKeyValue;
+ absent_on_null?: boolean;
+ unique?: boolean;
+}
+export interface JsonArrayAgg {
+ constructor?: JsonAggConstructor;
+ arg?: JsonValueExpr;
+ absent_on_null?: boolean;
+}
+export interface RawStmt {
+ stmt?: Node;
+ stmt_location?: number;
+ stmt_len?: number;
+}
+export interface InsertStmt {
+ relation?: RangeVar;
+ cols?: Node[];
+ selectStmt?: Node;
+ onConflictClause?: OnConflictClause;
+ returningList?: Node[];
+ withClause?: WithClause;
+ override?: OverridingKind;
+}
+export interface DeleteStmt {
+ relation?: RangeVar;
+ usingClause?: Node[];
+ whereClause?: Node;
+ returningList?: Node[];
+ withClause?: WithClause;
+}
+export interface UpdateStmt {
+ relation?: RangeVar;
+ targetList?: Node[];
+ whereClause?: Node;
+ fromClause?: Node[];
+ returningList?: Node[];
+ withClause?: WithClause;
+}
+export interface MergeStmt {
+ relation?: RangeVar;
+ sourceRelation?: Node;
+ joinCondition?: Node;
+ mergeWhenClauses?: Node[];
+ withClause?: WithClause;
+}
+export interface SelectStmt {
+ distinctClause?: Node[];
+ intoClause?: IntoClause;
+ targetList?: Node[];
+ fromClause?: Node[];
+ whereClause?: Node;
+ groupClause?: Node[];
+ groupDistinct?: boolean;
+ havingClause?: Node;
+ windowClause?: Node[];
+ valuesLists?: Node[];
+ sortClause?: Node[];
+ limitOffset?: Node;
+ limitCount?: Node;
+ limitOption?: LimitOption;
+ lockingClause?: Node[];
+ withClause?: WithClause;
+ op?: SetOperation;
+ all?: boolean;
+ larg?: SelectStmt;
+ rarg?: SelectStmt;
+}
+export interface SetOperationStmt {
+ op?: SetOperation;
+ all?: boolean;
+ larg?: Node;
+ rarg?: Node;
+ colTypes?: Node[];
+ colTypmods?: Node[];
+ colCollations?: Node[];
+ groupClauses?: Node[];
+}
+export interface ReturnStmt {
+ returnval?: Node;
+}
+export interface PLAssignStmt {
+ name?: string;
+ indirection?: Node[];
+ nnames?: number;
+ val?: SelectStmt;
+ location?: number;
+}
+export interface CreateSchemaStmt {
+ schemaname?: string;
+ authrole?: RoleSpec;
+ schemaElts?: Node[];
+ if_not_exists?: boolean;
+}
+export interface AlterTableStmt {
+ relation?: RangeVar;
+ cmds?: Node[];
+ objtype?: ObjectType;
+ missing_ok?: boolean;
+}
+export interface ReplicaIdentityStmt {
+ identity_type?: string;
+ name?: string;
+}
+export interface AlterTableCmd {
+ subtype?: AlterTableType;
+ name?: string;
+ num?: number;
+ newowner?: RoleSpec;
+ def?: Node;
+ behavior?: DropBehavior;
+ missing_ok?: boolean;
+ recurse?: boolean;
+}
+export interface AlterCollationStmt {
+ collname?: Node[];
+}
+export interface AlterDomainStmt {
+ subtype?: string;
+ typeName?: Node[];
+ name?: string;
+ def?: Node;
+ behavior?: DropBehavior;
+ missing_ok?: boolean;
+}
+export interface GrantStmt {
+ is_grant?: boolean;
+ targtype?: GrantTargetType;
+ objtype?: ObjectType;
+ objects?: Node[];
+ privileges?: Node[];
+ grantees?: Node[];
+ grant_option?: boolean;
+ grantor?: RoleSpec;
+ behavior?: DropBehavior;
+}
+export interface ObjectWithArgs {
+ objname?: Node[];
+ objargs?: Node[];
+ objfuncargs?: Node[];
+ args_unspecified?: boolean;
+}
+export interface AccessPriv {
+ priv_name?: string;
+ cols?: Node[];
+}
+export interface GrantRoleStmt {
+ granted_roles?: Node[];
+ grantee_roles?: Node[];
+ is_grant?: boolean;
+ opt?: Node[];
+ grantor?: RoleSpec;
+ behavior?: DropBehavior;
+}
+export interface AlterDefaultPrivilegesStmt {
+ options?: Node[];
+ action?: GrantStmt;
+}
+export interface CopyStmt {
+ relation?: RangeVar;
+ query?: Node;
+ attlist?: Node[];
+ is_from?: boolean;
+ is_program?: boolean;
+ filename?: string;
+ options?: Node[];
+ whereClause?: Node;
+}
+export interface VariableSetStmt {
+ kind?: VariableSetKind;
+ name?: string;
+ args?: Node[];
+ is_local?: boolean;
+}
+export interface VariableShowStmt {
+ name?: string;
+}
+export interface CreateStmt {
+ relation?: RangeVar;
+ tableElts?: Node[];
+ inhRelations?: Node[];
+ partbound?: PartitionBoundSpec;
+ partspec?: PartitionSpec;
+ ofTypename?: TypeName;
+ constraints?: Node[];
+ options?: Node[];
+ oncommit?: OnCommitAction;
+ tablespacename?: string;
+ accessMethod?: string;
+ if_not_exists?: boolean;
+}
+export interface Constraint {
+ contype?: ConstrType;
+ conname?: string;
+ deferrable?: boolean;
+ initdeferred?: boolean;
+ location?: number;
+ is_no_inherit?: boolean;
+ raw_expr?: Node;
+ cooked_expr?: string;
+ generated_when?: string;
+ nulls_not_distinct?: boolean;
+ keys?: Node[];
+ including?: Node[];
+ exclusions?: Node[];
+ options?: Node[];
+ indexname?: string;
+ indexspace?: string;
+ reset_default_tblspc?: boolean;
+ access_method?: string;
+ where_clause?: Node;
+ pktable?: RangeVar;
+ fk_attrs?: Node[];
+ pk_attrs?: Node[];
+ fk_matchtype?: string;
+ fk_upd_action?: string;
+ fk_del_action?: string;
+ fk_del_set_cols?: Node[];
+ old_conpfeqop?: Node[];
+ old_pktable_oid?: number;
+ skip_validation?: boolean;
+ initially_valid?: boolean;
+}
+export interface CreateTableSpaceStmt {
+ tablespacename?: string;
+ owner?: RoleSpec;
+ location?: string;
+ options?: Node[];
+}
+export interface DropTableSpaceStmt {
+ tablespacename?: string;
+ missing_ok?: boolean;
+}
+export interface AlterTableSpaceOptionsStmt {
+ tablespacename?: string;
+ options?: Node[];
+ isReset?: boolean;
+}
+export interface AlterTableMoveAllStmt {
+ orig_tablespacename?: string;
+ objtype?: ObjectType;
+ roles?: Node[];
+ new_tablespacename?: string;
+ nowait?: boolean;
+}
+export interface CreateExtensionStmt {
+ extname?: string;
+ if_not_exists?: boolean;
+ options?: Node[];
+}
+export interface AlterExtensionStmt {
+ extname?: string;
+ options?: Node[];
+}
+export interface AlterExtensionContentsStmt {
+ extname?: string;
+ action?: number;
+ objtype?: ObjectType;
+ object?: Node;
+}
+export interface CreateFdwStmt {
+ fdwname?: string;
+ func_options?: Node[];
+ options?: Node[];
+}
+export interface AlterFdwStmt {
+ fdwname?: string;
+ func_options?: Node[];
+ options?: Node[];
+}
+export interface CreateForeignServerStmt {
+ servername?: string;
+ servertype?: string;
+ version?: string;
+ fdwname?: string;
+ if_not_exists?: boolean;
+ options?: Node[];
+}
+export interface AlterForeignServerStmt {
+ servername?: string;
+ version?: string;
+ options?: Node[];
+ has_version?: boolean;
+}
+export interface CreateForeignTableStmt {
+ base?: CreateStmt;
+ servername?: string;
+ options?: Node[];
+}
+export interface CreateUserMappingStmt {
+ user?: RoleSpec;
+ servername?: string;
+ if_not_exists?: boolean;
+ options?: Node[];
+}
+export interface AlterUserMappingStmt {
+ user?: RoleSpec;
+ servername?: string;
+ options?: Node[];
+}
+export interface DropUserMappingStmt {
+ user?: RoleSpec;
+ servername?: string;
+ missing_ok?: boolean;
+}
+export interface ImportForeignSchemaStmt {
+ server_name?: string;
+ remote_schema?: string;
+ local_schema?: string;
+ list_type?: ImportForeignSchemaType;
+ table_list?: Node[];
+ options?: Node[];
+}
+export interface CreatePolicyStmt {
+ policy_name?: string;
+ table?: RangeVar;
+ cmd_name?: string;
+ permissive?: boolean;
+ roles?: Node[];
+ qual?: Node;
+ with_check?: Node;
+}
+export interface AlterPolicyStmt {
+ policy_name?: string;
+ table?: RangeVar;
+ roles?: Node[];
+ qual?: Node;
+ with_check?: Node;
+}
+export interface CreateAmStmt {
+ amname?: string;
+ handler_name?: Node[];
+ amtype?: string;
+}
+export interface CreateTrigStmt {
+ replace?: boolean;
+ isconstraint?: boolean;
+ trigname?: string;
+ relation?: RangeVar;
+ funcname?: Node[];
+ args?: Node[];
+ row?: boolean;
+ timing?: number;
+ events?: number;
+ columns?: Node[];
+ whenClause?: Node;
+ transitionRels?: Node[];
+ deferrable?: boolean;
+ initdeferred?: boolean;
+ constrrel?: RangeVar;
+}
+export interface CreateEventTrigStmt {
+ trigname?: string;
+ eventname?: string;
+ whenclause?: Node[];
+ funcname?: Node[];
+}
+export interface AlterEventTrigStmt {
+ trigname?: string;
+ tgenabled?: string;
+}
+export interface CreatePLangStmt {
+ replace?: boolean;
+ plname?: string;
+ plhandler?: Node[];
+ plinline?: Node[];
+ plvalidator?: Node[];
+ pltrusted?: boolean;
+}
+export interface CreateRoleStmt {
+ stmt_type?: RoleStmtType;
+ role?: string;
+ options?: Node[];
+}
+export interface AlterRoleStmt {
+ role?: RoleSpec;
+ options?: Node[];
+ action?: number;
+}
+export interface AlterRoleSetStmt {
+ role?: RoleSpec;
+ database?: string;
+ setstmt?: VariableSetStmt;
+}
+export interface DropRoleStmt {
+ roles?: Node[];
+ missing_ok?: boolean;
+}
+export interface CreateSeqStmt {
+ sequence?: RangeVar;
+ options?: Node[];
+ ownerId?: number;
+ for_identity?: boolean;
+ if_not_exists?: boolean;
+}
+export interface AlterSeqStmt {
+ sequence?: RangeVar;
+ options?: Node[];
+ for_identity?: boolean;
+ missing_ok?: boolean;
+}
+export interface DefineStmt {
+ kind?: ObjectType;
+ oldstyle?: boolean;
+ defnames?: Node[];
+ args?: Node[];
+ definition?: Node[];
+ if_not_exists?: boolean;
+ replace?: boolean;
+}
+export interface CreateDomainStmt {
+ domainname?: Node[];
+ typeName?: TypeName;
+ collClause?: CollateClause;
+ constraints?: Node[];
+}
+export interface CreateOpClassStmt {
+ opclassname?: Node[];
+ opfamilyname?: Node[];
+ amname?: string;
+ datatype?: TypeName;
+ items?: Node[];
+ isDefault?: boolean;
+}
+export interface CreateOpClassItem {
+ itemtype?: number;
+ name?: ObjectWithArgs;
+ number?: number;
+ order_family?: Node[];
+ class_args?: Node[];
+ storedtype?: TypeName;
+}
+export interface CreateOpFamilyStmt {
+ opfamilyname?: Node[];
+ amname?: string;
+}
+export interface AlterOpFamilyStmt {
+ opfamilyname?: Node[];
+ amname?: string;
+ isDrop?: boolean;
+ items?: Node[];
+}
+export interface DropStmt {
+ objects?: Node[];
+ removeType?: ObjectType;
+ behavior?: DropBehavior;
+ missing_ok?: boolean;
+ concurrent?: boolean;
+}
+export interface TruncateStmt {
+ relations?: Node[];
+ restart_seqs?: boolean;
+ behavior?: DropBehavior;
+}
+export interface CommentStmt {
+ objtype?: ObjectType;
+ object?: Node;
+ comment?: string;
+}
+export interface SecLabelStmt {
+ objtype?: ObjectType;
+ object?: Node;
+ provider?: string;
+ label?: string;
+}
+export interface DeclareCursorStmt {
+ portalname?: string;
+ options?: number;
+ query?: Node;
+}
+export interface ClosePortalStmt {
+ portalname?: string;
+}
+export interface FetchStmt {
+ direction?: FetchDirection;
+ howMany?: bigint;
+ portalname?: string;
+ ismove?: boolean;
+}
+export interface IndexStmt {
+ idxname?: string;
+ relation?: RangeVar;
+ accessMethod?: string;
+ tableSpace?: string;
+ indexParams?: Node[];
+ indexIncludingParams?: Node[];
+ options?: Node[];
+ whereClause?: Node;
+ excludeOpNames?: Node[];
+ idxcomment?: string;
+ indexOid?: number;
+ oldNumber?: number;
+ oldCreateSubid?: number;
+ oldFirstRelfilelocatorSubid?: number;
+ unique?: boolean;
+ nulls_not_distinct?: boolean;
+ primary?: boolean;
+ isconstraint?: boolean;
+ deferrable?: boolean;
+ initdeferred?: boolean;
+ transformed?: boolean;
+ concurrent?: boolean;
+ if_not_exists?: boolean;
+ reset_default_tblspc?: boolean;
+}
+export interface CreateStatsStmt {
+ defnames?: Node[];
+ stat_types?: Node[];
+ exprs?: Node[];
+ relations?: Node[];
+ stxcomment?: string;
+ transformed?: boolean;
+ if_not_exists?: boolean;
+}
+export interface StatsElem {
+ name?: string;
+ expr?: Node;
+}
+export interface AlterStatsStmt {
+ defnames?: Node[];
+ stxstattarget?: number;
+ missing_ok?: boolean;
+}
+export interface CreateFunctionStmt {
+ is_procedure?: boolean;
+ replace?: boolean;
+ funcname?: Node[];
+ parameters?: Node[];
+ returnType?: TypeName;
+ options?: Node[];
+ sql_body?: Node;
+}
+export interface FunctionParameter {
+ name?: string;
+ argType?: TypeName;
+ mode?: FunctionParameterMode;
+ defexpr?: Node;
+}
+export interface AlterFunctionStmt {
+ objtype?: ObjectType;
+ func?: ObjectWithArgs;
+ actions?: Node[];
+}
+export interface DoStmt {
+ args?: Node[];
+}
+export interface InlineCodeBlock {
+ source_text?: string;
+ langOid?: number;
+ langIsTrusted?: boolean;
+ atomic?: boolean;
+}
+export interface CallStmt {
+ funccall?: FuncCall;
+ funcexpr?: FuncExpr;
+ outargs?: Node[];
+}
+export interface CallContext {
+ atomic?: boolean;
+}
+export interface RenameStmt {
+ renameType?: ObjectType;
+ relationType?: ObjectType;
+ relation?: RangeVar;
+ object?: Node;
+ subname?: string;
+ newname?: string;
+ behavior?: DropBehavior;
+ missing_ok?: boolean;
+}
+export interface AlterObjectDependsStmt {
+ objectType?: ObjectType;
+ relation?: RangeVar;
+ object?: Node;
+ extname?: String;
+ remove?: boolean;
+}
+export interface AlterObjectSchemaStmt {
+ objectType?: ObjectType;
+ relation?: RangeVar;
+ object?: Node;
+ newschema?: string;
+ missing_ok?: boolean;
+}
+export interface AlterOwnerStmt {
+ objectType?: ObjectType;
+ relation?: RangeVar;
+ object?: Node;
+ newowner?: RoleSpec;
+}
+export interface AlterOperatorStmt {
+ opername?: ObjectWithArgs;
+ options?: Node[];
+}
+export interface AlterTypeStmt {
+ typeName?: Node[];
+ options?: Node[];
+}
+export interface RuleStmt {
+ relation?: RangeVar;
+ rulename?: string;
+ whereClause?: Node;
+ event?: CmdType;
+ instead?: boolean;
+ actions?: Node[];
+ replace?: boolean;
+}
+export interface NotifyStmt {
+ conditionname?: string;
+ payload?: string;
+}
+export interface ListenStmt {
+ conditionname?: string;
+}
+export interface UnlistenStmt {
+ conditionname?: string;
+}
+export interface TransactionStmt {
+ kind?: TransactionStmtKind;
+ options?: Node[];
+ savepoint_name?: string;
+ gid?: string;
+ chain?: boolean;
+}
+export interface CompositeTypeStmt {
+ typevar?: RangeVar;
+ coldeflist?: Node[];
+}
+export interface CreateEnumStmt {
+ typeName?: Node[];
+ vals?: Node[];
+}
+export interface CreateRangeStmt {
+ typeName?: Node[];
+ params?: Node[];
+}
+export interface AlterEnumStmt {
+ typeName?: Node[];
+ oldVal?: string;
+ newVal?: string;
+ newValNeighbor?: string;
+ newValIsAfter?: boolean;
+ skipIfNewValExists?: boolean;
+}
+export interface ViewStmt {
+ view?: RangeVar;
+ aliases?: Node[];
+ query?: Node;
+ replace?: boolean;
+ options?: Node[];
+ withCheckOption?: ViewCheckOption;
+}
+export interface LoadStmt {
+ filename?: string;
+}
+export interface CreatedbStmt {
+ dbname?: string;
+ options?: Node[];
+}
+export interface AlterDatabaseStmt {
+ dbname?: string;
+ options?: Node[];
+}
+export interface AlterDatabaseRefreshCollStmt {
+ dbname?: string;
+}
+export interface AlterDatabaseSetStmt {
+ dbname?: string;
+ setstmt?: VariableSetStmt;
+}
+export interface DropdbStmt {
+ dbname?: string;
+ missing_ok?: boolean;
+ options?: Node[];
+}
+export interface AlterSystemStmt {
+ setstmt?: VariableSetStmt;
+}
+export interface ClusterStmt {
+ relation?: RangeVar;
+ indexname?: string;
+ params?: Node[];
+}
+export interface VacuumStmt {
+ options?: Node[];
+ rels?: Node[];
+ is_vacuumcmd?: boolean;
+}
+export interface VacuumRelation {
+ relation?: RangeVar;
+ oid?: number;
+ va_cols?: Node[];
+}
+export interface ExplainStmt {
+ query?: Node;
+ options?: Node[];
+}
+export interface CreateTableAsStmt {
+ query?: Node;
+ into?: IntoClause;
+ objtype?: ObjectType;
+ is_select_into?: boolean;
+ if_not_exists?: boolean;
+}
+export interface RefreshMatViewStmt {
+ concurrent?: boolean;
+ skipData?: boolean;
+ relation?: RangeVar;
+}
+export interface CheckPointStmt {}
+export interface DiscardStmt {
+ target?: DiscardMode;
+}
+export interface LockStmt {
+ relations?: Node[];
+ mode?: number;
+ nowait?: boolean;
+}
+export interface ConstraintsSetStmt {
+ constraints?: Node[];
+ deferred?: boolean;
+}
+export interface ReindexStmt {
+ kind?: ReindexObjectType;
+ relation?: RangeVar;
+ name?: string;
+ params?: Node[];
+}
+export interface CreateConversionStmt {
+ conversion_name?: Node[];
+ for_encoding_name?: string;
+ to_encoding_name?: string;
+ func_name?: Node[];
+ def?: boolean;
+}
+export interface CreateCastStmt {
+ sourcetype?: TypeName;
+ targettype?: TypeName;
+ func?: ObjectWithArgs;
+ context?: CoercionContext;
+ inout?: boolean;
+}
+export interface CreateTransformStmt {
+ replace?: boolean;
+ type_name?: TypeName;
+ lang?: string;
+ fromsql?: ObjectWithArgs;
+ tosql?: ObjectWithArgs;
+}
+export interface PrepareStmt {
+ name?: string;
+ argtypes?: Node[];
+ query?: Node;
+}
+export interface ExecuteStmt {
+ name?: string;
+ params?: Node[];
+}
+export interface DeallocateStmt {
+ name?: string;
+}
+export interface DropOwnedStmt {
+ roles?: Node[];
+ behavior?: DropBehavior;
+}
+export interface ReassignOwnedStmt {
+ roles?: Node[];
+ newrole?: RoleSpec;
+}
+export interface AlterTSDictionaryStmt {
+ dictname?: Node[];
+ options?: Node[];
+}
+export interface AlterTSConfigurationStmt {
+ kind?: AlterTSConfigType;
+ cfgname?: Node[];
+ tokentype?: Node[];
+ dicts?: Node[];
+ override?: boolean;
+ replace?: boolean;
+ missing_ok?: boolean;
+}
+export interface PublicationTable {
+ relation?: RangeVar;
+ whereClause?: Node;
+ columns?: Node[];
+}
+export interface PublicationObjSpec {
+ pubobjtype?: PublicationObjSpecType;
+ name?: string;
+ pubtable?: PublicationTable;
+ location?: number;
+}
+export interface CreatePublicationStmt {
+ pubname?: string;
+ options?: Node[];
+ pubobjects?: Node[];
+ for_all_tables?: boolean;
+}
+export interface AlterPublicationStmt {
+ pubname?: string;
+ options?: Node[];
+ pubobjects?: Node[];
+ for_all_tables?: boolean;
+ action?: AlterPublicationAction;
+}
+export interface CreateSubscriptionStmt {
+ subname?: string;
+ conninfo?: string;
+ publication?: Node[];
+ options?: Node[];
+}
+export interface AlterSubscriptionStmt {
+ kind?: AlterSubscriptionType;
+ subname?: string;
+ conninfo?: string;
+ publication?: Node[];
+ options?: Node[];
+}
+export interface DropSubscriptionStmt {
+ subname?: string;
+ missing_ok?: boolean;
+ behavior?: DropBehavior;
+}
+export interface ScanToken {
+ start?: number;
+ end?: number;
+ token?: Token;
+ keywordKind?: KeywordKind;
+}
\ No newline at end of file
diff --git a/types/16/tsconfig.esm.json b/types/16/tsconfig.esm.json
new file mode 100644
index 00000000..800d7506
--- /dev/null
+++ b/types/16/tsconfig.esm.json
@@ -0,0 +1,9 @@
+{
+ "extends": "./tsconfig.json",
+ "compilerOptions": {
+ "outDir": "dist/esm",
+ "module": "es2022",
+ "rootDir": "src/",
+ "declaration": false
+ }
+}
diff --git a/types/16/tsconfig.json b/types/16/tsconfig.json
new file mode 100644
index 00000000..1a9d5696
--- /dev/null
+++ b/types/16/tsconfig.json
@@ -0,0 +1,9 @@
+{
+ "extends": "../../tsconfig.json",
+ "compilerOptions": {
+ "outDir": "dist",
+ "rootDir": "src/"
+ },
+ "include": ["src/**/*.ts"],
+ "exclude": ["dist", "node_modules", "**/*.spec.*", "**/*.test.*"]
+}
diff --git a/types/17/CHANGELOG.md b/types/17/CHANGELOG.md
new file mode 100644
index 00000000..a96e990c
--- /dev/null
+++ b/types/17/CHANGELOG.md
@@ -0,0 +1,40 @@
+# Change Log
+
+All notable changes to this project will be documented in this file.
+See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [17.4.2](https://github.com/launchql/pgsql-parser/compare/@pgsql/types@17.4.1...@pgsql/types@17.4.2) (2025-06-22)
+
+**Note:** Version bump only for package @pgsql/types
+
+
+
+
+
+## [17.4.1](https://github.com/launchql/pgsql-parser/compare/@pgsql/types@17.4.0...@pgsql/types@17.4.1) (2025-06-21)
+
+**Note:** Version bump only for package @pgsql/types
+
+
+
+
+
+# [17.4.0](https://github.com/launchql/pgsql-parser/compare/@pgsql/types@17.1.0...@pgsql/types@17.4.0) (2025-06-21)
+
+**Note:** Version bump only for package @pgsql/types
+
+
+
+
+
+# [17.2.0](https://github.com/launchql/pgsql-parser/compare/@pgsql/types@17.1.0...@pgsql/types@17.2.0) (2025-06-21)
+
+**Note:** Version bump only for package @pgsql/types
+
+
+
+
+
+# [17.1.0](https://github.com/launchql/pgsql-parser/compare/@pgsql/types@13.9.0...@pgsql/types@17.1.0) (2025-06-21)
+
+**Note:** Version bump only for package @pgsql/types
diff --git a/types/17/README.md b/types/17/README.md
new file mode 100644
index 00000000..81c50431
--- /dev/null
+++ b/types/17/README.md
@@ -0,0 +1,99 @@
+# @pgsql/types
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+`@pgsql/types` is a TypeScript library providing type definitions for PostgreSQL AST nodes, primarily used in conjunction with [`pgsql-parser`](https://github.com/launchql/pgsql-parser). It offers a comprehensive and type-safe way to interact with the AST nodes generated by PostgreSQL query parsing.
+
+
+## Installation
+
+Install the package via npm:
+
+```bash
+npm install @pgsql/types
+```
+
+## Usage
+
+`@pgsql/types` provides TypeScript type definitions for PostgreSQL Abstract Syntax Tree (AST) nodes. These types are useful for constructing, analyzing, or manipulating ASTs in a type-safe manner.
+
+Here are a few examples of how you can use these types in your TypeScript projects:
+
+### Validating AST Nodes
+
+You can use the types to validate AST nodes, ensuring they conform to the expected structure:
+
+```ts
+import { CreateStmt } from '@pgsql/types';
+
+function validateCreateStmt(stmt: CreateStmt) {
+ if (!stmt.relation || !stmt.tableElts) {
+ throw new Error('Invalid CreateStmt: missing required fields');
+ }
+ // Add more validation logic as needed
+ console.log('CreateStmt is valid');
+}
+
+// Example usage
+validateCreateStmt(createStmtObject);
+```
+
+### Constructing AST Nodes
+
+Types help ensure that you construct AST nodes correctly:
+
+```ts
+import { CreateStmt, ColumnDef, Constraint } from '@pgsql/types';
+
+const newColumn: ColumnDef = {
+ colname: 'id',
+ typeName: { names: [{ String: { str: 'int4' } }] },
+ constraints: [{ Constraint: { contype: 'CONSTR_PRIMARY' } }],
+};
+
+const createStmt: CreateStmt = {
+ relation: { relname: 'new_table' },
+ tableElts: [newColumn],
+};
+
+console.log(createStmt);
+```
+
+## Versions
+
+Our latest is built with PostgreSQL 17 AST types.
+
+| PG Major Version | libpg_query | npm dist-tag
+|--------------------------|-------------|---------|
+| 17 | 17-6.1.0 | [`pg17`](https://www.npmjs.com/package/@pgsql/types/v/latest)
+| 16 | 16-5.2.0 | [`pg16`](https://www.npmjs.com/package/@pgsql/types/v/pg16)
+| 15 | 15-4.2.4 | [`pg15`](https://www.npmjs.com/package/@pgsql/types/v/pg15)
+| 14 | 14-3.0.0 | [`pg14`](https://www.npmjs.com/package/@pgsql/types/v/pg14)
+| 13 | 13-2.2.0 | [`pg13`](https://www.npmjs.com/package/@pgsql/types/v/pg13)
+
+## Related
+
+* [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.
+* [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`.
+* [@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.
+* [@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.
+* [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.
+* [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.
+
+## Disclaimer
+
+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.
\ No newline at end of file
diff --git a/types/17/jest.config.js b/types/17/jest.config.js
new file mode 100644
index 00000000..0aa3aaa4
--- /dev/null
+++ b/types/17/jest.config.js
@@ -0,0 +1,18 @@
+/** @type {import('ts-jest').JestConfigWithTsJest} */
+module.exports = {
+ preset: "ts-jest",
+ testEnvironment: "node",
+ transform: {
+ "^.+\\.tsx?$": [
+ "ts-jest",
+ {
+ babelConfig: false,
+ tsconfig: "tsconfig.json",
+ },
+ ],
+ },
+ transformIgnorePatterns: [`/node_modules/*`],
+ testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
+ moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
+ modulePathIgnorePatterns: ["dist/*"]
+};
diff --git a/types/17/package.json b/types/17/package.json
new file mode 100644
index 00000000..a826a428
--- /dev/null
+++ b/types/17/package.json
@@ -0,0 +1,39 @@
+{
+ "name": "@libpg-query/types17",
+ "version": "17.5.3",
+ "author": "Dan Lynch ",
+ "description": "PostgreSQL AST types from the real Postgres parser",
+ "main": "index.js",
+ "module": "esm/index.js",
+ "types": "index.d.ts",
+ "homepage": "https://github.com/launchql/libpg-query-node",
+ "license": "SEE LICENSE IN LICENSE",
+ "publishConfig": {
+ "access": "public",
+ "directory": "dist"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/launchql/libpg-query-node"
+ },
+ "bugs": {
+ "url": "https://github.com/launchql/libpg-query-node/issues"
+ },
+ "x-publish": {
+ "publishName": "@pgsql/types",
+ "distTag": "pg17"
+ },
+ "scripts": {
+ "copy": "copyfiles -f ../../LICENSE README.md package.json dist",
+ "clean": "rimraf dist",
+ "build": "pnpm run clean && tsc && tsc -p tsconfig.esm.json && pnpm run copy",
+ "build:dev": "pnpm run clean && tsc --declarationMap && tsc -p tsconfig.esm.json && pnpm run copy",
+ "build:proto": "ts-node scripts/pg-proto-parser",
+ "prepare:types": "node -e \"require('../../scripts/prepare-types.js').preparePackageForPublish('.')\"",
+ "lint": "eslint . --fix"
+ },
+ "keywords": [],
+ "devDependencies": {
+ "pg-proto-parser": "^1.28.2"
+ }
+}
diff --git a/types/17/scripts/pg-proto-parser.ts b/types/17/scripts/pg-proto-parser.ts
new file mode 100644
index 00000000..5e2e0d68
--- /dev/null
+++ b/types/17/scripts/pg-proto-parser.ts
@@ -0,0 +1,20 @@
+import { PgProtoParser, PgProtoParserOptions } from 'pg-proto-parser';
+import { resolve, join } from 'path';
+
+const inFile: string = join(__dirname, '../../../protos/17/pg_query.proto');
+const outDir: string = resolve(join(__dirname, '../src'));
+
+const options: PgProtoParserOptions = {
+ outDir,
+ types: {
+ enabled: true,
+ wrappedNodeTypeExport: true
+ },
+ enums: {
+ enabled: true,
+ enumsAsTypeUnion: true
+ }
+};
+const parser = new PgProtoParser(inFile, options);
+
+parser.write();
diff --git a/types/17/src/enums.ts b/types/17/src/enums.ts
new file mode 100644
index 00000000..0446df6f
--- /dev/null
+++ b/types/17/src/enums.ts
@@ -0,0 +1,76 @@
+/**
+* This file was automatically generated by pg-proto-parser@1.28.2.
+* DO NOT MODIFY IT BY HAND. Instead, modify the source proto file,
+* and run the pg-proto-parser generate command to regenerate this file.
+*/
+export type QuerySource = "QSRC_ORIGINAL" | "QSRC_PARSER" | "QSRC_INSTEAD_RULE" | "QSRC_QUAL_INSTEAD_RULE" | "QSRC_NON_INSTEAD_RULE";
+export type SortByDir = "SORTBY_DEFAULT" | "SORTBY_ASC" | "SORTBY_DESC" | "SORTBY_USING";
+export type SortByNulls = "SORTBY_NULLS_DEFAULT" | "SORTBY_NULLS_FIRST" | "SORTBY_NULLS_LAST";
+export type SetQuantifier = "SET_QUANTIFIER_DEFAULT" | "SET_QUANTIFIER_ALL" | "SET_QUANTIFIER_DISTINCT";
+export type A_Expr_Kind = "AEXPR_OP" | "AEXPR_OP_ANY" | "AEXPR_OP_ALL" | "AEXPR_DISTINCT" | "AEXPR_NOT_DISTINCT" | "AEXPR_NULLIF" | "AEXPR_IN" | "AEXPR_LIKE" | "AEXPR_ILIKE" | "AEXPR_SIMILAR" | "AEXPR_BETWEEN" | "AEXPR_NOT_BETWEEN" | "AEXPR_BETWEEN_SYM" | "AEXPR_NOT_BETWEEN_SYM";
+export type RoleSpecType = "ROLESPEC_CSTRING" | "ROLESPEC_CURRENT_ROLE" | "ROLESPEC_CURRENT_USER" | "ROLESPEC_SESSION_USER" | "ROLESPEC_PUBLIC";
+export type TableLikeOption = "CREATE_TABLE_LIKE_COMMENTS" | "CREATE_TABLE_LIKE_COMPRESSION" | "CREATE_TABLE_LIKE_CONSTRAINTS" | "CREATE_TABLE_LIKE_DEFAULTS" | "CREATE_TABLE_LIKE_GENERATED" | "CREATE_TABLE_LIKE_IDENTITY" | "CREATE_TABLE_LIKE_INDEXES" | "CREATE_TABLE_LIKE_STATISTICS" | "CREATE_TABLE_LIKE_STORAGE" | "CREATE_TABLE_LIKE_ALL";
+export type DefElemAction = "DEFELEM_UNSPEC" | "DEFELEM_SET" | "DEFELEM_ADD" | "DEFELEM_DROP";
+export type PartitionStrategy = "PARTITION_STRATEGY_LIST" | "PARTITION_STRATEGY_RANGE" | "PARTITION_STRATEGY_HASH";
+export type PartitionRangeDatumKind = "PARTITION_RANGE_DATUM_MINVALUE" | "PARTITION_RANGE_DATUM_VALUE" | "PARTITION_RANGE_DATUM_MAXVALUE";
+export type RTEKind = "RTE_RELATION" | "RTE_SUBQUERY" | "RTE_JOIN" | "RTE_FUNCTION" | "RTE_TABLEFUNC" | "RTE_VALUES" | "RTE_CTE" | "RTE_NAMEDTUPLESTORE" | "RTE_RESULT";
+export type WCOKind = "WCO_VIEW_CHECK" | "WCO_RLS_INSERT_CHECK" | "WCO_RLS_UPDATE_CHECK" | "WCO_RLS_CONFLICT_CHECK" | "WCO_RLS_MERGE_UPDATE_CHECK" | "WCO_RLS_MERGE_DELETE_CHECK";
+export type GroupingSetKind = "GROUPING_SET_EMPTY" | "GROUPING_SET_SIMPLE" | "GROUPING_SET_ROLLUP" | "GROUPING_SET_CUBE" | "GROUPING_SET_SETS";
+export type CTEMaterialize = "CTEMaterializeDefault" | "CTEMaterializeAlways" | "CTEMaterializeNever";
+export type JsonQuotes = "JS_QUOTES_UNSPEC" | "JS_QUOTES_KEEP" | "JS_QUOTES_OMIT";
+export type JsonTableColumnType = "JTC_FOR_ORDINALITY" | "JTC_REGULAR" | "JTC_EXISTS" | "JTC_FORMATTED" | "JTC_NESTED";
+export type SetOperation = "SETOP_NONE" | "SETOP_UNION" | "SETOP_INTERSECT" | "SETOP_EXCEPT";
+export type ObjectType = "OBJECT_ACCESS_METHOD" | "OBJECT_AGGREGATE" | "OBJECT_AMOP" | "OBJECT_AMPROC" | "OBJECT_ATTRIBUTE" | "OBJECT_CAST" | "OBJECT_COLUMN" | "OBJECT_COLLATION" | "OBJECT_CONVERSION" | "OBJECT_DATABASE" | "OBJECT_DEFAULT" | "OBJECT_DEFACL" | "OBJECT_DOMAIN" | "OBJECT_DOMCONSTRAINT" | "OBJECT_EVENT_TRIGGER" | "OBJECT_EXTENSION" | "OBJECT_FDW" | "OBJECT_FOREIGN_SERVER" | "OBJECT_FOREIGN_TABLE" | "OBJECT_FUNCTION" | "OBJECT_INDEX" | "OBJECT_LANGUAGE" | "OBJECT_LARGEOBJECT" | "OBJECT_MATVIEW" | "OBJECT_OPCLASS" | "OBJECT_OPERATOR" | "OBJECT_OPFAMILY" | "OBJECT_PARAMETER_ACL" | "OBJECT_POLICY" | "OBJECT_PROCEDURE" | "OBJECT_PUBLICATION" | "OBJECT_PUBLICATION_NAMESPACE" | "OBJECT_PUBLICATION_REL" | "OBJECT_ROLE" | "OBJECT_ROUTINE" | "OBJECT_RULE" | "OBJECT_SCHEMA" | "OBJECT_SEQUENCE" | "OBJECT_SUBSCRIPTION" | "OBJECT_STATISTIC_EXT" | "OBJECT_TABCONSTRAINT" | "OBJECT_TABLE" | "OBJECT_TABLESPACE" | "OBJECT_TRANSFORM" | "OBJECT_TRIGGER" | "OBJECT_TSCONFIGURATION" | "OBJECT_TSDICTIONARY" | "OBJECT_TSPARSER" | "OBJECT_TSTEMPLATE" | "OBJECT_TYPE" | "OBJECT_USER_MAPPING" | "OBJECT_VIEW";
+export type DropBehavior = "DROP_RESTRICT" | "DROP_CASCADE";
+export type AlterTableType = "AT_AddColumn" | "AT_AddColumnToView" | "AT_ColumnDefault" | "AT_CookedColumnDefault" | "AT_DropNotNull" | "AT_SetNotNull" | "AT_SetExpression" | "AT_DropExpression" | "AT_CheckNotNull" | "AT_SetStatistics" | "AT_SetOptions" | "AT_ResetOptions" | "AT_SetStorage" | "AT_SetCompression" | "AT_DropColumn" | "AT_AddIndex" | "AT_ReAddIndex" | "AT_AddConstraint" | "AT_ReAddConstraint" | "AT_ReAddDomainConstraint" | "AT_AlterConstraint" | "AT_ValidateConstraint" | "AT_AddIndexConstraint" | "AT_DropConstraint" | "AT_ReAddComment" | "AT_AlterColumnType" | "AT_AlterColumnGenericOptions" | "AT_ChangeOwner" | "AT_ClusterOn" | "AT_DropCluster" | "AT_SetLogged" | "AT_SetUnLogged" | "AT_DropOids" | "AT_SetAccessMethod" | "AT_SetTableSpace" | "AT_SetRelOptions" | "AT_ResetRelOptions" | "AT_ReplaceRelOptions" | "AT_EnableTrig" | "AT_EnableAlwaysTrig" | "AT_EnableReplicaTrig" | "AT_DisableTrig" | "AT_EnableTrigAll" | "AT_DisableTrigAll" | "AT_EnableTrigUser" | "AT_DisableTrigUser" | "AT_EnableRule" | "AT_EnableAlwaysRule" | "AT_EnableReplicaRule" | "AT_DisableRule" | "AT_AddInherit" | "AT_DropInherit" | "AT_AddOf" | "AT_DropOf" | "AT_ReplicaIdentity" | "AT_EnableRowSecurity" | "AT_DisableRowSecurity" | "AT_ForceRowSecurity" | "AT_NoForceRowSecurity" | "AT_GenericOptions" | "AT_AttachPartition" | "AT_DetachPartition" | "AT_DetachPartitionFinalize" | "AT_AddIdentity" | "AT_SetIdentity" | "AT_DropIdentity" | "AT_ReAddStatistics";
+export type GrantTargetType = "ACL_TARGET_OBJECT" | "ACL_TARGET_ALL_IN_SCHEMA" | "ACL_TARGET_DEFAULTS";
+export type VariableSetKind = "VAR_SET_VALUE" | "VAR_SET_DEFAULT" | "VAR_SET_CURRENT" | "VAR_SET_MULTI" | "VAR_RESET" | "VAR_RESET_ALL";
+export type ConstrType = "CONSTR_NULL" | "CONSTR_NOTNULL" | "CONSTR_DEFAULT" | "CONSTR_IDENTITY" | "CONSTR_GENERATED" | "CONSTR_CHECK" | "CONSTR_PRIMARY" | "CONSTR_UNIQUE" | "CONSTR_EXCLUSION" | "CONSTR_FOREIGN" | "CONSTR_ATTR_DEFERRABLE" | "CONSTR_ATTR_NOT_DEFERRABLE" | "CONSTR_ATTR_DEFERRED" | "CONSTR_ATTR_IMMEDIATE";
+export type ImportForeignSchemaType = "FDW_IMPORT_SCHEMA_ALL" | "FDW_IMPORT_SCHEMA_LIMIT_TO" | "FDW_IMPORT_SCHEMA_EXCEPT";
+export type RoleStmtType = "ROLESTMT_ROLE" | "ROLESTMT_USER" | "ROLESTMT_GROUP";
+export type FetchDirection = "FETCH_FORWARD" | "FETCH_BACKWARD" | "FETCH_ABSOLUTE" | "FETCH_RELATIVE";
+export type FunctionParameterMode = "FUNC_PARAM_IN" | "FUNC_PARAM_OUT" | "FUNC_PARAM_INOUT" | "FUNC_PARAM_VARIADIC" | "FUNC_PARAM_TABLE" | "FUNC_PARAM_DEFAULT";
+export type TransactionStmtKind = "TRANS_STMT_BEGIN" | "TRANS_STMT_START" | "TRANS_STMT_COMMIT" | "TRANS_STMT_ROLLBACK" | "TRANS_STMT_SAVEPOINT" | "TRANS_STMT_RELEASE" | "TRANS_STMT_ROLLBACK_TO" | "TRANS_STMT_PREPARE" | "TRANS_STMT_COMMIT_PREPARED" | "TRANS_STMT_ROLLBACK_PREPARED";
+export type ViewCheckOption = "NO_CHECK_OPTION" | "LOCAL_CHECK_OPTION" | "CASCADED_CHECK_OPTION";
+export type DiscardMode = "DISCARD_ALL" | "DISCARD_PLANS" | "DISCARD_SEQUENCES" | "DISCARD_TEMP";
+export type ReindexObjectType = "REINDEX_OBJECT_INDEX" | "REINDEX_OBJECT_TABLE" | "REINDEX_OBJECT_SCHEMA" | "REINDEX_OBJECT_SYSTEM" | "REINDEX_OBJECT_DATABASE";
+export type AlterTSConfigType = "ALTER_TSCONFIG_ADD_MAPPING" | "ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN" | "ALTER_TSCONFIG_REPLACE_DICT" | "ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN" | "ALTER_TSCONFIG_DROP_MAPPING";
+export type PublicationObjSpecType = "PUBLICATIONOBJ_TABLE" | "PUBLICATIONOBJ_TABLES_IN_SCHEMA" | "PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA" | "PUBLICATIONOBJ_CONTINUATION";
+export type AlterPublicationAction = "AP_AddObjects" | "AP_DropObjects" | "AP_SetObjects";
+export type AlterSubscriptionType = "ALTER_SUBSCRIPTION_OPTIONS" | "ALTER_SUBSCRIPTION_CONNECTION" | "ALTER_SUBSCRIPTION_SET_PUBLICATION" | "ALTER_SUBSCRIPTION_ADD_PUBLICATION" | "ALTER_SUBSCRIPTION_DROP_PUBLICATION" | "ALTER_SUBSCRIPTION_REFRESH" | "ALTER_SUBSCRIPTION_ENABLED" | "ALTER_SUBSCRIPTION_SKIP";
+export type OverridingKind = "OVERRIDING_NOT_SET" | "OVERRIDING_USER_VALUE" | "OVERRIDING_SYSTEM_VALUE";
+export type OnCommitAction = "ONCOMMIT_NOOP" | "ONCOMMIT_PRESERVE_ROWS" | "ONCOMMIT_DELETE_ROWS" | "ONCOMMIT_DROP";
+export type TableFuncType = "TFT_XMLTABLE" | "TFT_JSON_TABLE";
+export type ParamKind = "PARAM_EXTERN" | "PARAM_EXEC" | "PARAM_SUBLINK" | "PARAM_MULTIEXPR";
+export type CoercionContext = "COERCION_IMPLICIT" | "COERCION_ASSIGNMENT" | "COERCION_PLPGSQL" | "COERCION_EXPLICIT";
+export type CoercionForm = "COERCE_EXPLICIT_CALL" | "COERCE_EXPLICIT_CAST" | "COERCE_IMPLICIT_CAST" | "COERCE_SQL_SYNTAX";
+export type BoolExprType = "AND_EXPR" | "OR_EXPR" | "NOT_EXPR";
+export type SubLinkType = "EXISTS_SUBLINK" | "ALL_SUBLINK" | "ANY_SUBLINK" | "ROWCOMPARE_SUBLINK" | "EXPR_SUBLINK" | "MULTIEXPR_SUBLINK" | "ARRAY_SUBLINK" | "CTE_SUBLINK";
+export type RowCompareType = "ROWCOMPARE_LT" | "ROWCOMPARE_LE" | "ROWCOMPARE_EQ" | "ROWCOMPARE_GE" | "ROWCOMPARE_GT" | "ROWCOMPARE_NE";
+export type MinMaxOp = "IS_GREATEST" | "IS_LEAST";
+export type SQLValueFunctionOp = "SVFOP_CURRENT_DATE" | "SVFOP_CURRENT_TIME" | "SVFOP_CURRENT_TIME_N" | "SVFOP_CURRENT_TIMESTAMP" | "SVFOP_CURRENT_TIMESTAMP_N" | "SVFOP_LOCALTIME" | "SVFOP_LOCALTIME_N" | "SVFOP_LOCALTIMESTAMP" | "SVFOP_LOCALTIMESTAMP_N" | "SVFOP_CURRENT_ROLE" | "SVFOP_CURRENT_USER" | "SVFOP_USER" | "SVFOP_SESSION_USER" | "SVFOP_CURRENT_CATALOG" | "SVFOP_CURRENT_SCHEMA";
+export type XmlExprOp = "IS_XMLCONCAT" | "IS_XMLELEMENT" | "IS_XMLFOREST" | "IS_XMLPARSE" | "IS_XMLPI" | "IS_XMLROOT" | "IS_XMLSERIALIZE" | "IS_DOCUMENT";
+export type XmlOptionType = "XMLOPTION_DOCUMENT" | "XMLOPTION_CONTENT";
+export type JsonEncoding = "JS_ENC_DEFAULT" | "JS_ENC_UTF8" | "JS_ENC_UTF16" | "JS_ENC_UTF32";
+export type JsonFormatType = "JS_FORMAT_DEFAULT" | "JS_FORMAT_JSON" | "JS_FORMAT_JSONB";
+export type JsonConstructorType = "JSCTOR_JSON_OBJECT" | "JSCTOR_JSON_ARRAY" | "JSCTOR_JSON_OBJECTAGG" | "JSCTOR_JSON_ARRAYAGG" | "JSCTOR_JSON_PARSE" | "JSCTOR_JSON_SCALAR" | "JSCTOR_JSON_SERIALIZE";
+export type JsonValueType = "JS_TYPE_ANY" | "JS_TYPE_OBJECT" | "JS_TYPE_ARRAY" | "JS_TYPE_SCALAR";
+export type JsonWrapper = "JSW_UNSPEC" | "JSW_NONE" | "JSW_CONDITIONAL" | "JSW_UNCONDITIONAL";
+export type JsonBehaviorType = "JSON_BEHAVIOR_NULL" | "JSON_BEHAVIOR_ERROR" | "JSON_BEHAVIOR_EMPTY" | "JSON_BEHAVIOR_TRUE" | "JSON_BEHAVIOR_FALSE" | "JSON_BEHAVIOR_UNKNOWN" | "JSON_BEHAVIOR_EMPTY_ARRAY" | "JSON_BEHAVIOR_EMPTY_OBJECT" | "JSON_BEHAVIOR_DEFAULT";
+export type JsonExprOp = "JSON_EXISTS_OP" | "JSON_QUERY_OP" | "JSON_VALUE_OP" | "JSON_TABLE_OP";
+export type NullTestType = "IS_NULL" | "IS_NOT_NULL";
+export type BoolTestType = "IS_TRUE" | "IS_NOT_TRUE" | "IS_FALSE" | "IS_NOT_FALSE" | "IS_UNKNOWN" | "IS_NOT_UNKNOWN";
+export type MergeMatchKind = "MERGE_WHEN_MATCHED" | "MERGE_WHEN_NOT_MATCHED_BY_SOURCE" | "MERGE_WHEN_NOT_MATCHED_BY_TARGET";
+export type CmdType = "CMD_UNKNOWN" | "CMD_SELECT" | "CMD_UPDATE" | "CMD_INSERT" | "CMD_DELETE" | "CMD_MERGE" | "CMD_UTILITY" | "CMD_NOTHING";
+export type JoinType = "JOIN_INNER" | "JOIN_LEFT" | "JOIN_FULL" | "JOIN_RIGHT" | "JOIN_SEMI" | "JOIN_ANTI" | "JOIN_RIGHT_ANTI" | "JOIN_UNIQUE_OUTER" | "JOIN_UNIQUE_INNER";
+export type AggStrategy = "AGG_PLAIN" | "AGG_SORTED" | "AGG_HASHED" | "AGG_MIXED";
+export type AggSplit = "AGGSPLIT_SIMPLE" | "AGGSPLIT_INITIAL_SERIAL" | "AGGSPLIT_FINAL_DESERIAL";
+export type SetOpCmd = "SETOPCMD_INTERSECT" | "SETOPCMD_INTERSECT_ALL" | "SETOPCMD_EXCEPT" | "SETOPCMD_EXCEPT_ALL";
+export type SetOpStrategy = "SETOP_SORTED" | "SETOP_HASHED";
+export type OnConflictAction = "ONCONFLICT_NONE" | "ONCONFLICT_NOTHING" | "ONCONFLICT_UPDATE";
+export type LimitOption = "LIMIT_OPTION_DEFAULT" | "LIMIT_OPTION_COUNT" | "LIMIT_OPTION_WITH_TIES";
+export type LockClauseStrength = "LCS_NONE" | "LCS_FORKEYSHARE" | "LCS_FORSHARE" | "LCS_FORNOKEYUPDATE" | "LCS_FORUPDATE";
+export type LockWaitPolicy = "LockWaitBlock" | "LockWaitSkip" | "LockWaitError";
+export type LockTupleMode = "LockTupleKeyShare" | "LockTupleShare" | "LockTupleNoKeyExclusive" | "LockTupleExclusive";
+export type KeywordKind = "NO_KEYWORD" | "UNRESERVED_KEYWORD" | "COL_NAME_KEYWORD" | "TYPE_FUNC_NAME_KEYWORD" | "RESERVED_KEYWORD";
+export type Token = "NUL" | "ASCII_36" | "ASCII_37" | "ASCII_40" | "ASCII_41" | "ASCII_42" | "ASCII_43" | "ASCII_44" | "ASCII_45" | "ASCII_46" | "ASCII_47" | "ASCII_58" | "ASCII_59" | "ASCII_60" | "ASCII_61" | "ASCII_62" | "ASCII_63" | "ASCII_91" | "ASCII_92" | "ASCII_93" | "ASCII_94" | "IDENT" | "UIDENT" | "FCONST" | "SCONST" | "USCONST" | "BCONST" | "XCONST" | "Op" | "ICONST" | "PARAM" | "TYPECAST" | "DOT_DOT" | "COLON_EQUALS" | "EQUALS_GREATER" | "LESS_EQUALS" | "GREATER_EQUALS" | "NOT_EQUALS" | "SQL_COMMENT" | "C_COMMENT" | "ABORT_P" | "ABSENT" | "ABSOLUTE_P" | "ACCESS" | "ACTION" | "ADD_P" | "ADMIN" | "AFTER" | "AGGREGATE" | "ALL" | "ALSO" | "ALTER" | "ALWAYS" | "ANALYSE" | "ANALYZE" | "AND" | "ANY" | "ARRAY" | "AS" | "ASC" | "ASENSITIVE" | "ASSERTION" | "ASSIGNMENT" | "ASYMMETRIC" | "ATOMIC" | "AT" | "ATTACH" | "ATTRIBUTE" | "AUTHORIZATION" | "BACKWARD" | "BEFORE" | "BEGIN_P" | "BETWEEN" | "BIGINT" | "BINARY" | "BIT" | "BOOLEAN_P" | "BOTH" | "BREADTH" | "BY" | "CACHE" | "CALL" | "CALLED" | "CASCADE" | "CASCADED" | "CASE" | "CAST" | "CATALOG_P" | "CHAIN" | "CHAR_P" | "CHARACTER" | "CHARACTERISTICS" | "CHECK" | "CHECKPOINT" | "CLASS" | "CLOSE" | "CLUSTER" | "COALESCE" | "COLLATE" | "COLLATION" | "COLUMN" | "COLUMNS" | "COMMENT" | "COMMENTS" | "COMMIT" | "COMMITTED" | "COMPRESSION" | "CONCURRENTLY" | "CONDITIONAL" | "CONFIGURATION" | "CONFLICT" | "CONNECTION" | "CONSTRAINT" | "CONSTRAINTS" | "CONTENT_P" | "CONTINUE_P" | "CONVERSION_P" | "COPY" | "COST" | "CREATE" | "CROSS" | "CSV" | "CUBE" | "CURRENT_P" | "CURRENT_CATALOG" | "CURRENT_DATE" | "CURRENT_ROLE" | "CURRENT_SCHEMA" | "CURRENT_TIME" | "CURRENT_TIMESTAMP" | "CURRENT_USER" | "CURSOR" | "CYCLE" | "DATA_P" | "DATABASE" | "DAY_P" | "DEALLOCATE" | "DEC" | "DECIMAL_P" | "DECLARE" | "DEFAULT" | "DEFAULTS" | "DEFERRABLE" | "DEFERRED" | "DEFINER" | "DELETE_P" | "DELIMITER" | "DELIMITERS" | "DEPENDS" | "DEPTH" | "DESC" | "DETACH" | "DICTIONARY" | "DISABLE_P" | "DISCARD" | "DISTINCT" | "DO" | "DOCUMENT_P" | "DOMAIN_P" | "DOUBLE_P" | "DROP" | "EACH" | "ELSE" | "EMPTY_P" | "ENABLE_P" | "ENCODING" | "ENCRYPTED" | "END_P" | "ENUM_P" | "ERROR_P" | "ESCAPE" | "EVENT" | "EXCEPT" | "EXCLUDE" | "EXCLUDING" | "EXCLUSIVE" | "EXECUTE" | "EXISTS" | "EXPLAIN" | "EXPRESSION" | "EXTENSION" | "EXTERNAL" | "EXTRACT" | "FALSE_P" | "FAMILY" | "FETCH" | "FILTER" | "FINALIZE" | "FIRST_P" | "FLOAT_P" | "FOLLOWING" | "FOR" | "FORCE" | "FOREIGN" | "FORMAT" | "FORWARD" | "FREEZE" | "FROM" | "FULL" | "FUNCTION" | "FUNCTIONS" | "GENERATED" | "GLOBAL" | "GRANT" | "GRANTED" | "GREATEST" | "GROUP_P" | "GROUPING" | "GROUPS" | "HANDLER" | "HAVING" | "HEADER_P" | "HOLD" | "HOUR_P" | "IDENTITY_P" | "IF_P" | "ILIKE" | "IMMEDIATE" | "IMMUTABLE" | "IMPLICIT_P" | "IMPORT_P" | "IN_P" | "INCLUDE" | "INCLUDING" | "INCREMENT" | "INDENT" | "INDEX" | "INDEXES" | "INHERIT" | "INHERITS" | "INITIALLY" | "INLINE_P" | "INNER_P" | "INOUT" | "INPUT_P" | "INSENSITIVE" | "INSERT" | "INSTEAD" | "INT_P" | "INTEGER" | "INTERSECT" | "INTERVAL" | "INTO" | "INVOKER" | "IS" | "ISNULL" | "ISOLATION" | "JOIN" | "JSON" | "JSON_ARRAY" | "JSON_ARRAYAGG" | "JSON_EXISTS" | "JSON_OBJECT" | "JSON_OBJECTAGG" | "JSON_QUERY" | "JSON_SCALAR" | "JSON_SERIALIZE" | "JSON_TABLE" | "JSON_VALUE" | "KEEP" | "KEY" | "KEYS" | "LABEL" | "LANGUAGE" | "LARGE_P" | "LAST_P" | "LATERAL_P" | "LEADING" | "LEAKPROOF" | "LEAST" | "LEFT" | "LEVEL" | "LIKE" | "LIMIT" | "LISTEN" | "LOAD" | "LOCAL" | "LOCALTIME" | "LOCALTIMESTAMP" | "LOCATION" | "LOCK_P" | "LOCKED" | "LOGGED" | "MAPPING" | "MATCH" | "MATCHED" | "MATERIALIZED" | "MAXVALUE" | "MERGE" | "MERGE_ACTION" | "METHOD" | "MINUTE_P" | "MINVALUE" | "MODE" | "MONTH_P" | "MOVE" | "NAME_P" | "NAMES" | "NATIONAL" | "NATURAL" | "NCHAR" | "NESTED" | "NEW" | "NEXT" | "NFC" | "NFD" | "NFKC" | "NFKD" | "NO" | "NONE" | "NORMALIZE" | "NORMALIZED" | "NOT" | "NOTHING" | "NOTIFY" | "NOTNULL" | "NOWAIT" | "NULL_P" | "NULLIF" | "NULLS_P" | "NUMERIC" | "OBJECT_P" | "OF" | "OFF" | "OFFSET" | "OIDS" | "OLD" | "OMIT" | "ON" | "ONLY" | "OPERATOR" | "OPTION" | "OPTIONS" | "OR" | "ORDER" | "ORDINALITY" | "OTHERS" | "OUT_P" | "OUTER_P" | "OVER" | "OVERLAPS" | "OVERLAY" | "OVERRIDING" | "OWNED" | "OWNER" | "PARALLEL" | "PARAMETER" | "PARSER" | "PARTIAL" | "PARTITION" | "PASSING" | "PASSWORD" | "PATH" | "PLACING" | "PLAN" | "PLANS" | "POLICY" | "POSITION" | "PRECEDING" | "PRECISION" | "PRESERVE" | "PREPARE" | "PREPARED" | "PRIMARY" | "PRIOR" | "PRIVILEGES" | "PROCEDURAL" | "PROCEDURE" | "PROCEDURES" | "PROGRAM" | "PUBLICATION" | "QUOTE" | "QUOTES" | "RANGE" | "READ" | "REAL" | "REASSIGN" | "RECHECK" | "RECURSIVE" | "REF_P" | "REFERENCES" | "REFERENCING" | "REFRESH" | "REINDEX" | "RELATIVE_P" | "RELEASE" | "RENAME" | "REPEATABLE" | "REPLACE" | "REPLICA" | "RESET" | "RESTART" | "RESTRICT" | "RETURN" | "RETURNING" | "RETURNS" | "REVOKE" | "RIGHT" | "ROLE" | "ROLLBACK" | "ROLLUP" | "ROUTINE" | "ROUTINES" | "ROW" | "ROWS" | "RULE" | "SAVEPOINT" | "SCALAR" | "SCHEMA" | "SCHEMAS" | "SCROLL" | "SEARCH" | "SECOND_P" | "SECURITY" | "SELECT" | "SEQUENCE" | "SEQUENCES" | "SERIALIZABLE" | "SERVER" | "SESSION" | "SESSION_USER" | "SET" | "SETS" | "SETOF" | "SHARE" | "SHOW" | "SIMILAR" | "SIMPLE" | "SKIP" | "SMALLINT" | "SNAPSHOT" | "SOME" | "SOURCE" | "SQL_P" | "STABLE" | "STANDALONE_P" | "START" | "STATEMENT" | "STATISTICS" | "STDIN" | "STDOUT" | "STORAGE" | "STORED" | "STRICT_P" | "STRING_P" | "STRIP_P" | "SUBSCRIPTION" | "SUBSTRING" | "SUPPORT" | "SYMMETRIC" | "SYSID" | "SYSTEM_P" | "SYSTEM_USER" | "TABLE" | "TABLES" | "TABLESAMPLE" | "TABLESPACE" | "TARGET" | "TEMP" | "TEMPLATE" | "TEMPORARY" | "TEXT_P" | "THEN" | "TIES" | "TIME" | "TIMESTAMP" | "TO" | "TRAILING" | "TRANSACTION" | "TRANSFORM" | "TREAT" | "TRIGGER" | "TRIM" | "TRUE_P" | "TRUNCATE" | "TRUSTED" | "TYPE_P" | "TYPES_P" | "UESCAPE" | "UNBOUNDED" | "UNCONDITIONAL" | "UNCOMMITTED" | "UNENCRYPTED" | "UNION" | "UNIQUE" | "UNKNOWN" | "UNLISTEN" | "UNLOGGED" | "UNTIL" | "UPDATE" | "USER" | "USING" | "VACUUM" | "VALID" | "VALIDATE" | "VALIDATOR" | "VALUE_P" | "VALUES" | "VARCHAR" | "VARIADIC" | "VARYING" | "VERBOSE" | "VERSION_P" | "VIEW" | "VIEWS" | "VOLATILE" | "WHEN" | "WHERE" | "WHITESPACE_P" | "WINDOW" | "WITH" | "WITHIN" | "WITHOUT" | "WORK" | "WRAPPER" | "WRITE" | "XML_P" | "XMLATTRIBUTES" | "XMLCONCAT" | "XMLELEMENT" | "XMLEXISTS" | "XMLFOREST" | "XMLNAMESPACES" | "XMLPARSE" | "XMLPI" | "XMLROOT" | "XMLSERIALIZE" | "XMLTABLE" | "YEAR_P" | "YES_P" | "ZONE" | "FORMAT_LA" | "NOT_LA" | "NULLS_LA" | "WITH_LA" | "WITHOUT_LA" | "MODE_TYPE_NAME" | "MODE_PLPGSQL_EXPR" | "MODE_PLPGSQL_ASSIGN1" | "MODE_PLPGSQL_ASSIGN2" | "MODE_PLPGSQL_ASSIGN3" | "UMINUS";
\ No newline at end of file
diff --git a/types/17/src/index.ts b/types/17/src/index.ts
new file mode 100644
index 00000000..dc5ee069
--- /dev/null
+++ b/types/17/src/index.ts
@@ -0,0 +1,2 @@
+export * from './types';
+export * from './enums';
diff --git a/types/17/src/types.ts b/types/17/src/types.ts
new file mode 100644
index 00000000..837af266
--- /dev/null
+++ b/types/17/src/types.ts
@@ -0,0 +1,2485 @@
+/**
+* This file was automatically generated by pg-proto-parser@1.28.2.
+* DO NOT MODIFY IT BY HAND. Instead, modify the source proto file,
+* and run the pg-proto-parser generate command to regenerate this file.
+*/
+import { QuerySource, SortByDir, SortByNulls, SetQuantifier, A_Expr_Kind, RoleSpecType, TableLikeOption, DefElemAction, PartitionStrategy, PartitionRangeDatumKind, RTEKind, WCOKind, GroupingSetKind, CTEMaterialize, JsonQuotes, JsonTableColumnType, SetOperation, ObjectType, DropBehavior, AlterTableType, GrantTargetType, VariableSetKind, ConstrType, ImportForeignSchemaType, RoleStmtType, FetchDirection, FunctionParameterMode, TransactionStmtKind, ViewCheckOption, DiscardMode, ReindexObjectType, AlterTSConfigType, PublicationObjSpecType, AlterPublicationAction, AlterSubscriptionType, OverridingKind, OnCommitAction, TableFuncType, ParamKind, CoercionContext, CoercionForm, BoolExprType, SubLinkType, RowCompareType, MinMaxOp, SQLValueFunctionOp, XmlExprOp, XmlOptionType, JsonEncoding, JsonFormatType, JsonConstructorType, JsonValueType, JsonWrapper, JsonBehaviorType, JsonExprOp, NullTestType, BoolTestType, MergeMatchKind, CmdType, JoinType, AggStrategy, AggSplit, SetOpCmd, SetOpStrategy, OnConflictAction, LimitOption, LockClauseStrength, LockWaitPolicy, LockTupleMode, KeywordKind, Token } from "./enums";
+export type Node = {
+ ParseResult: ParseResult;
+} | {
+ ScanResult: ScanResult;
+} | {
+ Integer: Integer;
+} | {
+ Float: Float;
+} | {
+ Boolean: Boolean;
+} | {
+ String: String;
+} | {
+ BitString: BitString;
+} | {
+ List: List;
+} | {
+ OidList: OidList;
+} | {
+ IntList: IntList;
+} | {
+ A_Const: A_Const;
+} | {
+ Alias: Alias;
+} | {
+ RangeVar: RangeVar;
+} | {
+ TableFunc: TableFunc;
+} | {
+ IntoClause: IntoClause;
+} | {
+ Var: Var;
+} | {
+ Param: Param;
+} | {
+ Aggref: Aggref;
+} | {
+ GroupingFunc: GroupingFunc;
+} | {
+ WindowFunc: WindowFunc;
+} | {
+ WindowFuncRunCondition: WindowFuncRunCondition;
+} | {
+ MergeSupportFunc: MergeSupportFunc;
+} | {
+ SubscriptingRef: SubscriptingRef;
+} | {
+ FuncExpr: FuncExpr;
+} | {
+ NamedArgExpr: NamedArgExpr;
+} | {
+ OpExpr: OpExpr;
+} | {
+ DistinctExpr: DistinctExpr;
+} | {
+ NullIfExpr: NullIfExpr;
+} | {
+ ScalarArrayOpExpr: ScalarArrayOpExpr;
+} | {
+ BoolExpr: BoolExpr;
+} | {
+ SubLink: SubLink;
+} | {
+ SubPlan: SubPlan;
+} | {
+ AlternativeSubPlan: AlternativeSubPlan;
+} | {
+ FieldSelect: FieldSelect;
+} | {
+ FieldStore: FieldStore;
+} | {
+ RelabelType: RelabelType;
+} | {
+ CoerceViaIO: CoerceViaIO;
+} | {
+ ArrayCoerceExpr: ArrayCoerceExpr;
+} | {
+ ConvertRowtypeExpr: ConvertRowtypeExpr;
+} | {
+ CollateExpr: CollateExpr;
+} | {
+ CaseExpr: CaseExpr;
+} | {
+ CaseWhen: CaseWhen;
+} | {
+ CaseTestExpr: CaseTestExpr;
+} | {
+ ArrayExpr: ArrayExpr;
+} | {
+ RowExpr: RowExpr;
+} | {
+ RowCompareExpr: RowCompareExpr;
+} | {
+ CoalesceExpr: CoalesceExpr;
+} | {
+ MinMaxExpr: MinMaxExpr;
+} | {
+ SQLValueFunction: SQLValueFunction;
+} | {
+ XmlExpr: XmlExpr;
+} | {
+ JsonFormat: JsonFormat;
+} | {
+ JsonReturning: JsonReturning;
+} | {
+ JsonValueExpr: JsonValueExpr;
+} | {
+ JsonConstructorExpr: JsonConstructorExpr;
+} | {
+ JsonIsPredicate: JsonIsPredicate;
+} | {
+ JsonBehavior: JsonBehavior;
+} | {
+ JsonExpr: JsonExpr;
+} | {
+ JsonTablePath: JsonTablePath;
+} | {
+ JsonTablePathScan: JsonTablePathScan;
+} | {
+ JsonTableSiblingJoin: JsonTableSiblingJoin;
+} | {
+ NullTest: NullTest;
+} | {
+ BooleanTest: BooleanTest;
+} | {
+ MergeAction: MergeAction;
+} | {
+ CoerceToDomain: CoerceToDomain;
+} | {
+ CoerceToDomainValue: CoerceToDomainValue;
+} | {
+ SetToDefault: SetToDefault;
+} | {
+ CurrentOfExpr: CurrentOfExpr;
+} | {
+ NextValueExpr: NextValueExpr;
+} | {
+ InferenceElem: InferenceElem;
+} | {
+ TargetEntry: TargetEntry;
+} | {
+ RangeTblRef: RangeTblRef;
+} | {
+ JoinExpr: JoinExpr;
+} | {
+ FromExpr: FromExpr;
+} | {
+ OnConflictExpr: OnConflictExpr;
+} | {
+ Query: Query;
+} | {
+ TypeName: TypeName;
+} | {
+ ColumnRef: ColumnRef;
+} | {
+ ParamRef: ParamRef;
+} | {
+ A_Expr: A_Expr;
+} | {
+ TypeCast: TypeCast;
+} | {
+ CollateClause: CollateClause;
+} | {
+ RoleSpec: RoleSpec;
+} | {
+ FuncCall: FuncCall;
+} | {
+ A_Star: A_Star;
+} | {
+ A_Indices: A_Indices;
+} | {
+ A_Indirection: A_Indirection;
+} | {
+ A_ArrayExpr: A_ArrayExpr;
+} | {
+ ResTarget: ResTarget;
+} | {
+ MultiAssignRef: MultiAssignRef;
+} | {
+ SortBy: SortBy;
+} | {
+ WindowDef: WindowDef;
+} | {
+ RangeSubselect: RangeSubselect;
+} | {
+ RangeFunction: RangeFunction;
+} | {
+ RangeTableFunc: RangeTableFunc;
+} | {
+ RangeTableFuncCol: RangeTableFuncCol;
+} | {
+ RangeTableSample: RangeTableSample;
+} | {
+ ColumnDef: ColumnDef;
+} | {
+ TableLikeClause: TableLikeClause;
+} | {
+ IndexElem: IndexElem;
+} | {
+ DefElem: DefElem;
+} | {
+ LockingClause: LockingClause;
+} | {
+ XmlSerialize: XmlSerialize;
+} | {
+ PartitionElem: PartitionElem;
+} | {
+ PartitionSpec: PartitionSpec;
+} | {
+ PartitionBoundSpec: PartitionBoundSpec;
+} | {
+ PartitionRangeDatum: PartitionRangeDatum;
+} | {
+ SinglePartitionSpec: SinglePartitionSpec;
+} | {
+ PartitionCmd: PartitionCmd;
+} | {
+ RangeTblEntry: RangeTblEntry;
+} | {
+ RTEPermissionInfo: RTEPermissionInfo;
+} | {
+ RangeTblFunction: RangeTblFunction;
+} | {
+ TableSampleClause: TableSampleClause;
+} | {
+ WithCheckOption: WithCheckOption;
+} | {
+ SortGroupClause: SortGroupClause;
+} | {
+ GroupingSet: GroupingSet;
+} | {
+ WindowClause: WindowClause;
+} | {
+ RowMarkClause: RowMarkClause;
+} | {
+ WithClause: WithClause;
+} | {
+ InferClause: InferClause;
+} | {
+ OnConflictClause: OnConflictClause;
+} | {
+ CTESearchClause: CTESearchClause;
+} | {
+ CTECycleClause: CTECycleClause;
+} | {
+ CommonTableExpr: CommonTableExpr;
+} | {
+ MergeWhenClause: MergeWhenClause;
+} | {
+ TriggerTransition: TriggerTransition;
+} | {
+ JsonOutput: JsonOutput;
+} | {
+ JsonArgument: JsonArgument;
+} | {
+ JsonFuncExpr: JsonFuncExpr;
+} | {
+ JsonTablePathSpec: JsonTablePathSpec;
+} | {
+ JsonTable: JsonTable;
+} | {
+ JsonTableColumn: JsonTableColumn;
+} | {
+ JsonKeyValue: JsonKeyValue;
+} | {
+ JsonParseExpr: JsonParseExpr;
+} | {
+ JsonScalarExpr: JsonScalarExpr;
+} | {
+ JsonSerializeExpr: JsonSerializeExpr;
+} | {
+ JsonObjectConstructor: JsonObjectConstructor;
+} | {
+ JsonArrayConstructor: JsonArrayConstructor;
+} | {
+ JsonArrayQueryConstructor: JsonArrayQueryConstructor;
+} | {
+ JsonAggConstructor: JsonAggConstructor;
+} | {
+ JsonObjectAgg: JsonObjectAgg;
+} | {
+ JsonArrayAgg: JsonArrayAgg;
+} | {
+ RawStmt: RawStmt;
+} | {
+ InsertStmt: InsertStmt;
+} | {
+ DeleteStmt: DeleteStmt;
+} | {
+ UpdateStmt: UpdateStmt;
+} | {
+ MergeStmt: MergeStmt;
+} | {
+ SelectStmt: SelectStmt;
+} | {
+ SetOperationStmt: SetOperationStmt;
+} | {
+ ReturnStmt: ReturnStmt;
+} | {
+ PLAssignStmt: PLAssignStmt;
+} | {
+ CreateSchemaStmt: CreateSchemaStmt;
+} | {
+ AlterTableStmt: AlterTableStmt;
+} | {
+ ReplicaIdentityStmt: ReplicaIdentityStmt;
+} | {
+ AlterTableCmd: AlterTableCmd;
+} | {
+ AlterCollationStmt: AlterCollationStmt;
+} | {
+ AlterDomainStmt: AlterDomainStmt;
+} | {
+ GrantStmt: GrantStmt;
+} | {
+ ObjectWithArgs: ObjectWithArgs;
+} | {
+ AccessPriv: AccessPriv;
+} | {
+ GrantRoleStmt: GrantRoleStmt;
+} | {
+ AlterDefaultPrivilegesStmt: AlterDefaultPrivilegesStmt;
+} | {
+ CopyStmt: CopyStmt;
+} | {
+ VariableSetStmt: VariableSetStmt;
+} | {
+ VariableShowStmt: VariableShowStmt;
+} | {
+ CreateStmt: CreateStmt;
+} | {
+ Constraint: Constraint;
+} | {
+ CreateTableSpaceStmt: CreateTableSpaceStmt;
+} | {
+ DropTableSpaceStmt: DropTableSpaceStmt;
+} | {
+ AlterTableSpaceOptionsStmt: AlterTableSpaceOptionsStmt;
+} | {
+ AlterTableMoveAllStmt: AlterTableMoveAllStmt;
+} | {
+ CreateExtensionStmt: CreateExtensionStmt;
+} | {
+ AlterExtensionStmt: AlterExtensionStmt;
+} | {
+ AlterExtensionContentsStmt: AlterExtensionContentsStmt;
+} | {
+ CreateFdwStmt: CreateFdwStmt;
+} | {
+ AlterFdwStmt: AlterFdwStmt;
+} | {
+ CreateForeignServerStmt: CreateForeignServerStmt;
+} | {
+ AlterForeignServerStmt: AlterForeignServerStmt;
+} | {
+ CreateForeignTableStmt: CreateForeignTableStmt;
+} | {
+ CreateUserMappingStmt: CreateUserMappingStmt;
+} | {
+ AlterUserMappingStmt: AlterUserMappingStmt;
+} | {
+ DropUserMappingStmt: DropUserMappingStmt;
+} | {
+ ImportForeignSchemaStmt: ImportForeignSchemaStmt;
+} | {
+ CreatePolicyStmt: CreatePolicyStmt;
+} | {
+ AlterPolicyStmt: AlterPolicyStmt;
+} | {
+ CreateAmStmt: CreateAmStmt;
+} | {
+ CreateTrigStmt: CreateTrigStmt;
+} | {
+ CreateEventTrigStmt: CreateEventTrigStmt;
+} | {
+ AlterEventTrigStmt: AlterEventTrigStmt;
+} | {
+ CreatePLangStmt: CreatePLangStmt;
+} | {
+ CreateRoleStmt: CreateRoleStmt;
+} | {
+ AlterRoleStmt: AlterRoleStmt;
+} | {
+ AlterRoleSetStmt: AlterRoleSetStmt;
+} | {
+ DropRoleStmt: DropRoleStmt;
+} | {
+ CreateSeqStmt: CreateSeqStmt;
+} | {
+ AlterSeqStmt: AlterSeqStmt;
+} | {
+ DefineStmt: DefineStmt;
+} | {
+ CreateDomainStmt: CreateDomainStmt;
+} | {
+ CreateOpClassStmt: CreateOpClassStmt;
+} | {
+ CreateOpClassItem: CreateOpClassItem;
+} | {
+ CreateOpFamilyStmt: CreateOpFamilyStmt;
+} | {
+ AlterOpFamilyStmt: AlterOpFamilyStmt;
+} | {
+ DropStmt: DropStmt;
+} | {
+ TruncateStmt: TruncateStmt;
+} | {
+ CommentStmt: CommentStmt;
+} | {
+ SecLabelStmt: SecLabelStmt;
+} | {
+ DeclareCursorStmt: DeclareCursorStmt;
+} | {
+ ClosePortalStmt: ClosePortalStmt;
+} | {
+ FetchStmt: FetchStmt;
+} | {
+ IndexStmt: IndexStmt;
+} | {
+ CreateStatsStmt: CreateStatsStmt;
+} | {
+ StatsElem: StatsElem;
+} | {
+ AlterStatsStmt: AlterStatsStmt;
+} | {
+ CreateFunctionStmt: CreateFunctionStmt;
+} | {
+ FunctionParameter: FunctionParameter;
+} | {
+ AlterFunctionStmt: AlterFunctionStmt;
+} | {
+ DoStmt: DoStmt;
+} | {
+ InlineCodeBlock: InlineCodeBlock;
+} | {
+ CallStmt: CallStmt;
+} | {
+ CallContext: CallContext;
+} | {
+ RenameStmt: RenameStmt;
+} | {
+ AlterObjectDependsStmt: AlterObjectDependsStmt;
+} | {
+ AlterObjectSchemaStmt: AlterObjectSchemaStmt;
+} | {
+ AlterOwnerStmt: AlterOwnerStmt;
+} | {
+ AlterOperatorStmt: AlterOperatorStmt;
+} | {
+ AlterTypeStmt: AlterTypeStmt;
+} | {
+ RuleStmt: RuleStmt;
+} | {
+ NotifyStmt: NotifyStmt;
+} | {
+ ListenStmt: ListenStmt;
+} | {
+ UnlistenStmt: UnlistenStmt;
+} | {
+ TransactionStmt: TransactionStmt;
+} | {
+ CompositeTypeStmt: CompositeTypeStmt;
+} | {
+ CreateEnumStmt: CreateEnumStmt;
+} | {
+ CreateRangeStmt: CreateRangeStmt;
+} | {
+ AlterEnumStmt: AlterEnumStmt;
+} | {
+ ViewStmt: ViewStmt;
+} | {
+ LoadStmt: LoadStmt;
+} | {
+ CreatedbStmt: CreatedbStmt;
+} | {
+ AlterDatabaseStmt: AlterDatabaseStmt;
+} | {
+ AlterDatabaseRefreshCollStmt: AlterDatabaseRefreshCollStmt;
+} | {
+ AlterDatabaseSetStmt: AlterDatabaseSetStmt;
+} | {
+ DropdbStmt: DropdbStmt;
+} | {
+ AlterSystemStmt: AlterSystemStmt;
+} | {
+ ClusterStmt: ClusterStmt;
+} | {
+ VacuumStmt: VacuumStmt;
+} | {
+ VacuumRelation: VacuumRelation;
+} | {
+ ExplainStmt: ExplainStmt;
+} | {
+ CreateTableAsStmt: CreateTableAsStmt;
+} | {
+ RefreshMatViewStmt: RefreshMatViewStmt;
+} | {
+ CheckPointStmt: CheckPointStmt;
+} | {
+ DiscardStmt: DiscardStmt;
+} | {
+ LockStmt: LockStmt;
+} | {
+ ConstraintsSetStmt: ConstraintsSetStmt;
+} | {
+ ReindexStmt: ReindexStmt;
+} | {
+ CreateConversionStmt: CreateConversionStmt;
+} | {
+ CreateCastStmt: CreateCastStmt;
+} | {
+ CreateTransformStmt: CreateTransformStmt;
+} | {
+ PrepareStmt: PrepareStmt;
+} | {
+ ExecuteStmt: ExecuteStmt;
+} | {
+ DeallocateStmt: DeallocateStmt;
+} | {
+ DropOwnedStmt: DropOwnedStmt;
+} | {
+ ReassignOwnedStmt: ReassignOwnedStmt;
+} | {
+ AlterTSDictionaryStmt: AlterTSDictionaryStmt;
+} | {
+ AlterTSConfigurationStmt: AlterTSConfigurationStmt;
+} | {
+ PublicationTable: PublicationTable;
+} | {
+ PublicationObjSpec: PublicationObjSpec;
+} | {
+ CreatePublicationStmt: CreatePublicationStmt;
+} | {
+ AlterPublicationStmt: AlterPublicationStmt;
+} | {
+ CreateSubscriptionStmt: CreateSubscriptionStmt;
+} | {
+ AlterSubscriptionStmt: AlterSubscriptionStmt;
+} | {
+ DropSubscriptionStmt: DropSubscriptionStmt;
+} | {
+ ScanToken: ScanToken;
+};
+export interface ParseResult {
+ version?: number;
+ stmts?: RawStmt[];
+}
+export interface ScanResult {
+ version?: number;
+ tokens?: ScanToken[];
+}
+export interface Integer {
+ ival?: number;
+}
+export interface Float {
+ fval?: string;
+}
+export interface Boolean {
+ boolval?: boolean;
+}
+export interface String {
+ sval?: string;
+}
+export interface BitString {
+ bsval?: string;
+}
+export interface List {
+ items?: Node[];
+}
+export interface OidList {
+ items?: Node[];
+}
+export interface IntList {
+ items?: Node[];
+}
+export interface A_Const {
+ ival?: Integer;
+ fval?: Float;
+ boolval?: Boolean;
+ sval?: String;
+ bsval?: BitString;
+ isnull?: boolean;
+ location?: number;
+}
+export interface Alias {
+ aliasname?: string;
+ colnames?: Node[];
+}
+export interface RangeVar {
+ catalogname?: string;
+ schemaname?: string;
+ relname?: string;
+ inh?: boolean;
+ relpersistence?: string;
+ alias?: Alias;
+ location?: number;
+}
+export interface TableFunc {
+ functype?: TableFuncType;
+ ns_uris?: Node[];
+ ns_names?: Node[];
+ docexpr?: Node;
+ rowexpr?: Node;
+ colnames?: Node[];
+ coltypes?: Node[];
+ coltypmods?: Node[];
+ colcollations?: Node[];
+ colexprs?: Node[];
+ coldefexprs?: Node[];
+ colvalexprs?: Node[];
+ passingvalexprs?: Node[];
+ notnulls?: bigint[];
+ plan?: Node;
+ ordinalitycol?: number;
+ location?: number;
+}
+export interface IntoClause {
+ rel?: RangeVar;
+ colNames?: Node[];
+ accessMethod?: string;
+ options?: Node[];
+ onCommit?: OnCommitAction;
+ tableSpaceName?: string;
+ viewQuery?: Node;
+ skipData?: boolean;
+}
+export interface Var {
+ xpr?: Node;
+ varno?: number;
+ varattno?: number;
+ vartype?: number;
+ vartypmod?: number;
+ varcollid?: number;
+ varnullingrels?: bigint[];
+ varlevelsup?: number;
+ location?: number;
+}
+export interface Param {
+ xpr?: Node;
+ paramkind?: ParamKind;
+ paramid?: number;
+ paramtype?: number;
+ paramtypmod?: number;
+ paramcollid?: number;
+ location?: number;
+}
+export interface Aggref {
+ xpr?: Node;
+ aggfnoid?: number;
+ aggtype?: number;
+ aggcollid?: number;
+ inputcollid?: number;
+ aggargtypes?: Node[];
+ aggdirectargs?: Node[];
+ args?: Node[];
+ aggorder?: Node[];
+ aggdistinct?: Node[];
+ aggfilter?: Node;
+ aggstar?: boolean;
+ aggvariadic?: boolean;
+ aggkind?: string;
+ agglevelsup?: number;
+ aggsplit?: AggSplit;
+ aggno?: number;
+ aggtransno?: number;
+ location?: number;
+}
+export interface GroupingFunc {
+ xpr?: Node;
+ args?: Node[];
+ refs?: Node[];
+ agglevelsup?: number;
+ location?: number;
+}
+export interface WindowFunc {
+ xpr?: Node;
+ winfnoid?: number;
+ wintype?: number;
+ wincollid?: number;
+ inputcollid?: number;
+ args?: Node[];
+ aggfilter?: Node;
+ runCondition?: Node[];
+ winref?: number;
+ winstar?: boolean;
+ winagg?: boolean;
+ location?: number;
+}
+export interface WindowFuncRunCondition {
+ xpr?: Node;
+ opno?: number;
+ inputcollid?: number;
+ wfunc_left?: boolean;
+ arg?: Node;
+}
+export interface MergeSupportFunc {
+ xpr?: Node;
+ msftype?: number;
+ msfcollid?: number;
+ location?: number;
+}
+export interface SubscriptingRef {
+ xpr?: Node;
+ refcontainertype?: number;
+ refelemtype?: number;
+ refrestype?: number;
+ reftypmod?: number;
+ refcollid?: number;
+ refupperindexpr?: Node[];
+ reflowerindexpr?: Node[];
+ refexpr?: Node;
+ refassgnexpr?: Node;
+}
+export interface FuncExpr {
+ xpr?: Node;
+ funcid?: number;
+ funcresulttype?: number;
+ funcretset?: boolean;
+ funcvariadic?: boolean;
+ funcformat?: CoercionForm;
+ funccollid?: number;
+ inputcollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface NamedArgExpr {
+ xpr?: Node;
+ arg?: Node;
+ name?: string;
+ argnumber?: number;
+ location?: number;
+}
+export interface OpExpr {
+ xpr?: Node;
+ opno?: number;
+ opresulttype?: number;
+ opretset?: boolean;
+ opcollid?: number;
+ inputcollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface DistinctExpr {
+ xpr?: Node;
+ opno?: number;
+ opresulttype?: number;
+ opretset?: boolean;
+ opcollid?: number;
+ inputcollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface NullIfExpr {
+ xpr?: Node;
+ opno?: number;
+ opresulttype?: number;
+ opretset?: boolean;
+ opcollid?: number;
+ inputcollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface ScalarArrayOpExpr {
+ xpr?: Node;
+ opno?: number;
+ useOr?: boolean;
+ inputcollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface BoolExpr {
+ xpr?: Node;
+ boolop?: BoolExprType;
+ args?: Node[];
+ location?: number;
+}
+export interface SubLink {
+ xpr?: Node;
+ subLinkType?: SubLinkType;
+ subLinkId?: number;
+ testexpr?: Node;
+ operName?: Node[];
+ subselect?: Node;
+ location?: number;
+}
+export interface SubPlan {
+ xpr?: Node;
+ subLinkType?: SubLinkType;
+ testexpr?: Node;
+ paramIds?: Node[];
+ plan_id?: number;
+ plan_name?: string;
+ firstColType?: number;
+ firstColTypmod?: number;
+ firstColCollation?: number;
+ useHashTable?: boolean;
+ unknownEqFalse?: boolean;
+ parallel_safe?: boolean;
+ setParam?: Node[];
+ parParam?: Node[];
+ args?: Node[];
+ startup_cost?: number;
+ per_call_cost?: number;
+}
+export interface AlternativeSubPlan {
+ xpr?: Node;
+ subplans?: Node[];
+}
+export interface FieldSelect {
+ xpr?: Node;
+ arg?: Node;
+ fieldnum?: number;
+ resulttype?: number;
+ resulttypmod?: number;
+ resultcollid?: number;
+}
+export interface FieldStore {
+ xpr?: Node;
+ arg?: Node;
+ newvals?: Node[];
+ fieldnums?: Node[];
+ resulttype?: number;
+}
+export interface RelabelType {
+ xpr?: Node;
+ arg?: Node;
+ resulttype?: number;
+ resulttypmod?: number;
+ resultcollid?: number;
+ relabelformat?: CoercionForm;
+ location?: number;
+}
+export interface CoerceViaIO {
+ xpr?: Node;
+ arg?: Node;
+ resulttype?: number;
+ resultcollid?: number;
+ coerceformat?: CoercionForm;
+ location?: number;
+}
+export interface ArrayCoerceExpr {
+ xpr?: Node;
+ arg?: Node;
+ elemexpr?: Node;
+ resulttype?: number;
+ resulttypmod?: number;
+ resultcollid?: number;
+ coerceformat?: CoercionForm;
+ location?: number;
+}
+export interface ConvertRowtypeExpr {
+ xpr?: Node;
+ arg?: Node;
+ resulttype?: number;
+ convertformat?: CoercionForm;
+ location?: number;
+}
+export interface CollateExpr {
+ xpr?: Node;
+ arg?: Node;
+ collOid?: number;
+ location?: number;
+}
+export interface CaseExpr {
+ xpr?: Node;
+ casetype?: number;
+ casecollid?: number;
+ arg?: Node;
+ args?: Node[];
+ defresult?: Node;
+ location?: number;
+}
+export interface CaseWhen {
+ xpr?: Node;
+ expr?: Node;
+ result?: Node;
+ location?: number;
+}
+export interface CaseTestExpr {
+ xpr?: Node;
+ typeId?: number;
+ typeMod?: number;
+ collation?: number;
+}
+export interface ArrayExpr {
+ xpr?: Node;
+ array_typeid?: number;
+ array_collid?: number;
+ element_typeid?: number;
+ elements?: Node[];
+ multidims?: boolean;
+ location?: number;
+}
+export interface RowExpr {
+ xpr?: Node;
+ args?: Node[];
+ row_typeid?: number;
+ row_format?: CoercionForm;
+ colnames?: Node[];
+ location?: number;
+}
+export interface RowCompareExpr {
+ xpr?: Node;
+ rctype?: RowCompareType;
+ opnos?: Node[];
+ opfamilies?: Node[];
+ inputcollids?: Node[];
+ largs?: Node[];
+ rargs?: Node[];
+}
+export interface CoalesceExpr {
+ xpr?: Node;
+ coalescetype?: number;
+ coalescecollid?: number;
+ args?: Node[];
+ location?: number;
+}
+export interface MinMaxExpr {
+ xpr?: Node;
+ minmaxtype?: number;
+ minmaxcollid?: number;
+ inputcollid?: number;
+ op?: MinMaxOp;
+ args?: Node[];
+ location?: number;
+}
+export interface SQLValueFunction {
+ xpr?: Node;
+ op?: SQLValueFunctionOp;
+ type?: number;
+ typmod?: number;
+ location?: number;
+}
+export interface XmlExpr {
+ xpr?: Node;
+ op?: XmlExprOp;
+ name?: string;
+ named_args?: Node[];
+ arg_names?: Node[];
+ args?: Node[];
+ xmloption?: XmlOptionType;
+ indent?: boolean;
+ type?: number;
+ typmod?: number;
+ location?: number;
+}
+export interface JsonFormat {
+ format_type?: JsonFormatType;
+ encoding?: JsonEncoding;
+ location?: number;
+}
+export interface JsonReturning {
+ format?: JsonFormat;
+ typid?: number;
+ typmod?: number;
+}
+export interface JsonValueExpr {
+ raw_expr?: Node;
+ formatted_expr?: Node;
+ format?: JsonFormat;
+}
+export interface JsonConstructorExpr {
+ xpr?: Node;
+ type?: JsonConstructorType;
+ args?: Node[];
+ func?: Node;
+ coercion?: Node;
+ returning?: JsonReturning;
+ absent_on_null?: boolean;
+ unique?: boolean;
+ location?: number;
+}
+export interface JsonIsPredicate {
+ expr?: Node;
+ format?: JsonFormat;
+ item_type?: JsonValueType;
+ unique_keys?: boolean;
+ location?: number;
+}
+export interface JsonBehavior {
+ btype?: JsonBehaviorType;
+ expr?: Node;
+ coerce?: boolean;
+ location?: number;
+}
+export interface JsonExpr {
+ xpr?: Node;
+ op?: JsonExprOp;
+ column_name?: string;
+ formatted_expr?: Node;
+ format?: JsonFormat;
+ path_spec?: Node;
+ returning?: JsonReturning;
+ passing_names?: Node[];
+ passing_values?: Node[];
+ on_empty?: JsonBehavior;
+ on_error?: JsonBehavior;
+ use_io_coercion?: boolean;
+ use_json_coercion?: boolean;
+ wrapper?: JsonWrapper;
+ omit_quotes?: boolean;
+ collation?: number;
+ location?: number;
+}
+export interface JsonTablePath {
+ name?: string;
+}
+export interface JsonTablePathScan {
+ plan?: Node;
+ path?: JsonTablePath;
+ errorOnError?: boolean;
+ child?: Node;
+ colMin?: number;
+ colMax?: number;
+}
+export interface JsonTableSiblingJoin {
+ plan?: Node;
+ lplan?: Node;
+ rplan?: Node;
+}
+export interface NullTest {
+ xpr?: Node;
+ arg?: Node;
+ nulltesttype?: NullTestType;
+ argisrow?: boolean;
+ location?: number;
+}
+export interface BooleanTest {
+ xpr?: Node;
+ arg?: Node;
+ booltesttype?: BoolTestType;
+ location?: number;
+}
+export interface MergeAction {
+ matchKind?: MergeMatchKind;
+ commandType?: CmdType;
+ override?: OverridingKind;
+ qual?: Node;
+ targetList?: Node[];
+ updateColnos?: Node[];
+}
+export interface CoerceToDomain {
+ xpr?: Node;
+ arg?: Node;
+ resulttype?: number;
+ resulttypmod?: number;
+ resultcollid?: number;
+ coercionformat?: CoercionForm;
+ location?: number;
+}
+export interface CoerceToDomainValue {
+ xpr?: Node;
+ typeId?: number;
+ typeMod?: number;
+ collation?: number;
+ location?: number;
+}
+export interface SetToDefault {
+ xpr?: Node;
+ typeId?: number;
+ typeMod?: number;
+ collation?: number;
+ location?: number;
+}
+export interface CurrentOfExpr {
+ xpr?: Node;
+ cvarno?: number;
+ cursor_name?: string;
+ cursor_param?: number;
+}
+export interface NextValueExpr {
+ xpr?: Node;
+ seqid?: number;
+ typeId?: number;
+}
+export interface InferenceElem {
+ xpr?: Node;
+ expr?: Node;
+ infercollid?: number;
+ inferopclass?: number;
+}
+export interface TargetEntry {
+ xpr?: Node;
+ expr?: Node;
+ resno?: number;
+ resname?: string;
+ ressortgroupref?: number;
+ resorigtbl?: number;
+ resorigcol?: number;
+ resjunk?: boolean;
+}
+export interface RangeTblRef {
+ rtindex?: number;
+}
+export interface JoinExpr {
+ jointype?: JoinType;
+ isNatural?: boolean;
+ larg?: Node;
+ rarg?: Node;
+ usingClause?: Node[];
+ join_using_alias?: Alias;
+ quals?: Node;
+ alias?: Alias;
+ rtindex?: number;
+}
+export interface FromExpr {
+ fromlist?: Node[];
+ quals?: Node;
+}
+export interface OnConflictExpr {
+ action?: OnConflictAction;
+ arbiterElems?: Node[];
+ arbiterWhere?: Node;
+ constraint?: number;
+ onConflictSet?: Node[];
+ onConflictWhere?: Node;
+ exclRelIndex?: number;
+ exclRelTlist?: Node[];
+}
+export interface Query {
+ commandType?: CmdType;
+ querySource?: QuerySource;
+ canSetTag?: boolean;
+ utilityStmt?: Node;
+ resultRelation?: number;
+ hasAggs?: boolean;
+ hasWindowFuncs?: boolean;
+ hasTargetSRFs?: boolean;
+ hasSubLinks?: boolean;
+ hasDistinctOn?: boolean;
+ hasRecursive?: boolean;
+ hasModifyingCTE?: boolean;
+ hasForUpdate?: boolean;
+ hasRowSecurity?: boolean;
+ isReturn?: boolean;
+ cteList?: Node[];
+ rtable?: Node[];
+ rteperminfos?: Node[];
+ jointree?: FromExpr;
+ mergeActionList?: Node[];
+ mergeTargetRelation?: number;
+ mergeJoinCondition?: Node;
+ targetList?: Node[];
+ override?: OverridingKind;
+ onConflict?: OnConflictExpr;
+ returningList?: Node[];
+ groupClause?: Node[];
+ groupDistinct?: boolean;
+ groupingSets?: Node[];
+ havingQual?: Node;
+ windowClause?: Node[];
+ distinctClause?: Node[];
+ sortClause?: Node[];
+ limitOffset?: Node;
+ limitCount?: Node;
+ limitOption?: LimitOption;
+ rowMarks?: Node[];
+ setOperations?: Node;
+ constraintDeps?: Node[];
+ withCheckOptions?: Node[];
+ stmt_location?: number;
+ stmt_len?: number;
+}
+export interface TypeName {
+ names?: Node[];
+ typeOid?: number;
+ setof?: boolean;
+ pct_type?: boolean;
+ typmods?: Node[];
+ typemod?: number;
+ arrayBounds?: Node[];
+ location?: number;
+}
+export interface ColumnRef {
+ fields?: Node[];
+ location?: number;
+}
+export interface ParamRef {
+ number?: number;
+ location?: number;
+}
+export interface A_Expr {
+ kind?: A_Expr_Kind;
+ name?: Node[];
+ lexpr?: Node;
+ rexpr?: Node;
+ location?: number;
+}
+export interface TypeCast {
+ arg?: Node;
+ typeName?: TypeName;
+ location?: number;
+}
+export interface CollateClause {
+ arg?: Node;
+ collname?: Node[];
+ location?: number;
+}
+export interface RoleSpec {
+ roletype?: RoleSpecType;
+ rolename?: string;
+ location?: number;
+}
+export interface FuncCall {
+ funcname?: Node[];
+ args?: Node[];
+ agg_order?: Node[];
+ agg_filter?: Node;
+ over?: WindowDef;
+ agg_within_group?: boolean;
+ agg_star?: boolean;
+ agg_distinct?: boolean;
+ func_variadic?: boolean;
+ funcformat?: CoercionForm;
+ location?: number;
+}
+export interface A_Star {}
+export interface A_Indices {
+ is_slice?: boolean;
+ lidx?: Node;
+ uidx?: Node;
+}
+export interface A_Indirection {
+ arg?: Node;
+ indirection?: Node[];
+}
+export interface A_ArrayExpr {
+ elements?: Node[];
+ location?: number;
+}
+export interface ResTarget {
+ name?: string;
+ indirection?: Node[];
+ val?: Node;
+ location?: number;
+}
+export interface MultiAssignRef {
+ source?: Node;
+ colno?: number;
+ ncolumns?: number;
+}
+export interface SortBy {
+ node?: Node;
+ sortby_dir?: SortByDir;
+ sortby_nulls?: SortByNulls;
+ useOp?: Node[];
+ location?: number;
+}
+export interface WindowDef {
+ name?: string;
+ refname?: string;
+ partitionClause?: Node[];
+ orderClause?: Node[];
+ frameOptions?: number;
+ startOffset?: Node;
+ endOffset?: Node;
+ location?: number;
+}
+export interface RangeSubselect {
+ lateral?: boolean;
+ subquery?: Node;
+ alias?: Alias;
+}
+export interface RangeFunction {
+ lateral?: boolean;
+ ordinality?: boolean;
+ is_rowsfrom?: boolean;
+ functions?: Node[];
+ alias?: Alias;
+ coldeflist?: Node[];
+}
+export interface RangeTableFunc {
+ lateral?: boolean;
+ docexpr?: Node;
+ rowexpr?: Node;
+ namespaces?: Node[];
+ columns?: Node[];
+ alias?: Alias;
+ location?: number;
+}
+export interface RangeTableFuncCol {
+ colname?: string;
+ typeName?: TypeName;
+ for_ordinality?: boolean;
+ is_not_null?: boolean;
+ colexpr?: Node;
+ coldefexpr?: Node;
+ location?: number;
+}
+export interface RangeTableSample {
+ relation?: Node;
+ method?: Node[];
+ args?: Node[];
+ repeatable?: Node;
+ location?: number;
+}
+export interface ColumnDef {
+ colname?: string;
+ typeName?: TypeName;
+ compression?: string;
+ inhcount?: number;
+ is_local?: boolean;
+ is_not_null?: boolean;
+ is_from_type?: boolean;
+ storage?: string;
+ storage_name?: string;
+ raw_default?: Node;
+ cooked_default?: Node;
+ identity?: string;
+ identitySequence?: RangeVar;
+ generated?: string;
+ collClause?: CollateClause;
+ collOid?: number;
+ constraints?: Node[];
+ fdwoptions?: Node[];
+ location?: number;
+}
+export interface TableLikeClause {
+ relation?: RangeVar;
+ options?: number;
+ relationOid?: number;
+}
+export interface IndexElem {
+ name?: string;
+ expr?: Node;
+ indexcolname?: string;
+ collation?: Node[];
+ opclass?: Node[];
+ opclassopts?: Node[];
+ ordering?: SortByDir;
+ nulls_ordering?: SortByNulls;
+}
+export interface DefElem {
+ defnamespace?: string;
+ defname?: string;
+ arg?: Node;
+ defaction?: DefElemAction;
+ location?: number;
+}
+export interface LockingClause {
+ lockedRels?: Node[];
+ strength?: LockClauseStrength;
+ waitPolicy?: LockWaitPolicy;
+}
+export interface XmlSerialize {
+ xmloption?: XmlOptionType;
+ expr?: Node;
+ typeName?: TypeName;
+ indent?: boolean;
+ location?: number;
+}
+export interface PartitionElem {
+ name?: string;
+ expr?: Node;
+ collation?: Node[];
+ opclass?: Node[];
+ location?: number;
+}
+export interface PartitionSpec {
+ strategy?: PartitionStrategy;
+ partParams?: Node[];
+ location?: number;
+}
+export interface PartitionBoundSpec {
+ strategy?: string;
+ is_default?: boolean;
+ modulus?: number;
+ remainder?: number;
+ listdatums?: Node[];
+ lowerdatums?: Node[];
+ upperdatums?: Node[];
+ location?: number;
+}
+export interface PartitionRangeDatum {
+ kind?: PartitionRangeDatumKind;
+ value?: Node;
+ location?: number;
+}
+export interface SinglePartitionSpec {}
+export interface PartitionCmd {
+ name?: RangeVar;
+ bound?: PartitionBoundSpec;
+ concurrent?: boolean;
+}
+export interface RangeTblEntry {
+ alias?: Alias;
+ eref?: Alias;
+ rtekind?: RTEKind;
+ relid?: number;
+ inh?: boolean;
+ relkind?: string;
+ rellockmode?: number;
+ perminfoindex?: number;
+ tablesample?: TableSampleClause;
+ subquery?: Query;
+ security_barrier?: boolean;
+ jointype?: JoinType;
+ joinmergedcols?: number;
+ joinaliasvars?: Node[];
+ joinleftcols?: Node[];
+ joinrightcols?: Node[];
+ join_using_alias?: Alias;
+ functions?: Node[];
+ funcordinality?: boolean;
+ tablefunc?: TableFunc;
+ values_lists?: Node[];
+ ctename?: string;
+ ctelevelsup?: number;
+ self_reference?: boolean;
+ coltypes?: Node[];
+ coltypmods?: Node[];
+ colcollations?: Node[];
+ enrname?: string;
+ enrtuples?: number;
+ lateral?: boolean;
+ inFromCl?: boolean;
+ securityQuals?: Node[];
+}
+export interface RTEPermissionInfo {
+ relid?: number;
+ inh?: boolean;
+ requiredPerms?: bigint;
+ checkAsUser?: number;
+ selectedCols?: bigint[];
+ insertedCols?: bigint[];
+ updatedCols?: bigint[];
+}
+export interface RangeTblFunction {
+ funcexpr?: Node;
+ funccolcount?: number;
+ funccolnames?: Node[];
+ funccoltypes?: Node[];
+ funccoltypmods?: Node[];
+ funccolcollations?: Node[];
+ funcparams?: bigint[];
+}
+export interface TableSampleClause {
+ tsmhandler?: number;
+ args?: Node[];
+ repeatable?: Node;
+}
+export interface WithCheckOption {
+ kind?: WCOKind;
+ relname?: string;
+ polname?: string;
+ qual?: Node;
+ cascaded?: boolean;
+}
+export interface SortGroupClause {
+ tleSortGroupRef?: number;
+ eqop?: number;
+ sortop?: number;
+ nulls_first?: boolean;
+ hashable?: boolean;
+}
+export interface GroupingSet {
+ kind?: GroupingSetKind;
+ content?: Node[];
+ location?: number;
+}
+export interface WindowClause {
+ name?: string;
+ refname?: string;
+ partitionClause?: Node[];
+ orderClause?: Node[];
+ frameOptions?: number;
+ startOffset?: Node;
+ endOffset?: Node;
+ startInRangeFunc?: number;
+ endInRangeFunc?: number;
+ inRangeColl?: number;
+ inRangeAsc?: boolean;
+ inRangeNullsFirst?: boolean;
+ winref?: number;
+ copiedOrder?: boolean;
+}
+export interface RowMarkClause {
+ rti?: number;
+ strength?: LockClauseStrength;
+ waitPolicy?: LockWaitPolicy;
+ pushedDown?: boolean;
+}
+export interface WithClause {
+ ctes?: Node[];
+ recursive?: boolean;
+ location?: number;
+}
+export interface InferClause {
+ indexElems?: Node[];
+ whereClause?: Node;
+ conname?: string;
+ location?: number;
+}
+export interface OnConflictClause {
+ action?: OnConflictAction;
+ infer?: InferClause;
+ targetList?: Node[];
+ whereClause?: Node;
+ location?: number;
+}
+export interface CTESearchClause {
+ search_col_list?: Node[];
+ search_breadth_first?: boolean;
+ search_seq_column?: string;
+ location?: number;
+}
+export interface CTECycleClause {
+ cycle_col_list?: Node[];
+ cycle_mark_column?: string;
+ cycle_mark_value?: Node;
+ cycle_mark_default?: Node;
+ cycle_path_column?: string;
+ location?: number;
+ cycle_mark_type?: number;
+ cycle_mark_typmod?: number;
+ cycle_mark_collation?: number;
+ cycle_mark_neop?: number;
+}
+export interface CommonTableExpr {
+ ctename?: string;
+ aliascolnames?: Node[];
+ ctematerialized?: CTEMaterialize;
+ ctequery?: Node;
+ search_clause?: CTESearchClause;
+ cycle_clause?: CTECycleClause;
+ location?: number;
+ cterecursive?: boolean;
+ cterefcount?: number;
+ ctecolnames?: Node[];
+ ctecoltypes?: Node[];
+ ctecoltypmods?: Node[];
+ ctecolcollations?: Node[];
+}
+export interface MergeWhenClause {
+ matchKind?: MergeMatchKind;
+ commandType?: CmdType;
+ override?: OverridingKind;
+ condition?: Node;
+ targetList?: Node[];
+ values?: Node[];
+}
+export interface TriggerTransition {
+ name?: string;
+ isNew?: boolean;
+ isTable?: boolean;
+}
+export interface JsonOutput {
+ typeName?: TypeName;
+ returning?: JsonReturning;
+}
+export interface JsonArgument {
+ val?: JsonValueExpr;
+ name?: string;
+}
+export interface JsonFuncExpr {
+ op?: JsonExprOp;
+ column_name?: string;
+ context_item?: JsonValueExpr;
+ pathspec?: Node;
+ passing?: Node[];
+ output?: JsonOutput;
+ on_empty?: JsonBehavior;
+ on_error?: JsonBehavior;
+ wrapper?: JsonWrapper;
+ quotes?: JsonQuotes;
+ location?: number;
+}
+export interface JsonTablePathSpec {
+ string?: Node;
+ name?: string;
+ name_location?: number;
+ location?: number;
+}
+export interface JsonTable {
+ context_item?: JsonValueExpr;
+ pathspec?: JsonTablePathSpec;
+ passing?: Node[];
+ columns?: Node[];
+ on_error?: JsonBehavior;
+ alias?: Alias;
+ lateral?: boolean;
+ location?: number;
+}
+export interface JsonTableColumn {
+ coltype?: JsonTableColumnType;
+ name?: string;
+ typeName?: TypeName;
+ pathspec?: JsonTablePathSpec;
+ format?: JsonFormat;
+ wrapper?: JsonWrapper;
+ quotes?: JsonQuotes;
+ columns?: Node[];
+ on_empty?: JsonBehavior;
+ on_error?: JsonBehavior;
+ location?: number;
+}
+export interface JsonKeyValue {
+ key?: Node;
+ value?: JsonValueExpr;
+}
+export interface JsonParseExpr {
+ expr?: JsonValueExpr;
+ output?: JsonOutput;
+ unique_keys?: boolean;
+ location?: number;
+}
+export interface JsonScalarExpr {
+ expr?: Node;
+ output?: JsonOutput;
+ location?: number;
+}
+export interface JsonSerializeExpr {
+ expr?: JsonValueExpr;
+ output?: JsonOutput;
+ location?: number;
+}
+export interface JsonObjectConstructor {
+ exprs?: Node[];
+ output?: JsonOutput;
+ absent_on_null?: boolean;
+ unique?: boolean;
+ location?: number;
+}
+export interface JsonArrayConstructor {
+ exprs?: Node[];
+ output?: JsonOutput;
+ absent_on_null?: boolean;
+ location?: number;
+}
+export interface JsonArrayQueryConstructor {
+ query?: Node;
+ output?: JsonOutput;
+ format?: JsonFormat;
+ absent_on_null?: boolean;
+ location?: number;
+}
+export interface JsonAggConstructor {
+ output?: JsonOutput;
+ agg_filter?: Node;
+ agg_order?: Node[];
+ over?: WindowDef;
+ location?: number;
+}
+export interface JsonObjectAgg {
+ constructor?: JsonAggConstructor;
+ arg?: JsonKeyValue;
+ absent_on_null?: boolean;
+ unique?: boolean;
+}
+export interface JsonArrayAgg {
+ constructor?: JsonAggConstructor;
+ arg?: JsonValueExpr;
+ absent_on_null?: boolean;
+}
+export interface RawStmt {
+ stmt?: Node;
+ stmt_location?: number;
+ stmt_len?: number;
+}
+export interface InsertStmt {
+ relation?: RangeVar;
+ cols?: Node[];
+ selectStmt?: Node;
+ onConflictClause?: OnConflictClause;
+ returningList?: Node[];
+ withClause?: WithClause;
+ override?: OverridingKind;
+}
+export interface DeleteStmt {
+ relation?: RangeVar;
+ usingClause?: Node[];
+ whereClause?: Node;
+ returningList?: Node[];
+ withClause?: WithClause;
+}
+export interface UpdateStmt {
+ relation?: RangeVar;
+ targetList?: Node[];
+ whereClause?: Node;
+ fromClause?: Node[];
+ returningList?: Node[];
+ withClause?: WithClause;
+}
+export interface MergeStmt {
+ relation?: RangeVar;
+ sourceRelation?: Node;
+ joinCondition?: Node;
+ mergeWhenClauses?: Node[];
+ returningList?: Node[];
+ withClause?: WithClause;
+}
+export interface SelectStmt {
+ distinctClause?: Node[];
+ intoClause?: IntoClause;
+ targetList?: Node[];
+ fromClause?: Node[];
+ whereClause?: Node;
+ groupClause?: Node[];
+ groupDistinct?: boolean;
+ havingClause?: Node;
+ windowClause?: Node[];
+ valuesLists?: Node[];
+ sortClause?: Node[];
+ limitOffset?: Node;
+ limitCount?: Node;
+ limitOption?: LimitOption;
+ lockingClause?: Node[];
+ withClause?: WithClause;
+ op?: SetOperation;
+ all?: boolean;
+ larg?: SelectStmt;
+ rarg?: SelectStmt;
+}
+export interface SetOperationStmt {
+ op?: SetOperation;
+ all?: boolean;
+ larg?: Node;
+ rarg?: Node;
+ colTypes?: Node[];
+ colTypmods?: Node[];
+ colCollations?: Node[];
+ groupClauses?: Node[];
+}
+export interface ReturnStmt {
+ returnval?: Node;
+}
+export interface PLAssignStmt {
+ name?: string;
+ indirection?: Node[];
+ nnames?: number;
+ val?: SelectStmt;
+ location?: number;
+}
+export interface CreateSchemaStmt {
+ schemaname?: string;
+ authrole?: RoleSpec;
+ schemaElts?: Node[];
+ if_not_exists?: boolean;
+}
+export interface AlterTableStmt {
+ relation?: RangeVar;
+ cmds?: Node[];
+ objtype?: ObjectType;
+ missing_ok?: boolean;
+}
+export interface ReplicaIdentityStmt {
+ identity_type?: string;
+ name?: string;
+}
+export interface AlterTableCmd {
+ subtype?: AlterTableType;
+ name?: string;
+ num?: number;
+ newowner?: RoleSpec;
+ def?: Node;
+ behavior?: DropBehavior;
+ missing_ok?: boolean;
+ recurse?: boolean;
+}
+export interface AlterCollationStmt {
+ collname?: Node[];
+}
+export interface AlterDomainStmt {
+ subtype?: string;
+ typeName?: Node[];
+ name?: string;
+ def?: Node;
+ behavior?: DropBehavior;
+ missing_ok?: boolean;
+}
+export interface GrantStmt {
+ is_grant?: boolean;
+ targtype?: GrantTargetType;
+ objtype?: ObjectType;
+ objects?: Node[];
+ privileges?: Node[];
+ grantees?: Node[];
+ grant_option?: boolean;
+ grantor?: RoleSpec;
+ behavior?: DropBehavior;
+}
+export interface ObjectWithArgs {
+ objname?: Node[];
+ objargs?: Node[];
+ objfuncargs?: Node[];
+ args_unspecified?: boolean;
+}
+export interface AccessPriv {
+ priv_name?: string;
+ cols?: Node[];
+}
+export interface GrantRoleStmt {
+ granted_roles?: Node[];
+ grantee_roles?: Node[];
+ is_grant?: boolean;
+ opt?: Node[];
+ grantor?: RoleSpec;
+ behavior?: DropBehavior;
+}
+export interface AlterDefaultPrivilegesStmt {
+ options?: Node[];
+ action?: GrantStmt;
+}
+export interface CopyStmt {
+ relation?: RangeVar;
+ query?: Node;
+ attlist?: Node[];
+ is_from?: boolean;
+ is_program?: boolean;
+ filename?: string;
+ options?: Node[];
+ whereClause?: Node;
+}
+export interface VariableSetStmt {
+ kind?: VariableSetKind;
+ name?: string;
+ args?: Node[];
+ is_local?: boolean;
+}
+export interface VariableShowStmt {
+ name?: string;
+}
+export interface CreateStmt {
+ relation?: RangeVar;
+ tableElts?: Node[];
+ inhRelations?: Node[];
+ partbound?: PartitionBoundSpec;
+ partspec?: PartitionSpec;
+ ofTypename?: TypeName;
+ constraints?: Node[];
+ options?: Node[];
+ oncommit?: OnCommitAction;
+ tablespacename?: string;
+ accessMethod?: string;
+ if_not_exists?: boolean;
+}
+export interface Constraint {
+ contype?: ConstrType;
+ conname?: string;
+ deferrable?: boolean;
+ initdeferred?: boolean;
+ skip_validation?: boolean;
+ initially_valid?: boolean;
+ is_no_inherit?: boolean;
+ raw_expr?: Node;
+ cooked_expr?: string;
+ generated_when?: string;
+ inhcount?: number;
+ nulls_not_distinct?: boolean;
+ keys?: Node[];
+ including?: Node[];
+ exclusions?: Node[];
+ options?: Node[];
+ indexname?: string;
+ indexspace?: string;
+ reset_default_tblspc?: boolean;
+ access_method?: string;
+ where_clause?: Node;
+ pktable?: RangeVar;
+ fk_attrs?: Node[];
+ pk_attrs?: Node[];
+ fk_matchtype?: string;
+ fk_upd_action?: string;
+ fk_del_action?: string;
+ fk_del_set_cols?: Node[];
+ old_conpfeqop?: Node[];
+ old_pktable_oid?: number;
+ location?: number;
+}
+export interface CreateTableSpaceStmt {
+ tablespacename?: string;
+ owner?: RoleSpec;
+ location?: string;
+ options?: Node[];
+}
+export interface DropTableSpaceStmt {
+ tablespacename?: string;
+ missing_ok?: boolean;
+}
+export interface AlterTableSpaceOptionsStmt {
+ tablespacename?: string;
+ options?: Node[];
+ isReset?: boolean;
+}
+export interface AlterTableMoveAllStmt {
+ orig_tablespacename?: string;
+ objtype?: ObjectType;
+ roles?: Node[];
+ new_tablespacename?: string;
+ nowait?: boolean;
+}
+export interface CreateExtensionStmt {
+ extname?: string;
+ if_not_exists?: boolean;
+ options?: Node[];
+}
+export interface AlterExtensionStmt {
+ extname?: string;
+ options?: Node[];
+}
+export interface AlterExtensionContentsStmt {
+ extname?: string;
+ action?: number;
+ objtype?: ObjectType;
+ object?: Node;
+}
+export interface CreateFdwStmt {
+ fdwname?: string;
+ func_options?: Node[];
+ options?: Node[];
+}
+export interface AlterFdwStmt {
+ fdwname?: string;
+ func_options?: Node[];
+ options?: Node[];
+}
+export interface CreateForeignServerStmt {
+ servername?: string;
+ servertype?: string;
+ version?: string;
+ fdwname?: string;
+ if_not_exists?: boolean;
+ options?: Node[];
+}
+export interface AlterForeignServerStmt {
+ servername?: string;
+ version?: string;
+ options?: Node[];
+ has_version?: boolean;
+}
+export interface CreateForeignTableStmt {
+ base?: CreateStmt;
+ servername?: string;
+ options?: Node[];
+}
+export interface CreateUserMappingStmt {
+ user?: RoleSpec;
+ servername?: string;
+ if_not_exists?: boolean;
+ options?: Node[];
+}
+export interface AlterUserMappingStmt {
+ user?: RoleSpec;
+ servername?: string;
+ options?: Node[];
+}
+export interface DropUserMappingStmt {
+ user?: RoleSpec;
+ servername?: string;
+ missing_ok?: boolean;
+}
+export interface ImportForeignSchemaStmt {
+ server_name?: string;
+ remote_schema?: string;
+ local_schema?: string;
+ list_type?: ImportForeignSchemaType;
+ table_list?: Node[];
+ options?: Node[];
+}
+export interface CreatePolicyStmt {
+ policy_name?: string;
+ table?: RangeVar;
+ cmd_name?: string;
+ permissive?: boolean;
+ roles?: Node[];
+ qual?: Node;
+ with_check?: Node;
+}
+export interface AlterPolicyStmt {
+ policy_name?: string;
+ table?: RangeVar;
+ roles?: Node[];
+ qual?: Node;
+ with_check?: Node;
+}
+export interface CreateAmStmt {
+ amname?: string;
+ handler_name?: Node[];
+ amtype?: string;
+}
+export interface CreateTrigStmt {
+ replace?: boolean;
+ isconstraint?: boolean;
+ trigname?: string;
+ relation?: RangeVar;
+ funcname?: Node[];
+ args?: Node[];
+ row?: boolean;
+ timing?: number;
+ events?: number;
+ columns?: Node[];
+ whenClause?: Node;
+ transitionRels?: Node[];
+ deferrable?: boolean;
+ initdeferred?: boolean;
+ constrrel?: RangeVar;
+}
+export interface CreateEventTrigStmt {
+ trigname?: string;
+ eventname?: string;
+ whenclause?: Node[];
+ funcname?: Node[];
+}
+export interface AlterEventTrigStmt {
+ trigname?: string;
+ tgenabled?: string;
+}
+export interface CreatePLangStmt {
+ replace?: boolean;
+ plname?: string;
+ plhandler?: Node[];
+ plinline?: Node[];
+ plvalidator?: Node[];
+ pltrusted?: boolean;
+}
+export interface CreateRoleStmt {
+ stmt_type?: RoleStmtType;
+ role?: string;
+ options?: Node[];
+}
+export interface AlterRoleStmt {
+ role?: RoleSpec;
+ options?: Node[];
+ action?: number;
+}
+export interface AlterRoleSetStmt {
+ role?: RoleSpec;
+ database?: string;
+ setstmt?: VariableSetStmt;
+}
+export interface DropRoleStmt {
+ roles?: Node[];
+ missing_ok?: boolean;
+}
+export interface CreateSeqStmt {
+ sequence?: RangeVar;
+ options?: Node[];
+ ownerId?: number;
+ for_identity?: boolean;
+ if_not_exists?: boolean;
+}
+export interface AlterSeqStmt {
+ sequence?: RangeVar;
+ options?: Node[];
+ for_identity?: boolean;
+ missing_ok?: boolean;
+}
+export interface DefineStmt {
+ kind?: ObjectType;
+ oldstyle?: boolean;
+ defnames?: Node[];
+ args?: Node[];
+ definition?: Node[];
+ if_not_exists?: boolean;
+ replace?: boolean;
+}
+export interface CreateDomainStmt {
+ domainname?: Node[];
+ typeName?: TypeName;
+ collClause?: CollateClause;
+ constraints?: Node[];
+}
+export interface CreateOpClassStmt {
+ opclassname?: Node[];
+ opfamilyname?: Node[];
+ amname?: string;
+ datatype?: TypeName;
+ items?: Node[];
+ isDefault?: boolean;
+}
+export interface CreateOpClassItem {
+ itemtype?: number;
+ name?: ObjectWithArgs;
+ number?: number;
+ order_family?: Node[];
+ class_args?: Node[];
+ storedtype?: TypeName;
+}
+export interface CreateOpFamilyStmt {
+ opfamilyname?: Node[];
+ amname?: string;
+}
+export interface AlterOpFamilyStmt {
+ opfamilyname?: Node[];
+ amname?: string;
+ isDrop?: boolean;
+ items?: Node[];
+}
+export interface DropStmt {
+ objects?: Node[];
+ removeType?: ObjectType;
+ behavior?: DropBehavior;
+ missing_ok?: boolean;
+ concurrent?: boolean;
+}
+export interface TruncateStmt {
+ relations?: Node[];
+ restart_seqs?: boolean;
+ behavior?: DropBehavior;
+}
+export interface CommentStmt {
+ objtype?: ObjectType;
+ object?: Node;
+ comment?: string;
+}
+export interface SecLabelStmt {
+ objtype?: ObjectType;
+ object?: Node;
+ provider?: string;
+ label?: string;
+}
+export interface DeclareCursorStmt {
+ portalname?: string;
+ options?: number;
+ query?: Node;
+}
+export interface ClosePortalStmt {
+ portalname?: string;
+}
+export interface FetchStmt {
+ direction?: FetchDirection;
+ howMany?: bigint;
+ portalname?: string;
+ ismove?: boolean;
+}
+export interface IndexStmt {
+ idxname?: string;
+ relation?: RangeVar;
+ accessMethod?: string;
+ tableSpace?: string;
+ indexParams?: Node[];
+ indexIncludingParams?: Node[];
+ options?: Node[];
+ whereClause?: Node;
+ excludeOpNames?: Node[];
+ idxcomment?: string;
+ indexOid?: number;
+ oldNumber?: number;
+ oldCreateSubid?: number;
+ oldFirstRelfilelocatorSubid?: number;
+ unique?: boolean;
+ nulls_not_distinct?: boolean;
+ primary?: boolean;
+ isconstraint?: boolean;
+ deferrable?: boolean;
+ initdeferred?: boolean;
+ transformed?: boolean;
+ concurrent?: boolean;
+ if_not_exists?: boolean;
+ reset_default_tblspc?: boolean;
+}
+export interface CreateStatsStmt {
+ defnames?: Node[];
+ stat_types?: Node[];
+ exprs?: Node[];
+ relations?: Node[];
+ stxcomment?: string;
+ transformed?: boolean;
+ if_not_exists?: boolean;
+}
+export interface StatsElem {
+ name?: string;
+ expr?: Node;
+}
+export interface AlterStatsStmt {
+ defnames?: Node[];
+ stxstattarget?: Node;
+ missing_ok?: boolean;
+}
+export interface CreateFunctionStmt {
+ is_procedure?: boolean;
+ replace?: boolean;
+ funcname?: Node[];
+ parameters?: Node[];
+ returnType?: TypeName;
+ options?: Node[];
+ sql_body?: Node;
+}
+export interface FunctionParameter {
+ name?: string;
+ argType?: TypeName;
+ mode?: FunctionParameterMode;
+ defexpr?: Node;
+}
+export interface AlterFunctionStmt {
+ objtype?: ObjectType;
+ func?: ObjectWithArgs;
+ actions?: Node[];
+}
+export interface DoStmt {
+ args?: Node[];
+}
+export interface InlineCodeBlock {
+ source_text?: string;
+ langOid?: number;
+ langIsTrusted?: boolean;
+ atomic?: boolean;
+}
+export interface CallStmt {
+ funccall?: FuncCall;
+ funcexpr?: FuncExpr;
+ outargs?: Node[];
+}
+export interface CallContext {
+ atomic?: boolean;
+}
+export interface RenameStmt {
+ renameType?: ObjectType;
+ relationType?: ObjectType;
+ relation?: RangeVar;
+ object?: Node;
+ subname?: string;
+ newname?: string;
+ behavior?: DropBehavior;
+ missing_ok?: boolean;
+}
+export interface AlterObjectDependsStmt {
+ objectType?: ObjectType;
+ relation?: RangeVar;
+ object?: Node;
+ extname?: String;
+ remove?: boolean;
+}
+export interface AlterObjectSchemaStmt {
+ objectType?: ObjectType;
+ relation?: RangeVar;
+ object?: Node;
+ newschema?: string;
+ missing_ok?: boolean;
+}
+export interface AlterOwnerStmt {
+ objectType?: ObjectType;
+ relation?: RangeVar;
+ object?: Node;
+ newowner?: RoleSpec;
+}
+export interface AlterOperatorStmt {
+ opername?: ObjectWithArgs;
+ options?: Node[];
+}
+export interface AlterTypeStmt {
+ typeName?: Node[];
+ options?: Node[];
+}
+export interface RuleStmt {
+ relation?: RangeVar;
+ rulename?: string;
+ whereClause?: Node;
+ event?: CmdType;
+ instead?: boolean;
+ actions?: Node[];
+ replace?: boolean;
+}
+export interface NotifyStmt {
+ conditionname?: string;
+ payload?: string;
+}
+export interface ListenStmt {
+ conditionname?: string;
+}
+export interface UnlistenStmt {
+ conditionname?: string;
+}
+export interface TransactionStmt {
+ kind?: TransactionStmtKind;
+ options?: Node[];
+ savepoint_name?: string;
+ gid?: string;
+ chain?: boolean;
+ location?: number;
+}
+export interface CompositeTypeStmt {
+ typevar?: RangeVar;
+ coldeflist?: Node[];
+}
+export interface CreateEnumStmt {
+ typeName?: Node[];
+ vals?: Node[];
+}
+export interface CreateRangeStmt {
+ typeName?: Node[];
+ params?: Node[];
+}
+export interface AlterEnumStmt {
+ typeName?: Node[];
+ oldVal?: string;
+ newVal?: string;
+ newValNeighbor?: string;
+ newValIsAfter?: boolean;
+ skipIfNewValExists?: boolean;
+}
+export interface ViewStmt {
+ view?: RangeVar;
+ aliases?: Node[];
+ query?: Node;
+ replace?: boolean;
+ options?: Node[];
+ withCheckOption?: ViewCheckOption;
+}
+export interface LoadStmt {
+ filename?: string;
+}
+export interface CreatedbStmt {
+ dbname?: string;
+ options?: Node[];
+}
+export interface AlterDatabaseStmt {
+ dbname?: string;
+ options?: Node[];
+}
+export interface AlterDatabaseRefreshCollStmt {
+ dbname?: string;
+}
+export interface AlterDatabaseSetStmt {
+ dbname?: string;
+ setstmt?: VariableSetStmt;
+}
+export interface DropdbStmt {
+ dbname?: string;
+ missing_ok?: boolean;
+ options?: Node[];
+}
+export interface AlterSystemStmt {
+ setstmt?: VariableSetStmt;
+}
+export interface ClusterStmt {
+ relation?: RangeVar;
+ indexname?: string;
+ params?: Node[];
+}
+export interface VacuumStmt {
+ options?: Node[];
+ rels?: Node[];
+ is_vacuumcmd?: boolean;
+}
+export interface VacuumRelation {
+ relation?: RangeVar;
+ oid?: number;
+ va_cols?: Node[];
+}
+export interface ExplainStmt {
+ query?: Node;
+ options?: Node[];
+}
+export interface CreateTableAsStmt {
+ query?: Node;
+ into?: IntoClause;
+ objtype?: ObjectType;
+ is_select_into?: boolean;
+ if_not_exists?: boolean;
+}
+export interface RefreshMatViewStmt {
+ concurrent?: boolean;
+ skipData?: boolean;
+ relation?: RangeVar;
+}
+export interface CheckPointStmt {}
+export interface DiscardStmt {
+ target?: DiscardMode;
+}
+export interface LockStmt {
+ relations?: Node[];
+ mode?: number;
+ nowait?: boolean;
+}
+export interface ConstraintsSetStmt {
+ constraints?: Node[];
+ deferred?: boolean;
+}
+export interface ReindexStmt {
+ kind?: ReindexObjectType;
+ relation?: RangeVar;
+ name?: string;
+ params?: Node[];
+}
+export interface CreateConversionStmt {
+ conversion_name?: Node[];
+ for_encoding_name?: string;
+ to_encoding_name?: string;
+ func_name?: Node[];
+ def?: boolean;
+}
+export interface CreateCastStmt {
+ sourcetype?: TypeName;
+ targettype?: TypeName;
+ func?: ObjectWithArgs;
+ context?: CoercionContext;
+ inout?: boolean;
+}
+export interface CreateTransformStmt {
+ replace?: boolean;
+ type_name?: TypeName;
+ lang?: string;
+ fromsql?: ObjectWithArgs;
+ tosql?: ObjectWithArgs;
+}
+export interface PrepareStmt {
+ name?: string;
+ argtypes?: Node[];
+ query?: Node;
+}
+export interface ExecuteStmt {
+ name?: string;
+ params?: Node[];
+}
+export interface DeallocateStmt {
+ name?: string;
+ isall?: boolean;
+ location?: number;
+}
+export interface DropOwnedStmt {
+ roles?: Node[];
+ behavior?: DropBehavior;
+}
+export interface ReassignOwnedStmt {
+ roles?: Node[];
+ newrole?: RoleSpec;
+}
+export interface AlterTSDictionaryStmt {
+ dictname?: Node[];
+ options?: Node[];
+}
+export interface AlterTSConfigurationStmt {
+ kind?: AlterTSConfigType;
+ cfgname?: Node[];
+ tokentype?: Node[];
+ dicts?: Node[];
+ override?: boolean;
+ replace?: boolean;
+ missing_ok?: boolean;
+}
+export interface PublicationTable {
+ relation?: RangeVar;
+ whereClause?: Node;
+ columns?: Node[];
+}
+export interface PublicationObjSpec {
+ pubobjtype?: PublicationObjSpecType;
+ name?: string;
+ pubtable?: PublicationTable;
+ location?: number;
+}
+export interface CreatePublicationStmt {
+ pubname?: string;
+ options?: Node[];
+ pubobjects?: Node[];
+ for_all_tables?: boolean;
+}
+export interface AlterPublicationStmt {
+ pubname?: string;
+ options?: Node[];
+ pubobjects?: Node[];
+ for_all_tables?: boolean;
+ action?: AlterPublicationAction;
+}
+export interface CreateSubscriptionStmt {
+ subname?: string;
+ conninfo?: string;
+ publication?: Node[];
+ options?: Node[];
+}
+export interface AlterSubscriptionStmt {
+ kind?: AlterSubscriptionType;
+ subname?: string;
+ conninfo?: string;
+ publication?: Node[];
+ options?: Node[];
+}
+export interface DropSubscriptionStmt {
+ subname?: string;
+ missing_ok?: boolean;
+ behavior?: DropBehavior;
+}
+export interface ScanToken {
+ start?: number;
+ end?: number;
+ token?: Token;
+ keywordKind?: KeywordKind;
+}
\ No newline at end of file
diff --git a/types/17/tsconfig.esm.json b/types/17/tsconfig.esm.json
new file mode 100644
index 00000000..800d7506
--- /dev/null
+++ b/types/17/tsconfig.esm.json
@@ -0,0 +1,9 @@
+{
+ "extends": "./tsconfig.json",
+ "compilerOptions": {
+ "outDir": "dist/esm",
+ "module": "es2022",
+ "rootDir": "src/",
+ "declaration": false
+ }
+}
diff --git a/types/17/tsconfig.json b/types/17/tsconfig.json
new file mode 100644
index 00000000..1a9d5696
--- /dev/null
+++ b/types/17/tsconfig.json
@@ -0,0 +1,9 @@
+{
+ "extends": "../../tsconfig.json",
+ "compilerOptions": {
+ "outDir": "dist",
+ "rootDir": "src/"
+ },
+ "include": ["src/**/*.ts"],
+ "exclude": ["dist", "node_modules", "**/*.spec.*", "**/*.test.*"]
+}
diff --git a/versions/13/LICENSE b/versions/13/LICENSE
new file mode 100644
index 00000000..883d29d0
--- /dev/null
+++ b/versions/13/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2021 Dan Lynch
+Copyright (c) 2025 Interweb, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/versions/13/Makefile b/versions/13/Makefile
new file mode 100644
index 00000000..bcee4c4c
--- /dev/null
+++ b/versions/13/Makefile
@@ -0,0 +1,92 @@
+WASM_OUT_DIR := wasm
+WASM_OUT_NAME := libpg-query
+WASM_MODULE_NAME := PgQueryModule
+LIBPG_QUERY_REPO := https://github.com/pganalyze/libpg_query.git
+LIBPG_QUERY_TAG := 13-2.2.0
+
+CACHE_DIR := .cache
+
+OS ?= $(shell uname -s)
+ARCH ?= $(shell uname -m)
+
+ifdef EMSCRIPTEN
+PLATFORM := emscripten
+else ifeq ($(OS),Darwin)
+PLATFORM := darwin
+else ifeq ($(OS),Linux)
+PLATFORM := linux
+else
+$(error Unsupported platform: $(OS))
+endif
+
+ifdef EMSCRIPTEN
+ARCH := wasm
+endif
+
+PLATFORM_ARCH := $(PLATFORM)-$(ARCH)
+SRC_FILES := src/wasm_wrapper.c
+LIBPG_QUERY_DIR := $(CACHE_DIR)/$(PLATFORM_ARCH)/libpg_query/$(LIBPG_QUERY_TAG)
+LIBPG_QUERY_ARCHIVE := $(LIBPG_QUERY_DIR)/libpg_query.a
+LIBPG_QUERY_HEADER := $(LIBPG_QUERY_DIR)/pg_query.h
+CXXFLAGS := -O3 -flto
+
+ifdef EMSCRIPTEN
+OUT_FILES := $(foreach EXT,.js .wasm,$(WASM_OUT_DIR)/$(WASM_OUT_NAME)$(EXT))
+else
+$(error Native builds are no longer supported. Use EMSCRIPTEN=1 for WASM builds only.)
+endif
+
+# Clone libpg_query source (lives in CACHE_DIR)
+$(LIBPG_QUERY_DIR):
+ mkdir -p $(CACHE_DIR)
+ git clone -b $(LIBPG_QUERY_TAG) --single-branch $(LIBPG_QUERY_REPO) $(LIBPG_QUERY_DIR)
+ifdef EMSCRIPTEN
+ cd $(LIBPG_QUERY_DIR); patch -p1 < $(shell pwd)/patches/emscripten_disable_spinlocks.patch
+endif
+
+$(LIBPG_QUERY_HEADER): $(LIBPG_QUERY_DIR)
+
+# Build libpg_query
+$(LIBPG_QUERY_ARCHIVE): $(LIBPG_QUERY_DIR)
+ cd $(LIBPG_QUERY_DIR); $(MAKE) build
+
+# Build libpg-query-node WASM module
+$(OUT_FILES): $(LIBPG_QUERY_ARCHIVE) $(LIBPG_QUERY_HEADER) $(SRC_FILES)
+ifdef EMSCRIPTEN
+ mkdir -p $(WASM_OUT_DIR)
+ $(CC) \
+ -v \
+ $(CXXFLAGS) \
+ -I$(LIBPG_QUERY_DIR) \
+ -I$(LIBPG_QUERY_DIR)/vendor \
+ -L$(LIBPG_QUERY_DIR) \
+ -sEXPORTED_FUNCTIONS="['_malloc','_free','_wasm_parse_query','_wasm_free_string']" \
+ -sEXPORTED_RUNTIME_METHODS="['lengthBytesUTF8','stringToUTF8','UTF8ToString','HEAPU8','HEAPU32']" \
+ -sEXPORT_NAME="$(WASM_MODULE_NAME)" \
+ -sENVIRONMENT="web,node" \
+ -sMODULARIZE=1 \
+ -sEXPORT_ES6=0 \
+ -sALLOW_MEMORY_GROWTH=1 \
+ -lpg_query \
+ -o $@ \
+ $(SRC_FILES)
+else
+$(error Native builds are no longer supported. Use EMSCRIPTEN=1 for WASM builds only.)
+endif
+
+# Commands
+build: $(OUT_FILES)
+
+build-cache: $(LIBPG_QUERY_ARCHIVE) $(LIBPG_QUERY_HEADER)
+
+rebuild: clean build
+
+rebuild-cache: clean-cache build-cache
+
+clean:
+ -@ rm -r $(OUT_FILES) > /dev/null 2>&1
+
+clean-cache:
+ -@ rm -rf $(LIBPG_QUERY_DIR)
+
+.PHONY: build build-cache rebuild rebuild-cache clean clean-cache
diff --git a/versions/13/README.md b/versions/13/README.md
new file mode 100644
index 00000000..5da03391
--- /dev/null
+++ b/versions/13/README.md
@@ -0,0 +1,274 @@
+# libpg-query
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+
+# 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](https://github.com/pyramation/pgsql-parser), this library delivers full fidelity with the Postgres C codebase β no rewrites, no shortcuts.
+
+### Features
+
+* π§ **Powered by PostgreSQL** β Uses the official Postgres C parser compiled to WebAssembly
+* π₯οΈ **Cross-Platform** β Runs smoothly on macOS, Linux, and Windows
+* π **Node.js & Browser Support** β Consistent behavior in any JS environment
+* π¦ **No Native Builds Required** β No compilation, no system-specific dependencies
+* π§ **Spec-Accurate Parsing** β Produces faithful, standards-compliant ASTs
+* π **Production-Grade** β Powers tools like [`pgsql-parser`](https://github.com/pyramation/pgsql-parser)
+
+## Installation
+
+```sh
+npm install libpg-query
+```
+
+## Usage
+
+### `parse(query: string): Promise`
+
+Parses the SQL and returns a Promise for the parse tree. May reject with a parse error.
+
+```typescript
+import { parse } from 'libpg-query';
+
+const result = await parse('SELECT * FROM users WHERE active = true');
+// Returns: ParseResult - parsed query object
+```
+
+### `parseSync(query: string): ParseResult`
+
+Synchronous version that returns the parse tree directly. May throw a parse error.
+
+```typescript
+import { parseSync } from 'libpg-query';
+
+const result = parseSync('SELECT * FROM users WHERE active = true');
+// Returns: ParseResult - parsed query object
+```
+
+
+
+
+
+
+### Initialization
+
+The library provides both async and sync methods. Async methods handle initialization automatically, while sync methods require explicit initialization.
+
+#### Async Methods (Recommended)
+
+Async methods handle initialization automatically and are always safe to use:
+
+```typescript
+import { parse } from 'libpg-query';
+
+// These handle initialization automatically
+const result = await parse('SELECT * FROM users');
+```
+
+#### Sync Methods
+
+Sync methods require explicit initialization using `loadModule()`:
+
+```typescript
+import { loadModule, parseSync } from 'libpg-query';
+
+// Initialize first
+await loadModule();
+
+// Now safe to use sync methods
+const result = parseSync('SELECT * FROM users');
+```
+
+### `loadModule(): Promise`
+
+Explicitly initializes the WASM module. Required before using any sync methods.
+
+```typescript
+import { loadModule, parseSync } from 'libpg-query';
+
+// Initialize before using sync methods
+await loadModule();
+const result = parseSync('SELECT * FROM users');
+```
+
+Note: We recommend using async methods as they handle initialization automatically. Use sync methods only when necessary, and always call `loadModule()` first.
+
+### Type Definitions
+
+```typescript
+interface ParseResult {
+ version: number;
+ stmts: Statement[];
+}
+
+interface Statement {
+ stmt_type: string;
+ stmt_len: number;
+ stmt_location: number;
+ query: string;
+}
+
+interface ScanResult {
+ version: number;
+ tokens: ScanToken[];
+}
+
+interface ScanToken {
+ start: number; // Starting position in the SQL string
+ end: number; // Ending position in the SQL string
+ text: string; // The actual token text
+ tokenType: number; // Numeric token type identifier
+ tokenName: string; // Human-readable token type name
+ keywordKind: number; // Numeric keyword classification
+ keywordName: string; // Human-readable keyword classification
+}
+```
+
+**Note:** The return value is an array, as multiple queries may be provided in a single string (semicolon-delimited, as PostgreSQL expects).
+
+## Build Instructions
+
+This package uses a **WASM-only build system** for true cross-platform compatibility without native compilation dependencies.
+
+### Prerequisites
+
+- Node.js (version 16 or higher recommended)
+- [pnpm](https://pnpm.io/) (v8+ recommended)
+
+### Building WASM Artifacts
+
+1. **Install dependencies:**
+ ```bash
+ pnpm install
+ ```
+
+2. **Build WASM artifacts:**
+ ```bash
+ pnpm run build
+ ```
+
+3. **Clean WASM build (if needed):**
+ ```bash
+ pnpm run clean
+ ```
+
+4. **Rebuild WASM artifacts from scratch:**
+ ```bash
+ pnpm run clean && pnpm run build
+ ```
+
+### Build Process Details
+
+The WASM build process:
+- Uses Emscripten SDK for compilation
+- Compiles C wrapper code to WebAssembly
+- Generates `wasm/libpg-query.js` and `wasm/libpg-query.wasm` files
+- No native compilation or node-gyp dependencies required
+
+## Testing
+
+### Running Tests
+
+```bash
+pnpm run test
+```
+
+### Test Requirements
+
+- WASM artifacts must be built before running tests
+- If tests fail with "fetch failed" errors, rebuild WASM artifacts:
+ ```bash
+ pnpm run clean && pnpm run build && pnpm run test
+ ```
+
+
+
+## Versions
+
+Our latest is built with `17-latest` branch from libpg_query
+
+
+| PG Major Version | libpg_query | npm dist-tag
+|--------------------------|-------------|---------|
+| 17 | 17-6.1.0 | [`pg17`](https://www.npmjs.com/package/libpg-query/v/latest)
+| 16 | 16-5.2.0 | [`pg16`](https://www.npmjs.com/package/libpg-query/v/pg16)
+| 15 | 15-4.2.4 | [`pg15`](https://www.npmjs.com/package/libpg-query/v/pg15)
+| 14 | 14-3.0.0 | [`pg14`](https://www.npmjs.com/package/libpg-query/v/pg14)
+| 13 | 13-2.2.0 | [`pg13`](https://www.npmjs.com/package/libpg-query/v/pg13)
+| 12 | (n/a) | |
+| 11 | (n/a) | |
+| 10 | 10-latest | | `@1.3.1` ([tree](https://github.com/pyramation/pgsql-parser/tree/39b7b1adc8914253226e286a48105785219a81ca)) |
+
+
+## Troubleshooting
+
+### Common Issues
+
+**"fetch failed" errors during tests:**
+- This indicates stale or missing WASM artifacts
+- Solution: `pnpm run clean && pnpm run build`
+
+**"WASM module not initialized" errors:**
+- Ensure you call an async method first to initialize the WASM module
+- Or use the async versions of methods which handle initialization automatically
+
+**Build environment issues:**
+- Ensure Emscripten SDK is properly installed and configured
+- Check that all required build dependencies are available
+
+### Build Artifacts
+
+The build process generates these files:
+- `wasm/libpg-query.js` - Emscripten-generated JavaScript loader
+- `wasm/libpg-query.wasm` - WebAssembly binary
+- `wasm/index.js` - ES module exports
+- `wasm/index.cjs` - CommonJS exports with sync wrappers
+
+## Related Projects
+
+* [libpg_query](https://github.com/pganalyze/libpg_query)
+* [pgsql-parser](https://github.com/pyramation/pgsql-parser)
+* [pg_query](https://github.com/lfittl/pg_query)
+* [pg_query.go](https://github.com/lfittl/pg_query.go)
+
+## Credit
+
+* 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.
+
+* All credit for the hard problems goes to [Lukas Fittl](https://github.com/lfittl).
+
+* Additional thanks for the original Node.js integration work by [Ethan Resnick](https://github.com/ethanresnick).
+
+* Original [Code](https://github.com/zhm/node-pg-query-native) and [License](https://github.com/zhm/node-pg-query-native/blob/master/LICENSE.md)
+
+## Related
+
+* [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.
+* [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`.
+* [@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.
+* [@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.
+* [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.
+* [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.
+
+## Disclaimer
+
+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.
\ No newline at end of file
diff --git a/versions/13/package.json b/versions/13/package.json
new file mode 100644
index 00000000..b9543e69
--- /dev/null
+++ b/versions/13/package.json
@@ -0,0 +1,52 @@
+{
+ "name": "@libpg-query/v13",
+ "version": "13.4.0",
+ "description": "The real PostgreSQL query parser",
+ "homepage": "https://github.com/launchql/libpg-query-node",
+ "main": "./wasm/index.cjs",
+ "module": "./wasm/index.js",
+ "typings": "./wasm/index.d.ts",
+ "publishConfig": {
+ "access": "public"
+ },
+ "x-publish": {
+ "publishName": "libpg-query",
+ "pgVersion": "13",
+ "distTag": "pg13",
+ "libpgQueryTag": "13-2.2.0"
+ },
+ "files": [
+ "wasm/*"
+ ],
+ "scripts": {
+ "clean": "pnpm wasm:clean && rimraf wasm/*.js wasm/*.cjs wasm/*.d.ts",
+ "build:js": "node scripts/build.js",
+ "build": "pnpm clean && pnpm wasm:build && pnpm build:js",
+ "publish:pkg": "node ../../scripts/publish-versions.js",
+ "wasm:make": "docker run --rm -v $(pwd):/src -u $(id -u):$(id -g) -e EMSCRIPTEN=1 emscripten/emsdk emmake make",
+ "wasm:build": "pnpm wasm:make build",
+ "wasm:rebuild": "pnpm wasm:make rebuild",
+ "wasm:clean": "pnpm wasm:make clean",
+ "wasm:clean-cache": "pnpm wasm:make clean-cache",
+ "test": "node --test test/parsing.test.js"
+ },
+ "author": "Dan Lynch (http://github.com/pyramation)",
+ "license": "LICENSE IN LICENSE",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/launchql/libpg-query-node.git"
+ },
+ "devDependencies": {},
+ "dependencies": {
+ "@pgsql/types": "^13.10.0"
+ },
+ "keywords": [
+ "sql",
+ "postgres",
+ "postgresql",
+ "pg",
+ "query",
+ "plpgsql",
+ "database"
+ ]
+}
\ No newline at end of file
diff --git a/versions/13/patches/emscripten_disable_spinlocks.patch b/versions/13/patches/emscripten_disable_spinlocks.patch
new file mode 100644
index 00000000..dab404f2
--- /dev/null
+++ b/versions/13/patches/emscripten_disable_spinlocks.patch
@@ -0,0 +1,24 @@
+--- a/Makefile
++++ b/Makefile
+@@ -36,6 +36,11 @@ OBJ_FILES := $(filter-out $(NOT_OBJ_FILES), $(SRC_FILES:.c=.o))
+ override CFLAGS += -g -I. -I./vendor -I./src/postgres/include -Wall -Wno-unused-function -Wno-unused-value -Wno-unused-variable -fno-strict-aliasing -fwrapv -fPIC
+
+ override PG_CONFIGURE_FLAGS += -q --without-readline --without-zlib
++
++# Disable spinlocks when building with Emscripten
++ifdef EMSCRIPTEN
++override PG_CONFIGURE_FLAGS += --disable-spinlocks
++endif
+
+ override TEST_CFLAGS += -I. -I./vendor -g
+ override TEST_LDFLAGS += -pthread
+@@ -149,6 +154,9 @@ extract_source: $(PGDIR)
+ echo "#undef LOCALE_T_IN_XLOCALE" >> ./src/postgres/include/pg_config.h
+ echo "#undef WCSTOMBS_L_IN_XLOCALE" >> ./src/postgres/include/pg_config.h
+ # Support 32-bit systems without reconfiguring
++ifdef EMSCRIPTEN
++ echo "#undef HAVE_SPINLOCKS" >> ./src/postgres/include/pg_config.h
++endif
+ echo "#undef PG_INT128_TYPE" >> ./src/postgres/include/pg_config.h
+ # Support gcc earlier than 4.6.0 without reconfiguring
+ echo "#undef HAVE__STATIC_ASSERT" >> ./src/postgres/include/pg_config.h
\ No newline at end of file
diff --git a/versions/13/scripts/build.js b/versions/13/scripts/build.js
new file mode 100644
index 00000000..48c95b8a
--- /dev/null
+++ b/versions/13/scripts/build.js
@@ -0,0 +1,39 @@
+const fs = require('fs');
+const path = require('path');
+const { execSync } = require('child_process');
+
+// Run TypeScript compilation
+console.log('Compiling TypeScript...');
+const tscPath = path.join(__dirname, '../../../node_modules/.bin/tsc');
+execSync(`${tscPath}`, { stdio: 'inherit', cwd: path.join(__dirname, '..') });
+execSync(`${tscPath} -p tsconfig.esm.json`, { stdio: 'inherit', cwd: path.join(__dirname, '..') });
+
+// Rename files to have correct extensions
+const wasmDir = path.join(__dirname, '../wasm');
+const cjsDir = path.join(__dirname, '../cjs');
+const esmDir = path.join(__dirname, '../esm');
+
+// Ensure wasm directory exists
+if (!fs.existsSync(wasmDir)) {
+ fs.mkdirSync(wasmDir, { recursive: true });
+}
+
+// Rename CommonJS files
+fs.renameSync(
+ path.join(cjsDir, 'index.js'),
+ path.join(wasmDir, 'index.cjs')
+);
+
+// Rename ESM files
+fs.renameSync(
+ path.join(esmDir, 'index.js'),
+ path.join(wasmDir, 'index.js')
+);
+
+// Rename declaration files
+fs.renameSync(
+ path.join(cjsDir, 'index.d.ts'),
+ path.join(wasmDir, 'index.d.ts')
+);
+
+console.log('Build completed successfully!');
\ No newline at end of file
diff --git a/versions/13/src/index.ts b/versions/13/src/index.ts
new file mode 100644
index 00000000..28bfd9e4
--- /dev/null
+++ b/versions/13/src/index.ts
@@ -0,0 +1,87 @@
+export * from "@pgsql/types";
+
+// @ts-ignore
+import PgQueryModule from './libpg-query.js';
+
+let wasmModule: any;
+
+const initPromise = PgQueryModule().then((module: any) => {
+ wasmModule = module;
+});
+
+function ensureLoaded() {
+ if (!wasmModule) throw new Error("WASM module not initialized. Call `loadModule()` first.");
+}
+
+export async function loadModule() {
+ if (!wasmModule) {
+ await initPromise;
+ }
+}
+
+function awaitInit any>(fn: T): T {
+ return (async (...args: Parameters) => {
+ await initPromise;
+ return fn(...args);
+ }) as T;
+}
+
+function stringToPtr(str: string): number {
+ ensureLoaded();
+ if (typeof str !== 'string') {
+ throw new TypeError(`Expected a string, got ${typeof str}`);
+ }
+ const len = wasmModule.lengthBytesUTF8(str) + 1;
+ const ptr = wasmModule._malloc(len);
+ try {
+ wasmModule.stringToUTF8(str, ptr, len);
+ return ptr;
+ } catch (error) {
+ wasmModule._free(ptr);
+ throw error;
+ }
+}
+
+function ptrToString(ptr: number): string {
+ ensureLoaded();
+ if (typeof ptr !== 'number') {
+ throw new TypeError(`Expected a number, got ${typeof ptr}`);
+ }
+ return wasmModule.UTF8ToString(ptr);
+}
+
+export const parse = awaitInit(async (query: string) => {
+ const queryPtr = stringToPtr(query);
+ let resultPtr = 0;
+ try {
+ resultPtr = wasmModule._wasm_parse_query(queryPtr);
+ const resultStr = ptrToString(resultPtr);
+ if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
+ throw new Error(resultStr);
+ }
+ return JSON.parse(resultStr);
+ } finally {
+ wasmModule._free(queryPtr);
+ if (resultPtr) {
+ wasmModule._wasm_free_string(resultPtr);
+ }
+ }
+});
+
+export function parseSync(query: string) {
+ const queryPtr = stringToPtr(query);
+ let resultPtr = 0;
+ try {
+ resultPtr = wasmModule._wasm_parse_query(queryPtr);
+ const resultStr = ptrToString(resultPtr);
+ if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
+ throw new Error(resultStr);
+ }
+ return JSON.parse(resultStr);
+ } finally {
+ wasmModule._free(queryPtr);
+ if (resultPtr) {
+ wasmModule._wasm_free_string(resultPtr);
+ }
+ }
+}
\ No newline at end of file
diff --git a/versions/13/src/libpg-query.d.ts b/versions/13/src/libpg-query.d.ts
new file mode 100644
index 00000000..396fef83
--- /dev/null
+++ b/versions/13/src/libpg-query.d.ts
@@ -0,0 +1,15 @@
+declare module './libpg-query.js' {
+ interface WasmModule {
+ _malloc: (size: number) => number;
+ _free: (ptr: number) => void;
+ _wasm_free_string: (ptr: number) => void;
+ _wasm_parse_query: (queryPtr: number) => number;
+ lengthBytesUTF8: (str: string) => number;
+ stringToUTF8: (str: string, ptr: number, len: number) => void;
+ UTF8ToString: (ptr: number) => string;
+ HEAPU8: Uint8Array;
+ }
+
+ const PgQueryModule: () => Promise;
+ export default PgQueryModule;
+}
\ No newline at end of file
diff --git a/versions/13/src/wasm_wrapper.c b/versions/13/src/wasm_wrapper.c
new file mode 100644
index 00000000..bf297c6e
--- /dev/null
+++ b/versions/13/src/wasm_wrapper.c
@@ -0,0 +1,49 @@
+#include
+#include
+#include
+#include
+
+static int validate_input(const char* input) {
+ return input != NULL && strlen(input) > 0;
+}
+
+static char* safe_strdup(const char* str) {
+ if (!str) return NULL;
+ char* result = strdup(str);
+ if (!result) {
+ return NULL;
+ }
+ return result;
+}
+
+static void* safe_malloc(size_t size) {
+ void* ptr = malloc(size);
+ if (!ptr && size > 0) {
+ return NULL;
+ }
+ return ptr;
+}
+
+EMSCRIPTEN_KEEPALIVE
+char* wasm_parse_query(const char* input) {
+ if (!validate_input(input)) {
+ return safe_strdup("Invalid input: query cannot be null or empty");
+ }
+
+ PgQueryParseResult result = pg_query_parse(input);
+
+ if (result.error) {
+ char* error_msg = safe_strdup(result.error->message);
+ pg_query_free_parse_result(result);
+ return error_msg ? error_msg : safe_strdup("Memory allocation failed");
+ }
+
+ char* parse_tree = safe_strdup(result.parse_tree);
+ pg_query_free_parse_result(result);
+ return parse_tree;
+}
+
+EMSCRIPTEN_KEEPALIVE
+void wasm_free_string(char* str) {
+ free(str);
+}
\ No newline at end of file
diff --git a/versions/13/test/parsing.test.js b/versions/13/test/parsing.test.js
new file mode 100644
index 00000000..eec826e5
--- /dev/null
+++ b/versions/13/test/parsing.test.js
@@ -0,0 +1,89 @@
+const { describe, it, before } = require('node:test');
+const assert = require('node:assert/strict');
+const query = require("../");
+
+function removeLocationProperties(obj) {
+ if (typeof obj !== 'object' || obj === null) {
+ return obj;
+ }
+
+ if (Array.isArray(obj)) {
+ return obj.map(item => removeLocationProperties(item));
+ }
+
+ const result = {};
+ for (const key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ if (key === 'location' || key === 'stmt_len' || key === 'stmt_location') {
+ continue; // Skip location-related properties
+ }
+ result[key] = removeLocationProperties(obj[key]);
+ }
+ }
+ return result;
+}
+
+describe("Query Parsing", () => {
+ before(async () => {
+ await query.loadModule();
+ });
+
+ describe("Sync Parsing", () => {
+ it("should return a single-item parse result for common queries", () => {
+ const queries = ["select 1", "select null", "select ''", "select a, b"];
+ const results = queries.map(query.parseSync);
+ results.forEach((res) => {
+ assert.equal(res.stmts.length, 1);
+ });
+
+ const selectedDatas = results.map(
+ (it) => it.stmts[0].stmt.SelectStmt.targetList
+ );
+
+ assert.equal(selectedDatas[0][0].ResTarget.val.A_Const.val.Integer.ival, 1);
+ assert.ok(selectedDatas[1][0].ResTarget.val.A_Const.val.Null);
+ assert.equal(selectedDatas[2][0].ResTarget.val.A_Const.val.String.str, "");
+ assert.equal(selectedDatas[3].length, 2);
+ });
+
+ it("should support parsing multiple queries", () => {
+ const res = query.parseSync("select 1; select null;");
+ assert.deepEqual(
+ res.stmts.map(removeLocationProperties),
+ [
+ ...query.parseSync("select 1;").stmts.map(removeLocationProperties),
+ ...query.parseSync("select null;").stmts.map(removeLocationProperties),
+ ]
+ );
+ });
+
+ it("should not parse a bogus query", () => {
+ assert.throws(
+ () => query.parseSync("NOT A QUERY"),
+ Error
+ );
+ });
+ });
+
+ describe("Async parsing", () => {
+ it("should return a promise resolving to same result", async () => {
+ const testQuery = "select * from john;";
+ const resPromise = query.parse(testQuery);
+ const res = await resPromise;
+
+ assert.ok(resPromise instanceof Promise);
+ assert.deepEqual(res, query.parseSync(testQuery));
+ });
+
+ it("should reject on bogus queries", async () => {
+ await assert.rejects(
+ query.parse("NOT A QUERY"),
+ (err) => {
+ assert.ok(err instanceof Error);
+ assert.match(err.message, /NOT/);
+ return true;
+ }
+ );
+ });
+ });
+});
diff --git a/versions/13/tsconfig.esm.json b/versions/13/tsconfig.esm.json
new file mode 100644
index 00000000..63012c17
--- /dev/null
+++ b/versions/13/tsconfig.esm.json
@@ -0,0 +1,9 @@
+{
+ "extends": "./tsconfig.json",
+ "compilerOptions": {
+ "module": "es2022",
+ "rootDir": "src/",
+ "declaration": false,
+ "outDir": "esm/"
+ }
+ }
\ No newline at end of file
diff --git a/versions/13/tsconfig.json b/versions/13/tsconfig.json
new file mode 100644
index 00000000..d7da207b
--- /dev/null
+++ b/versions/13/tsconfig.json
@@ -0,0 +1,18 @@
+{
+ "compilerOptions": {
+ "target": "es2022",
+ "module": "commonjs",
+ "esModuleInterop": true,
+ "forceConsistentCasingInFileNames": true,
+ "strict": true,
+ "strictNullChecks": false,
+ "skipLibCheck": true,
+ "sourceMap": false,
+ "declaration": true,
+ "resolveJsonModule": true,
+ "moduleResolution": "node",
+ "outDir": "cjs/",
+ "rootDir": "src"
+ },
+ "exclude": ["cjs", "esm", "wasm", "node_modules", "**/*.test.ts"]
+}
\ No newline at end of file
diff --git a/versions/14/LICENSE b/versions/14/LICENSE
new file mode 100644
index 00000000..883d29d0
--- /dev/null
+++ b/versions/14/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2021 Dan Lynch
+Copyright (c) 2025 Interweb, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/versions/14/Makefile b/versions/14/Makefile
new file mode 100644
index 00000000..a3267dd9
--- /dev/null
+++ b/versions/14/Makefile
@@ -0,0 +1,89 @@
+WASM_OUT_DIR := wasm
+WASM_OUT_NAME := libpg-query
+WASM_MODULE_NAME := PgQueryModule
+LIBPG_QUERY_REPO := https://github.com/pganalyze/libpg_query.git
+LIBPG_QUERY_TAG := 14-3.0.0
+
+CACHE_DIR := .cache
+
+OS ?= $(shell uname -s)
+ARCH ?= $(shell uname -m)
+
+ifdef EMSCRIPTEN
+PLATFORM := emscripten
+else ifeq ($(OS),Darwin)
+PLATFORM := darwin
+else ifeq ($(OS),Linux)
+PLATFORM := linux
+else
+$(error Unsupported platform: $(OS))
+endif
+
+ifdef EMSCRIPTEN
+ARCH := wasm
+endif
+
+PLATFORM_ARCH := $(PLATFORM)-$(ARCH)
+SRC_FILES := src/wasm_wrapper.c
+LIBPG_QUERY_DIR := $(CACHE_DIR)/$(PLATFORM_ARCH)/libpg_query/$(LIBPG_QUERY_TAG)
+LIBPG_QUERY_ARCHIVE := $(LIBPG_QUERY_DIR)/libpg_query.a
+LIBPG_QUERY_HEADER := $(LIBPG_QUERY_DIR)/pg_query.h
+CXXFLAGS := -O3 -flto
+
+ifdef EMSCRIPTEN
+OUT_FILES := $(foreach EXT,.js .wasm,$(WASM_OUT_DIR)/$(WASM_OUT_NAME)$(EXT))
+else
+$(error Native builds are no longer supported. Use EMSCRIPTEN=1 for WASM builds only.)
+endif
+
+# Clone libpg_query source (lives in CACHE_DIR)
+$(LIBPG_QUERY_DIR):
+ mkdir -p $(CACHE_DIR)
+ git clone -b $(LIBPG_QUERY_TAG) --single-branch $(LIBPG_QUERY_REPO) $(LIBPG_QUERY_DIR)
+
+$(LIBPG_QUERY_HEADER): $(LIBPG_QUERY_DIR)
+
+# Build libpg_query
+$(LIBPG_QUERY_ARCHIVE): $(LIBPG_QUERY_DIR)
+ cd $(LIBPG_QUERY_DIR); $(MAKE) build
+
+# Build libpg-query-node WASM module
+$(OUT_FILES): $(LIBPG_QUERY_ARCHIVE) $(LIBPG_QUERY_HEADER) $(SRC_FILES)
+ifdef EMSCRIPTEN
+ mkdir -p $(WASM_OUT_DIR)
+ $(CC) \
+ -v \
+ $(CXXFLAGS) \
+ -I$(LIBPG_QUERY_DIR) \
+ -I$(LIBPG_QUERY_DIR)/vendor \
+ -L$(LIBPG_QUERY_DIR) \
+ -sEXPORTED_FUNCTIONS="['_malloc','_free','_wasm_parse_query','_wasm_free_string']" \
+ -sEXPORTED_RUNTIME_METHODS="['lengthBytesUTF8','stringToUTF8','UTF8ToString','HEAPU8','HEAPU32']" \
+ -sEXPORT_NAME="$(WASM_MODULE_NAME)" \
+ -sENVIRONMENT="web,node" \
+ -sMODULARIZE=1 \
+ -sEXPORT_ES6=0 \
+ -sALLOW_MEMORY_GROWTH=1 \
+ -lpg_query \
+ -o $@ \
+ $(SRC_FILES)
+else
+$(error Native builds are no longer supported. Use EMSCRIPTEN=1 for WASM builds only.)
+endif
+
+# Commands
+build: $(OUT_FILES)
+
+build-cache: $(LIBPG_QUERY_ARCHIVE) $(LIBPG_QUERY_HEADER)
+
+rebuild: clean build
+
+rebuild-cache: clean-cache build-cache
+
+clean:
+ -@ rm -r $(OUT_FILES) > /dev/null 2>&1
+
+clean-cache:
+ -@ rm -rf $(LIBPG_QUERY_DIR)
+
+.PHONY: build build-cache rebuild rebuild-cache clean clean-cache
diff --git a/versions/14/README.md b/versions/14/README.md
new file mode 100644
index 00000000..5da03391
--- /dev/null
+++ b/versions/14/README.md
@@ -0,0 +1,274 @@
+# libpg-query
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+
+# 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](https://github.com/pyramation/pgsql-parser), this library delivers full fidelity with the Postgres C codebase β no rewrites, no shortcuts.
+
+### Features
+
+* π§ **Powered by PostgreSQL** β Uses the official Postgres C parser compiled to WebAssembly
+* π₯οΈ **Cross-Platform** β Runs smoothly on macOS, Linux, and Windows
+* π **Node.js & Browser Support** β Consistent behavior in any JS environment
+* π¦ **No Native Builds Required** β No compilation, no system-specific dependencies
+* π§ **Spec-Accurate Parsing** β Produces faithful, standards-compliant ASTs
+* π **Production-Grade** β Powers tools like [`pgsql-parser`](https://github.com/pyramation/pgsql-parser)
+
+## Installation
+
+```sh
+npm install libpg-query
+```
+
+## Usage
+
+### `parse(query: string): Promise`
+
+Parses the SQL and returns a Promise for the parse tree. May reject with a parse error.
+
+```typescript
+import { parse } from 'libpg-query';
+
+const result = await parse('SELECT * FROM users WHERE active = true');
+// Returns: ParseResult - parsed query object
+```
+
+### `parseSync(query: string): ParseResult`
+
+Synchronous version that returns the parse tree directly. May throw a parse error.
+
+```typescript
+import { parseSync } from 'libpg-query';
+
+const result = parseSync('SELECT * FROM users WHERE active = true');
+// Returns: ParseResult - parsed query object
+```
+
+
+
+
+
+
+### Initialization
+
+The library provides both async and sync methods. Async methods handle initialization automatically, while sync methods require explicit initialization.
+
+#### Async Methods (Recommended)
+
+Async methods handle initialization automatically and are always safe to use:
+
+```typescript
+import { parse } from 'libpg-query';
+
+// These handle initialization automatically
+const result = await parse('SELECT * FROM users');
+```
+
+#### Sync Methods
+
+Sync methods require explicit initialization using `loadModule()`:
+
+```typescript
+import { loadModule, parseSync } from 'libpg-query';
+
+// Initialize first
+await loadModule();
+
+// Now safe to use sync methods
+const result = parseSync('SELECT * FROM users');
+```
+
+### `loadModule(): Promise`
+
+Explicitly initializes the WASM module. Required before using any sync methods.
+
+```typescript
+import { loadModule, parseSync } from 'libpg-query';
+
+// Initialize before using sync methods
+await loadModule();
+const result = parseSync('SELECT * FROM users');
+```
+
+Note: We recommend using async methods as they handle initialization automatically. Use sync methods only when necessary, and always call `loadModule()` first.
+
+### Type Definitions
+
+```typescript
+interface ParseResult {
+ version: number;
+ stmts: Statement[];
+}
+
+interface Statement {
+ stmt_type: string;
+ stmt_len: number;
+ stmt_location: number;
+ query: string;
+}
+
+interface ScanResult {
+ version: number;
+ tokens: ScanToken[];
+}
+
+interface ScanToken {
+ start: number; // Starting position in the SQL string
+ end: number; // Ending position in the SQL string
+ text: string; // The actual token text
+ tokenType: number; // Numeric token type identifier
+ tokenName: string; // Human-readable token type name
+ keywordKind: number; // Numeric keyword classification
+ keywordName: string; // Human-readable keyword classification
+}
+```
+
+**Note:** The return value is an array, as multiple queries may be provided in a single string (semicolon-delimited, as PostgreSQL expects).
+
+## Build Instructions
+
+This package uses a **WASM-only build system** for true cross-platform compatibility without native compilation dependencies.
+
+### Prerequisites
+
+- Node.js (version 16 or higher recommended)
+- [pnpm](https://pnpm.io/) (v8+ recommended)
+
+### Building WASM Artifacts
+
+1. **Install dependencies:**
+ ```bash
+ pnpm install
+ ```
+
+2. **Build WASM artifacts:**
+ ```bash
+ pnpm run build
+ ```
+
+3. **Clean WASM build (if needed):**
+ ```bash
+ pnpm run clean
+ ```
+
+4. **Rebuild WASM artifacts from scratch:**
+ ```bash
+ pnpm run clean && pnpm run build
+ ```
+
+### Build Process Details
+
+The WASM build process:
+- Uses Emscripten SDK for compilation
+- Compiles C wrapper code to WebAssembly
+- Generates `wasm/libpg-query.js` and `wasm/libpg-query.wasm` files
+- No native compilation or node-gyp dependencies required
+
+## Testing
+
+### Running Tests
+
+```bash
+pnpm run test
+```
+
+### Test Requirements
+
+- WASM artifacts must be built before running tests
+- If tests fail with "fetch failed" errors, rebuild WASM artifacts:
+ ```bash
+ pnpm run clean && pnpm run build && pnpm run test
+ ```
+
+
+
+## Versions
+
+Our latest is built with `17-latest` branch from libpg_query
+
+
+| PG Major Version | libpg_query | npm dist-tag
+|--------------------------|-------------|---------|
+| 17 | 17-6.1.0 | [`pg17`](https://www.npmjs.com/package/libpg-query/v/latest)
+| 16 | 16-5.2.0 | [`pg16`](https://www.npmjs.com/package/libpg-query/v/pg16)
+| 15 | 15-4.2.4 | [`pg15`](https://www.npmjs.com/package/libpg-query/v/pg15)
+| 14 | 14-3.0.0 | [`pg14`](https://www.npmjs.com/package/libpg-query/v/pg14)
+| 13 | 13-2.2.0 | [`pg13`](https://www.npmjs.com/package/libpg-query/v/pg13)
+| 12 | (n/a) | |
+| 11 | (n/a) | |
+| 10 | 10-latest | | `@1.3.1` ([tree](https://github.com/pyramation/pgsql-parser/tree/39b7b1adc8914253226e286a48105785219a81ca)) |
+
+
+## Troubleshooting
+
+### Common Issues
+
+**"fetch failed" errors during tests:**
+- This indicates stale or missing WASM artifacts
+- Solution: `pnpm run clean && pnpm run build`
+
+**"WASM module not initialized" errors:**
+- Ensure you call an async method first to initialize the WASM module
+- Or use the async versions of methods which handle initialization automatically
+
+**Build environment issues:**
+- Ensure Emscripten SDK is properly installed and configured
+- Check that all required build dependencies are available
+
+### Build Artifacts
+
+The build process generates these files:
+- `wasm/libpg-query.js` - Emscripten-generated JavaScript loader
+- `wasm/libpg-query.wasm` - WebAssembly binary
+- `wasm/index.js` - ES module exports
+- `wasm/index.cjs` - CommonJS exports with sync wrappers
+
+## Related Projects
+
+* [libpg_query](https://github.com/pganalyze/libpg_query)
+* [pgsql-parser](https://github.com/pyramation/pgsql-parser)
+* [pg_query](https://github.com/lfittl/pg_query)
+* [pg_query.go](https://github.com/lfittl/pg_query.go)
+
+## Credit
+
+* 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.
+
+* All credit for the hard problems goes to [Lukas Fittl](https://github.com/lfittl).
+
+* Additional thanks for the original Node.js integration work by [Ethan Resnick](https://github.com/ethanresnick).
+
+* Original [Code](https://github.com/zhm/node-pg-query-native) and [License](https://github.com/zhm/node-pg-query-native/blob/master/LICENSE.md)
+
+## Related
+
+* [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.
+* [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`.
+* [@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.
+* [@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.
+* [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.
+* [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.
+
+## Disclaimer
+
+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.
\ No newline at end of file
diff --git a/versions/14/package.json b/versions/14/package.json
new file mode 100644
index 00000000..2c1ecd89
--- /dev/null
+++ b/versions/14/package.json
@@ -0,0 +1,52 @@
+{
+ "name": "@libpg-query/v14",
+ "version": "14.1.0",
+ "description": "The real PostgreSQL query parser",
+ "homepage": "https://github.com/launchql/libpg-query-node",
+ "main": "./wasm/index.cjs",
+ "module": "./wasm/index.js",
+ "typings": "./wasm/index.d.ts",
+ "publishConfig": {
+ "access": "public"
+ },
+ "x-publish": {
+ "publishName": "libpg-query",
+ "pgVersion": "14",
+ "distTag": "pg14",
+ "libpgQueryTag": "14-3.0.0"
+ },
+ "files": [
+ "wasm/*"
+ ],
+ "scripts": {
+ "clean": "pnpm wasm:clean && rimraf wasm/*.js wasm/*.cjs wasm/*.d.ts",
+ "build:js": "node scripts/build.js",
+ "build": "pnpm clean && pnpm wasm:build && pnpm build:js",
+ "publish:pkg": "node ../../scripts/publish-versions.js",
+ "wasm:make": "docker run --rm -v $(pwd):/src -u $(id -u):$(id -g) emscripten/emsdk emmake make",
+ "wasm:build": "pnpm wasm:make build",
+ "wasm:rebuild": "pnpm wasm:make rebuild",
+ "wasm:clean": "pnpm wasm:make clean",
+ "wasm:clean-cache": "pnpm wasm:make clean-cache",
+ "test": "node --test test/parsing.test.js"
+ },
+ "author": "Dan Lynch (http://github.com/pyramation)",
+ "license": "LICENSE IN LICENSE",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/launchql/libpg-query-node.git"
+ },
+ "devDependencies": {},
+ "dependencies": {
+ "@pgsql/types": "^14.0.0"
+ },
+ "keywords": [
+ "sql",
+ "postgres",
+ "postgresql",
+ "pg",
+ "query",
+ "plpgsql",
+ "database"
+ ]
+}
\ No newline at end of file
diff --git a/versions/14/scripts/build.js b/versions/14/scripts/build.js
new file mode 100644
index 00000000..48c95b8a
--- /dev/null
+++ b/versions/14/scripts/build.js
@@ -0,0 +1,39 @@
+const fs = require('fs');
+const path = require('path');
+const { execSync } = require('child_process');
+
+// Run TypeScript compilation
+console.log('Compiling TypeScript...');
+const tscPath = path.join(__dirname, '../../../node_modules/.bin/tsc');
+execSync(`${tscPath}`, { stdio: 'inherit', cwd: path.join(__dirname, '..') });
+execSync(`${tscPath} -p tsconfig.esm.json`, { stdio: 'inherit', cwd: path.join(__dirname, '..') });
+
+// Rename files to have correct extensions
+const wasmDir = path.join(__dirname, '../wasm');
+const cjsDir = path.join(__dirname, '../cjs');
+const esmDir = path.join(__dirname, '../esm');
+
+// Ensure wasm directory exists
+if (!fs.existsSync(wasmDir)) {
+ fs.mkdirSync(wasmDir, { recursive: true });
+}
+
+// Rename CommonJS files
+fs.renameSync(
+ path.join(cjsDir, 'index.js'),
+ path.join(wasmDir, 'index.cjs')
+);
+
+// Rename ESM files
+fs.renameSync(
+ path.join(esmDir, 'index.js'),
+ path.join(wasmDir, 'index.js')
+);
+
+// Rename declaration files
+fs.renameSync(
+ path.join(cjsDir, 'index.d.ts'),
+ path.join(wasmDir, 'index.d.ts')
+);
+
+console.log('Build completed successfully!');
\ No newline at end of file
diff --git a/versions/14/src/index.ts b/versions/14/src/index.ts
new file mode 100644
index 00000000..28bfd9e4
--- /dev/null
+++ b/versions/14/src/index.ts
@@ -0,0 +1,87 @@
+export * from "@pgsql/types";
+
+// @ts-ignore
+import PgQueryModule from './libpg-query.js';
+
+let wasmModule: any;
+
+const initPromise = PgQueryModule().then((module: any) => {
+ wasmModule = module;
+});
+
+function ensureLoaded() {
+ if (!wasmModule) throw new Error("WASM module not initialized. Call `loadModule()` first.");
+}
+
+export async function loadModule() {
+ if (!wasmModule) {
+ await initPromise;
+ }
+}
+
+function awaitInit any>(fn: T): T {
+ return (async (...args: Parameters) => {
+ await initPromise;
+ return fn(...args);
+ }) as T;
+}
+
+function stringToPtr(str: string): number {
+ ensureLoaded();
+ if (typeof str !== 'string') {
+ throw new TypeError(`Expected a string, got ${typeof str}`);
+ }
+ const len = wasmModule.lengthBytesUTF8(str) + 1;
+ const ptr = wasmModule._malloc(len);
+ try {
+ wasmModule.stringToUTF8(str, ptr, len);
+ return ptr;
+ } catch (error) {
+ wasmModule._free(ptr);
+ throw error;
+ }
+}
+
+function ptrToString(ptr: number): string {
+ ensureLoaded();
+ if (typeof ptr !== 'number') {
+ throw new TypeError(`Expected a number, got ${typeof ptr}`);
+ }
+ return wasmModule.UTF8ToString(ptr);
+}
+
+export const parse = awaitInit(async (query: string) => {
+ const queryPtr = stringToPtr(query);
+ let resultPtr = 0;
+ try {
+ resultPtr = wasmModule._wasm_parse_query(queryPtr);
+ const resultStr = ptrToString(resultPtr);
+ if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
+ throw new Error(resultStr);
+ }
+ return JSON.parse(resultStr);
+ } finally {
+ wasmModule._free(queryPtr);
+ if (resultPtr) {
+ wasmModule._wasm_free_string(resultPtr);
+ }
+ }
+});
+
+export function parseSync(query: string) {
+ const queryPtr = stringToPtr(query);
+ let resultPtr = 0;
+ try {
+ resultPtr = wasmModule._wasm_parse_query(queryPtr);
+ const resultStr = ptrToString(resultPtr);
+ if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
+ throw new Error(resultStr);
+ }
+ return JSON.parse(resultStr);
+ } finally {
+ wasmModule._free(queryPtr);
+ if (resultPtr) {
+ wasmModule._wasm_free_string(resultPtr);
+ }
+ }
+}
\ No newline at end of file
diff --git a/versions/14/src/libpg-query.d.ts b/versions/14/src/libpg-query.d.ts
new file mode 100644
index 00000000..396fef83
--- /dev/null
+++ b/versions/14/src/libpg-query.d.ts
@@ -0,0 +1,15 @@
+declare module './libpg-query.js' {
+ interface WasmModule {
+ _malloc: (size: number) => number;
+ _free: (ptr: number) => void;
+ _wasm_free_string: (ptr: number) => void;
+ _wasm_parse_query: (queryPtr: number) => number;
+ lengthBytesUTF8: (str: string) => number;
+ stringToUTF8: (str: string, ptr: number, len: number) => void;
+ UTF8ToString: (ptr: number) => string;
+ HEAPU8: Uint8Array;
+ }
+
+ const PgQueryModule: () => Promise;
+ export default PgQueryModule;
+}
\ No newline at end of file
diff --git a/versions/14/src/wasm_wrapper.c b/versions/14/src/wasm_wrapper.c
new file mode 100644
index 00000000..bf297c6e
--- /dev/null
+++ b/versions/14/src/wasm_wrapper.c
@@ -0,0 +1,49 @@
+#include
+#include
+#include
+#include
+
+static int validate_input(const char* input) {
+ return input != NULL && strlen(input) > 0;
+}
+
+static char* safe_strdup(const char* str) {
+ if (!str) return NULL;
+ char* result = strdup(str);
+ if (!result) {
+ return NULL;
+ }
+ return result;
+}
+
+static void* safe_malloc(size_t size) {
+ void* ptr = malloc(size);
+ if (!ptr && size > 0) {
+ return NULL;
+ }
+ return ptr;
+}
+
+EMSCRIPTEN_KEEPALIVE
+char* wasm_parse_query(const char* input) {
+ if (!validate_input(input)) {
+ return safe_strdup("Invalid input: query cannot be null or empty");
+ }
+
+ PgQueryParseResult result = pg_query_parse(input);
+
+ if (result.error) {
+ char* error_msg = safe_strdup(result.error->message);
+ pg_query_free_parse_result(result);
+ return error_msg ? error_msg : safe_strdup("Memory allocation failed");
+ }
+
+ char* parse_tree = safe_strdup(result.parse_tree);
+ pg_query_free_parse_result(result);
+ return parse_tree;
+}
+
+EMSCRIPTEN_KEEPALIVE
+void wasm_free_string(char* str) {
+ free(str);
+}
\ No newline at end of file
diff --git a/versions/14/test/parsing.test.js b/versions/14/test/parsing.test.js
new file mode 100644
index 00000000..eec826e5
--- /dev/null
+++ b/versions/14/test/parsing.test.js
@@ -0,0 +1,89 @@
+const { describe, it, before } = require('node:test');
+const assert = require('node:assert/strict');
+const query = require("../");
+
+function removeLocationProperties(obj) {
+ if (typeof obj !== 'object' || obj === null) {
+ return obj;
+ }
+
+ if (Array.isArray(obj)) {
+ return obj.map(item => removeLocationProperties(item));
+ }
+
+ const result = {};
+ for (const key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ if (key === 'location' || key === 'stmt_len' || key === 'stmt_location') {
+ continue; // Skip location-related properties
+ }
+ result[key] = removeLocationProperties(obj[key]);
+ }
+ }
+ return result;
+}
+
+describe("Query Parsing", () => {
+ before(async () => {
+ await query.loadModule();
+ });
+
+ describe("Sync Parsing", () => {
+ it("should return a single-item parse result for common queries", () => {
+ const queries = ["select 1", "select null", "select ''", "select a, b"];
+ const results = queries.map(query.parseSync);
+ results.forEach((res) => {
+ assert.equal(res.stmts.length, 1);
+ });
+
+ const selectedDatas = results.map(
+ (it) => it.stmts[0].stmt.SelectStmt.targetList
+ );
+
+ assert.equal(selectedDatas[0][0].ResTarget.val.A_Const.val.Integer.ival, 1);
+ assert.ok(selectedDatas[1][0].ResTarget.val.A_Const.val.Null);
+ assert.equal(selectedDatas[2][0].ResTarget.val.A_Const.val.String.str, "");
+ assert.equal(selectedDatas[3].length, 2);
+ });
+
+ it("should support parsing multiple queries", () => {
+ const res = query.parseSync("select 1; select null;");
+ assert.deepEqual(
+ res.stmts.map(removeLocationProperties),
+ [
+ ...query.parseSync("select 1;").stmts.map(removeLocationProperties),
+ ...query.parseSync("select null;").stmts.map(removeLocationProperties),
+ ]
+ );
+ });
+
+ it("should not parse a bogus query", () => {
+ assert.throws(
+ () => query.parseSync("NOT A QUERY"),
+ Error
+ );
+ });
+ });
+
+ describe("Async parsing", () => {
+ it("should return a promise resolving to same result", async () => {
+ const testQuery = "select * from john;";
+ const resPromise = query.parse(testQuery);
+ const res = await resPromise;
+
+ assert.ok(resPromise instanceof Promise);
+ assert.deepEqual(res, query.parseSync(testQuery));
+ });
+
+ it("should reject on bogus queries", async () => {
+ await assert.rejects(
+ query.parse("NOT A QUERY"),
+ (err) => {
+ assert.ok(err instanceof Error);
+ assert.match(err.message, /NOT/);
+ return true;
+ }
+ );
+ });
+ });
+});
diff --git a/versions/14/tsconfig.esm.json b/versions/14/tsconfig.esm.json
new file mode 100644
index 00000000..63012c17
--- /dev/null
+++ b/versions/14/tsconfig.esm.json
@@ -0,0 +1,9 @@
+{
+ "extends": "./tsconfig.json",
+ "compilerOptions": {
+ "module": "es2022",
+ "rootDir": "src/",
+ "declaration": false,
+ "outDir": "esm/"
+ }
+ }
\ No newline at end of file
diff --git a/versions/14/tsconfig.json b/versions/14/tsconfig.json
new file mode 100644
index 00000000..d7da207b
--- /dev/null
+++ b/versions/14/tsconfig.json
@@ -0,0 +1,18 @@
+{
+ "compilerOptions": {
+ "target": "es2022",
+ "module": "commonjs",
+ "esModuleInterop": true,
+ "forceConsistentCasingInFileNames": true,
+ "strict": true,
+ "strictNullChecks": false,
+ "skipLibCheck": true,
+ "sourceMap": false,
+ "declaration": true,
+ "resolveJsonModule": true,
+ "moduleResolution": "node",
+ "outDir": "cjs/",
+ "rootDir": "src"
+ },
+ "exclude": ["cjs", "esm", "wasm", "node_modules", "**/*.test.ts"]
+}
\ No newline at end of file
diff --git a/versions/15/LICENSE b/versions/15/LICENSE
new file mode 100644
index 00000000..883d29d0
--- /dev/null
+++ b/versions/15/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2021 Dan Lynch
+Copyright (c) 2025 Interweb, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/versions/15/Makefile b/versions/15/Makefile
new file mode 100644
index 00000000..161dd31a
--- /dev/null
+++ b/versions/15/Makefile
@@ -0,0 +1,89 @@
+WASM_OUT_DIR := wasm
+WASM_OUT_NAME := libpg-query
+WASM_MODULE_NAME := PgQueryModule
+LIBPG_QUERY_REPO := https://github.com/pganalyze/libpg_query.git
+LIBPG_QUERY_TAG := 15-4.2.4
+
+CACHE_DIR := .cache
+
+OS ?= $(shell uname -s)
+ARCH ?= $(shell uname -m)
+
+ifdef EMSCRIPTEN
+PLATFORM := emscripten
+else ifeq ($(OS),Darwin)
+PLATFORM := darwin
+else ifeq ($(OS),Linux)
+PLATFORM := linux
+else
+$(error Unsupported platform: $(OS))
+endif
+
+ifdef EMSCRIPTEN
+ARCH := wasm
+endif
+
+PLATFORM_ARCH := $(PLATFORM)-$(ARCH)
+SRC_FILES := src/wasm_wrapper.c
+LIBPG_QUERY_DIR := $(CACHE_DIR)/$(PLATFORM_ARCH)/libpg_query/$(LIBPG_QUERY_TAG)
+LIBPG_QUERY_ARCHIVE := $(LIBPG_QUERY_DIR)/libpg_query.a
+LIBPG_QUERY_HEADER := $(LIBPG_QUERY_DIR)/pg_query.h
+CXXFLAGS := -O3 -flto
+
+ifdef EMSCRIPTEN
+OUT_FILES := $(foreach EXT,.js .wasm,$(WASM_OUT_DIR)/$(WASM_OUT_NAME)$(EXT))
+else
+$(error Native builds are no longer supported. Use EMSCRIPTEN=1 for WASM builds only.)
+endif
+
+# Clone libpg_query source (lives in CACHE_DIR)
+$(LIBPG_QUERY_DIR):
+ mkdir -p $(CACHE_DIR)
+ git clone -b $(LIBPG_QUERY_TAG) --single-branch $(LIBPG_QUERY_REPO) $(LIBPG_QUERY_DIR)
+
+$(LIBPG_QUERY_HEADER): $(LIBPG_QUERY_DIR)
+
+# Build libpg_query
+$(LIBPG_QUERY_ARCHIVE): $(LIBPG_QUERY_DIR)
+ cd $(LIBPG_QUERY_DIR); $(MAKE) build
+
+# Build libpg-query-node WASM module
+$(OUT_FILES): $(LIBPG_QUERY_ARCHIVE) $(LIBPG_QUERY_HEADER) $(SRC_FILES)
+ifdef EMSCRIPTEN
+ mkdir -p $(WASM_OUT_DIR)
+ $(CC) \
+ -v \
+ $(CXXFLAGS) \
+ -I$(LIBPG_QUERY_DIR) \
+ -I$(LIBPG_QUERY_DIR)/vendor \
+ -L$(LIBPG_QUERY_DIR) \
+ -sEXPORTED_FUNCTIONS="['_malloc','_free','_wasm_parse_query','_wasm_free_string']" \
+ -sEXPORTED_RUNTIME_METHODS="['lengthBytesUTF8','stringToUTF8','UTF8ToString','HEAPU8','HEAPU32']" \
+ -sEXPORT_NAME="$(WASM_MODULE_NAME)" \
+ -sENVIRONMENT="web,node" \
+ -sMODULARIZE=1 \
+ -sEXPORT_ES6=0 \
+ -sALLOW_MEMORY_GROWTH=1 \
+ -lpg_query \
+ -o $@ \
+ $(SRC_FILES)
+else
+$(error Native builds are no longer supported. Use EMSCRIPTEN=1 for WASM builds only.)
+endif
+
+# Commands
+build: $(OUT_FILES)
+
+build-cache: $(LIBPG_QUERY_ARCHIVE) $(LIBPG_QUERY_HEADER)
+
+rebuild: clean build
+
+rebuild-cache: clean-cache build-cache
+
+clean:
+ -@ rm -r $(OUT_FILES) > /dev/null 2>&1
+
+clean-cache:
+ -@ rm -rf $(LIBPG_QUERY_DIR)
+
+.PHONY: build build-cache rebuild rebuild-cache clean clean-cache
diff --git a/versions/15/README.md b/versions/15/README.md
new file mode 100644
index 00000000..5da03391
--- /dev/null
+++ b/versions/15/README.md
@@ -0,0 +1,274 @@
+# libpg-query
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+
+# 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](https://github.com/pyramation/pgsql-parser), this library delivers full fidelity with the Postgres C codebase β no rewrites, no shortcuts.
+
+### Features
+
+* π§ **Powered by PostgreSQL** β Uses the official Postgres C parser compiled to WebAssembly
+* π₯οΈ **Cross-Platform** β Runs smoothly on macOS, Linux, and Windows
+* π **Node.js & Browser Support** β Consistent behavior in any JS environment
+* π¦ **No Native Builds Required** β No compilation, no system-specific dependencies
+* π§ **Spec-Accurate Parsing** β Produces faithful, standards-compliant ASTs
+* π **Production-Grade** β Powers tools like [`pgsql-parser`](https://github.com/pyramation/pgsql-parser)
+
+## Installation
+
+```sh
+npm install libpg-query
+```
+
+## Usage
+
+### `parse(query: string): Promise`
+
+Parses the SQL and returns a Promise for the parse tree. May reject with a parse error.
+
+```typescript
+import { parse } from 'libpg-query';
+
+const result = await parse('SELECT * FROM users WHERE active = true');
+// Returns: ParseResult - parsed query object
+```
+
+### `parseSync(query: string): ParseResult`
+
+Synchronous version that returns the parse tree directly. May throw a parse error.
+
+```typescript
+import { parseSync } from 'libpg-query';
+
+const result = parseSync('SELECT * FROM users WHERE active = true');
+// Returns: ParseResult - parsed query object
+```
+
+
+
+
+
+
+### Initialization
+
+The library provides both async and sync methods. Async methods handle initialization automatically, while sync methods require explicit initialization.
+
+#### Async Methods (Recommended)
+
+Async methods handle initialization automatically and are always safe to use:
+
+```typescript
+import { parse } from 'libpg-query';
+
+// These handle initialization automatically
+const result = await parse('SELECT * FROM users');
+```
+
+#### Sync Methods
+
+Sync methods require explicit initialization using `loadModule()`:
+
+```typescript
+import { loadModule, parseSync } from 'libpg-query';
+
+// Initialize first
+await loadModule();
+
+// Now safe to use sync methods
+const result = parseSync('SELECT * FROM users');
+```
+
+### `loadModule(): Promise`
+
+Explicitly initializes the WASM module. Required before using any sync methods.
+
+```typescript
+import { loadModule, parseSync } from 'libpg-query';
+
+// Initialize before using sync methods
+await loadModule();
+const result = parseSync('SELECT * FROM users');
+```
+
+Note: We recommend using async methods as they handle initialization automatically. Use sync methods only when necessary, and always call `loadModule()` first.
+
+### Type Definitions
+
+```typescript
+interface ParseResult {
+ version: number;
+ stmts: Statement[];
+}
+
+interface Statement {
+ stmt_type: string;
+ stmt_len: number;
+ stmt_location: number;
+ query: string;
+}
+
+interface ScanResult {
+ version: number;
+ tokens: ScanToken[];
+}
+
+interface ScanToken {
+ start: number; // Starting position in the SQL string
+ end: number; // Ending position in the SQL string
+ text: string; // The actual token text
+ tokenType: number; // Numeric token type identifier
+ tokenName: string; // Human-readable token type name
+ keywordKind: number; // Numeric keyword classification
+ keywordName: string; // Human-readable keyword classification
+}
+```
+
+**Note:** The return value is an array, as multiple queries may be provided in a single string (semicolon-delimited, as PostgreSQL expects).
+
+## Build Instructions
+
+This package uses a **WASM-only build system** for true cross-platform compatibility without native compilation dependencies.
+
+### Prerequisites
+
+- Node.js (version 16 or higher recommended)
+- [pnpm](https://pnpm.io/) (v8+ recommended)
+
+### Building WASM Artifacts
+
+1. **Install dependencies:**
+ ```bash
+ pnpm install
+ ```
+
+2. **Build WASM artifacts:**
+ ```bash
+ pnpm run build
+ ```
+
+3. **Clean WASM build (if needed):**
+ ```bash
+ pnpm run clean
+ ```
+
+4. **Rebuild WASM artifacts from scratch:**
+ ```bash
+ pnpm run clean && pnpm run build
+ ```
+
+### Build Process Details
+
+The WASM build process:
+- Uses Emscripten SDK for compilation
+- Compiles C wrapper code to WebAssembly
+- Generates `wasm/libpg-query.js` and `wasm/libpg-query.wasm` files
+- No native compilation or node-gyp dependencies required
+
+## Testing
+
+### Running Tests
+
+```bash
+pnpm run test
+```
+
+### Test Requirements
+
+- WASM artifacts must be built before running tests
+- If tests fail with "fetch failed" errors, rebuild WASM artifacts:
+ ```bash
+ pnpm run clean && pnpm run build && pnpm run test
+ ```
+
+
+
+## Versions
+
+Our latest is built with `17-latest` branch from libpg_query
+
+
+| PG Major Version | libpg_query | npm dist-tag
+|--------------------------|-------------|---------|
+| 17 | 17-6.1.0 | [`pg17`](https://www.npmjs.com/package/libpg-query/v/latest)
+| 16 | 16-5.2.0 | [`pg16`](https://www.npmjs.com/package/libpg-query/v/pg16)
+| 15 | 15-4.2.4 | [`pg15`](https://www.npmjs.com/package/libpg-query/v/pg15)
+| 14 | 14-3.0.0 | [`pg14`](https://www.npmjs.com/package/libpg-query/v/pg14)
+| 13 | 13-2.2.0 | [`pg13`](https://www.npmjs.com/package/libpg-query/v/pg13)
+| 12 | (n/a) | |
+| 11 | (n/a) | |
+| 10 | 10-latest | | `@1.3.1` ([tree](https://github.com/pyramation/pgsql-parser/tree/39b7b1adc8914253226e286a48105785219a81ca)) |
+
+
+## Troubleshooting
+
+### Common Issues
+
+**"fetch failed" errors during tests:**
+- This indicates stale or missing WASM artifacts
+- Solution: `pnpm run clean && pnpm run build`
+
+**"WASM module not initialized" errors:**
+- Ensure you call an async method first to initialize the WASM module
+- Or use the async versions of methods which handle initialization automatically
+
+**Build environment issues:**
+- Ensure Emscripten SDK is properly installed and configured
+- Check that all required build dependencies are available
+
+### Build Artifacts
+
+The build process generates these files:
+- `wasm/libpg-query.js` - Emscripten-generated JavaScript loader
+- `wasm/libpg-query.wasm` - WebAssembly binary
+- `wasm/index.js` - ES module exports
+- `wasm/index.cjs` - CommonJS exports with sync wrappers
+
+## Related Projects
+
+* [libpg_query](https://github.com/pganalyze/libpg_query)
+* [pgsql-parser](https://github.com/pyramation/pgsql-parser)
+* [pg_query](https://github.com/lfittl/pg_query)
+* [pg_query.go](https://github.com/lfittl/pg_query.go)
+
+## Credit
+
+* 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.
+
+* All credit for the hard problems goes to [Lukas Fittl](https://github.com/lfittl).
+
+* Additional thanks for the original Node.js integration work by [Ethan Resnick](https://github.com/ethanresnick).
+
+* Original [Code](https://github.com/zhm/node-pg-query-native) and [License](https://github.com/zhm/node-pg-query-native/blob/master/LICENSE.md)
+
+## Related
+
+* [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.
+* [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`.
+* [@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.
+* [@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.
+* [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.
+* [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.
+
+## Disclaimer
+
+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.
\ No newline at end of file
diff --git a/versions/15/package.json b/versions/15/package.json
new file mode 100644
index 00000000..0aaa602f
--- /dev/null
+++ b/versions/15/package.json
@@ -0,0 +1,52 @@
+{
+ "name": "@libpg-query/v15",
+ "version": "15.3.0",
+ "description": "The real PostgreSQL query parser",
+ "homepage": "https://github.com/launchql/libpg-query-node",
+ "main": "./wasm/index.cjs",
+ "module": "./wasm/index.js",
+ "typings": "./wasm/index.d.ts",
+ "publishConfig": {
+ "access": "public"
+ },
+ "x-publish": {
+ "publishName": "libpg-query",
+ "pgVersion": "15",
+ "distTag": "pg15",
+ "libpgQueryTag": "15-4.2.4"
+ },
+ "files": [
+ "wasm/*"
+ ],
+ "scripts": {
+ "clean": "pnpm wasm:clean && rimraf wasm/*.js wasm/*.cjs wasm/*.d.ts",
+ "build:js": "node scripts/build.js",
+ "build": "pnpm clean && pnpm wasm:build && pnpm build:js",
+ "publish:pkg": "node ../../scripts/publish-versions.js",
+ "wasm:make": "docker run --rm -v $(pwd):/src -u $(id -u):$(id -g) emscripten/emsdk emmake make",
+ "wasm:build": "pnpm wasm:make build",
+ "wasm:rebuild": "pnpm wasm:make rebuild",
+ "wasm:clean": "pnpm wasm:make clean",
+ "wasm:clean-cache": "pnpm wasm:make clean-cache",
+ "test": "node --test test/parsing.test.js"
+ },
+ "author": "Dan Lynch (http://github.com/pyramation)",
+ "license": "LICENSE IN LICENSE",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/launchql/libpg-query-node.git"
+ },
+ "devDependencies": {},
+ "dependencies": {
+ "@pgsql/types": "^15.0.2"
+ },
+ "keywords": [
+ "sql",
+ "postgres",
+ "postgresql",
+ "pg",
+ "query",
+ "plpgsql",
+ "database"
+ ]
+}
\ No newline at end of file
diff --git a/versions/15/scripts/build.js b/versions/15/scripts/build.js
new file mode 100644
index 00000000..48c95b8a
--- /dev/null
+++ b/versions/15/scripts/build.js
@@ -0,0 +1,39 @@
+const fs = require('fs');
+const path = require('path');
+const { execSync } = require('child_process');
+
+// Run TypeScript compilation
+console.log('Compiling TypeScript...');
+const tscPath = path.join(__dirname, '../../../node_modules/.bin/tsc');
+execSync(`${tscPath}`, { stdio: 'inherit', cwd: path.join(__dirname, '..') });
+execSync(`${tscPath} -p tsconfig.esm.json`, { stdio: 'inherit', cwd: path.join(__dirname, '..') });
+
+// Rename files to have correct extensions
+const wasmDir = path.join(__dirname, '../wasm');
+const cjsDir = path.join(__dirname, '../cjs');
+const esmDir = path.join(__dirname, '../esm');
+
+// Ensure wasm directory exists
+if (!fs.existsSync(wasmDir)) {
+ fs.mkdirSync(wasmDir, { recursive: true });
+}
+
+// Rename CommonJS files
+fs.renameSync(
+ path.join(cjsDir, 'index.js'),
+ path.join(wasmDir, 'index.cjs')
+);
+
+// Rename ESM files
+fs.renameSync(
+ path.join(esmDir, 'index.js'),
+ path.join(wasmDir, 'index.js')
+);
+
+// Rename declaration files
+fs.renameSync(
+ path.join(cjsDir, 'index.d.ts'),
+ path.join(wasmDir, 'index.d.ts')
+);
+
+console.log('Build completed successfully!');
\ No newline at end of file
diff --git a/versions/15/src/index.ts b/versions/15/src/index.ts
new file mode 100644
index 00000000..28bfd9e4
--- /dev/null
+++ b/versions/15/src/index.ts
@@ -0,0 +1,87 @@
+export * from "@pgsql/types";
+
+// @ts-ignore
+import PgQueryModule from './libpg-query.js';
+
+let wasmModule: any;
+
+const initPromise = PgQueryModule().then((module: any) => {
+ wasmModule = module;
+});
+
+function ensureLoaded() {
+ if (!wasmModule) throw new Error("WASM module not initialized. Call `loadModule()` first.");
+}
+
+export async function loadModule() {
+ if (!wasmModule) {
+ await initPromise;
+ }
+}
+
+function awaitInit any>(fn: T): T {
+ return (async (...args: Parameters) => {
+ await initPromise;
+ return fn(...args);
+ }) as T;
+}
+
+function stringToPtr(str: string): number {
+ ensureLoaded();
+ if (typeof str !== 'string') {
+ throw new TypeError(`Expected a string, got ${typeof str}`);
+ }
+ const len = wasmModule.lengthBytesUTF8(str) + 1;
+ const ptr = wasmModule._malloc(len);
+ try {
+ wasmModule.stringToUTF8(str, ptr, len);
+ return ptr;
+ } catch (error) {
+ wasmModule._free(ptr);
+ throw error;
+ }
+}
+
+function ptrToString(ptr: number): string {
+ ensureLoaded();
+ if (typeof ptr !== 'number') {
+ throw new TypeError(`Expected a number, got ${typeof ptr}`);
+ }
+ return wasmModule.UTF8ToString(ptr);
+}
+
+export const parse = awaitInit(async (query: string) => {
+ const queryPtr = stringToPtr(query);
+ let resultPtr = 0;
+ try {
+ resultPtr = wasmModule._wasm_parse_query(queryPtr);
+ const resultStr = ptrToString(resultPtr);
+ if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
+ throw new Error(resultStr);
+ }
+ return JSON.parse(resultStr);
+ } finally {
+ wasmModule._free(queryPtr);
+ if (resultPtr) {
+ wasmModule._wasm_free_string(resultPtr);
+ }
+ }
+});
+
+export function parseSync(query: string) {
+ const queryPtr = stringToPtr(query);
+ let resultPtr = 0;
+ try {
+ resultPtr = wasmModule._wasm_parse_query(queryPtr);
+ const resultStr = ptrToString(resultPtr);
+ if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
+ throw new Error(resultStr);
+ }
+ return JSON.parse(resultStr);
+ } finally {
+ wasmModule._free(queryPtr);
+ if (resultPtr) {
+ wasmModule._wasm_free_string(resultPtr);
+ }
+ }
+}
\ No newline at end of file
diff --git a/versions/15/src/libpg-query.d.ts b/versions/15/src/libpg-query.d.ts
new file mode 100644
index 00000000..396fef83
--- /dev/null
+++ b/versions/15/src/libpg-query.d.ts
@@ -0,0 +1,15 @@
+declare module './libpg-query.js' {
+ interface WasmModule {
+ _malloc: (size: number) => number;
+ _free: (ptr: number) => void;
+ _wasm_free_string: (ptr: number) => void;
+ _wasm_parse_query: (queryPtr: number) => number;
+ lengthBytesUTF8: (str: string) => number;
+ stringToUTF8: (str: string, ptr: number, len: number) => void;
+ UTF8ToString: (ptr: number) => string;
+ HEAPU8: Uint8Array;
+ }
+
+ const PgQueryModule: () => Promise;
+ export default PgQueryModule;
+}
\ No newline at end of file
diff --git a/versions/15/src/wasm_wrapper.c b/versions/15/src/wasm_wrapper.c
new file mode 100644
index 00000000..bf297c6e
--- /dev/null
+++ b/versions/15/src/wasm_wrapper.c
@@ -0,0 +1,49 @@
+#include
+#include
+#include
+#include
+
+static int validate_input(const char* input) {
+ return input != NULL && strlen(input) > 0;
+}
+
+static char* safe_strdup(const char* str) {
+ if (!str) return NULL;
+ char* result = strdup(str);
+ if (!result) {
+ return NULL;
+ }
+ return result;
+}
+
+static void* safe_malloc(size_t size) {
+ void* ptr = malloc(size);
+ if (!ptr && size > 0) {
+ return NULL;
+ }
+ return ptr;
+}
+
+EMSCRIPTEN_KEEPALIVE
+char* wasm_parse_query(const char* input) {
+ if (!validate_input(input)) {
+ return safe_strdup("Invalid input: query cannot be null or empty");
+ }
+
+ PgQueryParseResult result = pg_query_parse(input);
+
+ if (result.error) {
+ char* error_msg = safe_strdup(result.error->message);
+ pg_query_free_parse_result(result);
+ return error_msg ? error_msg : safe_strdup("Memory allocation failed");
+ }
+
+ char* parse_tree = safe_strdup(result.parse_tree);
+ pg_query_free_parse_result(result);
+ return parse_tree;
+}
+
+EMSCRIPTEN_KEEPALIVE
+void wasm_free_string(char* str) {
+ free(str);
+}
\ No newline at end of file
diff --git a/versions/15/test/parsing.test.js b/versions/15/test/parsing.test.js
new file mode 100644
index 00000000..9315d7d4
--- /dev/null
+++ b/versions/15/test/parsing.test.js
@@ -0,0 +1,89 @@
+const { describe, it, before } = require('node:test');
+const assert = require('node:assert/strict');
+const query = require("../");
+
+function removeLocationProperties(obj) {
+ if (typeof obj !== 'object' || obj === null) {
+ return obj;
+ }
+
+ if (Array.isArray(obj)) {
+ return obj.map(item => removeLocationProperties(item));
+ }
+
+ const result = {};
+ for (const key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ if (key === 'location' || key === 'stmt_len' || key === 'stmt_location') {
+ continue; // Skip location-related properties
+ }
+ result[key] = removeLocationProperties(obj[key]);
+ }
+ }
+ return result;
+}
+
+describe("Query Parsing", () => {
+ before(async () => {
+ await query.parse("SELECT 1");
+ });
+
+ describe("Sync Parsing", () => {
+ it("should return a single-item parse result for common queries", () => {
+ const queries = ["select 1", "select null", "select ''", "select a, b"];
+ const results = queries.map(query.parseSync);
+ results.forEach((res) => {
+ assert.equal(res.stmts.length, 1);
+ });
+
+ const selectedDatas = results.map(
+ (it) => it.stmts[0].stmt.SelectStmt.targetList
+ );
+
+ assert.equal(selectedDatas[0][0].ResTarget.val.A_Const.ival.ival, 1);
+ assert.equal(selectedDatas[1][0].ResTarget.val.A_Const.isnull, true);
+ assert.equal(selectedDatas[2][0].ResTarget.val.A_Const.sval.sval, "");
+ assert.equal(selectedDatas[3].length, 2);
+ });
+
+ it("should support parsing multiple queries", () => {
+ const res = query.parseSync("select 1; select null;");
+ assert.deepEqual(
+ res.stmts.map(removeLocationProperties),
+ [
+ ...query.parseSync("select 1;").stmts.map(removeLocationProperties),
+ ...query.parseSync("select null;").stmts.map(removeLocationProperties),
+ ]
+ );
+ });
+
+ it("should not parse a bogus query", () => {
+ assert.throws(
+ () => query.parseSync("NOT A QUERY"),
+ Error
+ );
+ });
+ });
+
+ describe("Async parsing", () => {
+ it("should return a promise resolving to same result", async () => {
+ const testQuery = "select * from john;";
+ const resPromise = query.parse(testQuery);
+ const res = await resPromise;
+
+ assert.ok(resPromise instanceof Promise);
+ assert.deepEqual(res, query.parseSync(testQuery));
+ });
+
+ it("should reject on bogus queries", async () => {
+ await assert.rejects(
+ query.parse("NOT A QUERY"),
+ (err) => {
+ assert.ok(err instanceof Error);
+ assert.match(err.message, /NOT/);
+ return true;
+ }
+ );
+ });
+ });
+});
diff --git a/versions/15/tsconfig.esm.json b/versions/15/tsconfig.esm.json
new file mode 100644
index 00000000..63012c17
--- /dev/null
+++ b/versions/15/tsconfig.esm.json
@@ -0,0 +1,9 @@
+{
+ "extends": "./tsconfig.json",
+ "compilerOptions": {
+ "module": "es2022",
+ "rootDir": "src/",
+ "declaration": false,
+ "outDir": "esm/"
+ }
+ }
\ No newline at end of file
diff --git a/versions/15/tsconfig.json b/versions/15/tsconfig.json
new file mode 100644
index 00000000..d7da207b
--- /dev/null
+++ b/versions/15/tsconfig.json
@@ -0,0 +1,18 @@
+{
+ "compilerOptions": {
+ "target": "es2022",
+ "module": "commonjs",
+ "esModuleInterop": true,
+ "forceConsistentCasingInFileNames": true,
+ "strict": true,
+ "strictNullChecks": false,
+ "skipLibCheck": true,
+ "sourceMap": false,
+ "declaration": true,
+ "resolveJsonModule": true,
+ "moduleResolution": "node",
+ "outDir": "cjs/",
+ "rootDir": "src"
+ },
+ "exclude": ["cjs", "esm", "wasm", "node_modules", "**/*.test.ts"]
+}
\ No newline at end of file
diff --git a/versions/16/LICENSE b/versions/16/LICENSE
new file mode 100644
index 00000000..883d29d0
--- /dev/null
+++ b/versions/16/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2021 Dan Lynch
+Copyright (c) 2025 Interweb, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/versions/16/Makefile b/versions/16/Makefile
new file mode 100644
index 00000000..9d7bca02
--- /dev/null
+++ b/versions/16/Makefile
@@ -0,0 +1,89 @@
+WASM_OUT_DIR := wasm
+WASM_OUT_NAME := libpg-query
+WASM_MODULE_NAME := PgQueryModule
+LIBPG_QUERY_REPO := https://github.com/pganalyze/libpg_query.git
+LIBPG_QUERY_TAG := 16-5.2.0
+
+CACHE_DIR := .cache
+
+OS ?= $(shell uname -s)
+ARCH ?= $(shell uname -m)
+
+ifdef EMSCRIPTEN
+PLATFORM := emscripten
+else ifeq ($(OS),Darwin)
+PLATFORM := darwin
+else ifeq ($(OS),Linux)
+PLATFORM := linux
+else
+$(error Unsupported platform: $(OS))
+endif
+
+ifdef EMSCRIPTEN
+ARCH := wasm
+endif
+
+PLATFORM_ARCH := $(PLATFORM)-$(ARCH)
+SRC_FILES := src/wasm_wrapper.c
+LIBPG_QUERY_DIR := $(CACHE_DIR)/$(PLATFORM_ARCH)/libpg_query/$(LIBPG_QUERY_TAG)
+LIBPG_QUERY_ARCHIVE := $(LIBPG_QUERY_DIR)/libpg_query.a
+LIBPG_QUERY_HEADER := $(LIBPG_QUERY_DIR)/pg_query.h
+CXXFLAGS := -O3 -flto
+
+ifdef EMSCRIPTEN
+OUT_FILES := $(foreach EXT,.js .wasm,$(WASM_OUT_DIR)/$(WASM_OUT_NAME)$(EXT))
+else
+$(error Native builds are no longer supported. Use EMSCRIPTEN=1 for WASM builds only.)
+endif
+
+# Clone libpg_query source (lives in CACHE_DIR)
+$(LIBPG_QUERY_DIR):
+ mkdir -p $(CACHE_DIR)
+ git clone -b $(LIBPG_QUERY_TAG) --single-branch $(LIBPG_QUERY_REPO) $(LIBPG_QUERY_DIR)
+
+$(LIBPG_QUERY_HEADER): $(LIBPG_QUERY_DIR)
+
+# Build libpg_query
+$(LIBPG_QUERY_ARCHIVE): $(LIBPG_QUERY_DIR)
+ cd $(LIBPG_QUERY_DIR); $(MAKE) build
+
+# Build libpg-query-node WASM module
+$(OUT_FILES): $(LIBPG_QUERY_ARCHIVE) $(LIBPG_QUERY_HEADER) $(SRC_FILES)
+ifdef EMSCRIPTEN
+ mkdir -p $(WASM_OUT_DIR)
+ $(CC) \
+ -v \
+ $(CXXFLAGS) \
+ -I$(LIBPG_QUERY_DIR) \
+ -I$(LIBPG_QUERY_DIR)/vendor \
+ -L$(LIBPG_QUERY_DIR) \
+ -sEXPORTED_FUNCTIONS="['_malloc','_free','_wasm_parse_query','_wasm_free_string']" \
+ -sEXPORTED_RUNTIME_METHODS="['lengthBytesUTF8','stringToUTF8','UTF8ToString','HEAPU8','HEAPU32']" \
+ -sEXPORT_NAME="$(WASM_MODULE_NAME)" \
+ -sENVIRONMENT="web,node" \
+ -sMODULARIZE=1 \
+ -sEXPORT_ES6=0 \
+ -sALLOW_MEMORY_GROWTH=1 \
+ -lpg_query \
+ -o $@ \
+ $(SRC_FILES)
+else
+$(error Native builds are no longer supported. Use EMSCRIPTEN=1 for WASM builds only.)
+endif
+
+# Commands
+build: $(OUT_FILES)
+
+build-cache: $(LIBPG_QUERY_ARCHIVE) $(LIBPG_QUERY_HEADER)
+
+rebuild: clean build
+
+rebuild-cache: clean-cache build-cache
+
+clean:
+ -@ rm -r $(OUT_FILES) > /dev/null 2>&1
+
+clean-cache:
+ -@ rm -rf $(LIBPG_QUERY_DIR)
+
+.PHONY: build build-cache rebuild rebuild-cache clean clean-cache
diff --git a/versions/16/README.md b/versions/16/README.md
new file mode 100644
index 00000000..5da03391
--- /dev/null
+++ b/versions/16/README.md
@@ -0,0 +1,274 @@
+# libpg-query
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+
+# 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](https://github.com/pyramation/pgsql-parser), this library delivers full fidelity with the Postgres C codebase β no rewrites, no shortcuts.
+
+### Features
+
+* π§ **Powered by PostgreSQL** β Uses the official Postgres C parser compiled to WebAssembly
+* π₯οΈ **Cross-Platform** β Runs smoothly on macOS, Linux, and Windows
+* π **Node.js & Browser Support** β Consistent behavior in any JS environment
+* π¦ **No Native Builds Required** β No compilation, no system-specific dependencies
+* π§ **Spec-Accurate Parsing** β Produces faithful, standards-compliant ASTs
+* π **Production-Grade** β Powers tools like [`pgsql-parser`](https://github.com/pyramation/pgsql-parser)
+
+## Installation
+
+```sh
+npm install libpg-query
+```
+
+## Usage
+
+### `parse(query: string): Promise`
+
+Parses the SQL and returns a Promise for the parse tree. May reject with a parse error.
+
+```typescript
+import { parse } from 'libpg-query';
+
+const result = await parse('SELECT * FROM users WHERE active = true');
+// Returns: ParseResult - parsed query object
+```
+
+### `parseSync(query: string): ParseResult`
+
+Synchronous version that returns the parse tree directly. May throw a parse error.
+
+```typescript
+import { parseSync } from 'libpg-query';
+
+const result = parseSync('SELECT * FROM users WHERE active = true');
+// Returns: ParseResult - parsed query object
+```
+
+
+
+
+
+
+### Initialization
+
+The library provides both async and sync methods. Async methods handle initialization automatically, while sync methods require explicit initialization.
+
+#### Async Methods (Recommended)
+
+Async methods handle initialization automatically and are always safe to use:
+
+```typescript
+import { parse } from 'libpg-query';
+
+// These handle initialization automatically
+const result = await parse('SELECT * FROM users');
+```
+
+#### Sync Methods
+
+Sync methods require explicit initialization using `loadModule()`:
+
+```typescript
+import { loadModule, parseSync } from 'libpg-query';
+
+// Initialize first
+await loadModule();
+
+// Now safe to use sync methods
+const result = parseSync('SELECT * FROM users');
+```
+
+### `loadModule(): Promise`
+
+Explicitly initializes the WASM module. Required before using any sync methods.
+
+```typescript
+import { loadModule, parseSync } from 'libpg-query';
+
+// Initialize before using sync methods
+await loadModule();
+const result = parseSync('SELECT * FROM users');
+```
+
+Note: We recommend using async methods as they handle initialization automatically. Use sync methods only when necessary, and always call `loadModule()` first.
+
+### Type Definitions
+
+```typescript
+interface ParseResult {
+ version: number;
+ stmts: Statement[];
+}
+
+interface Statement {
+ stmt_type: string;
+ stmt_len: number;
+ stmt_location: number;
+ query: string;
+}
+
+interface ScanResult {
+ version: number;
+ tokens: ScanToken[];
+}
+
+interface ScanToken {
+ start: number; // Starting position in the SQL string
+ end: number; // Ending position in the SQL string
+ text: string; // The actual token text
+ tokenType: number; // Numeric token type identifier
+ tokenName: string; // Human-readable token type name
+ keywordKind: number; // Numeric keyword classification
+ keywordName: string; // Human-readable keyword classification
+}
+```
+
+**Note:** The return value is an array, as multiple queries may be provided in a single string (semicolon-delimited, as PostgreSQL expects).
+
+## Build Instructions
+
+This package uses a **WASM-only build system** for true cross-platform compatibility without native compilation dependencies.
+
+### Prerequisites
+
+- Node.js (version 16 or higher recommended)
+- [pnpm](https://pnpm.io/) (v8+ recommended)
+
+### Building WASM Artifacts
+
+1. **Install dependencies:**
+ ```bash
+ pnpm install
+ ```
+
+2. **Build WASM artifacts:**
+ ```bash
+ pnpm run build
+ ```
+
+3. **Clean WASM build (if needed):**
+ ```bash
+ pnpm run clean
+ ```
+
+4. **Rebuild WASM artifacts from scratch:**
+ ```bash
+ pnpm run clean && pnpm run build
+ ```
+
+### Build Process Details
+
+The WASM build process:
+- Uses Emscripten SDK for compilation
+- Compiles C wrapper code to WebAssembly
+- Generates `wasm/libpg-query.js` and `wasm/libpg-query.wasm` files
+- No native compilation or node-gyp dependencies required
+
+## Testing
+
+### Running Tests
+
+```bash
+pnpm run test
+```
+
+### Test Requirements
+
+- WASM artifacts must be built before running tests
+- If tests fail with "fetch failed" errors, rebuild WASM artifacts:
+ ```bash
+ pnpm run clean && pnpm run build && pnpm run test
+ ```
+
+
+
+## Versions
+
+Our latest is built with `17-latest` branch from libpg_query
+
+
+| PG Major Version | libpg_query | npm dist-tag
+|--------------------------|-------------|---------|
+| 17 | 17-6.1.0 | [`pg17`](https://www.npmjs.com/package/libpg-query/v/latest)
+| 16 | 16-5.2.0 | [`pg16`](https://www.npmjs.com/package/libpg-query/v/pg16)
+| 15 | 15-4.2.4 | [`pg15`](https://www.npmjs.com/package/libpg-query/v/pg15)
+| 14 | 14-3.0.0 | [`pg14`](https://www.npmjs.com/package/libpg-query/v/pg14)
+| 13 | 13-2.2.0 | [`pg13`](https://www.npmjs.com/package/libpg-query/v/pg13)
+| 12 | (n/a) | |
+| 11 | (n/a) | |
+| 10 | 10-latest | | `@1.3.1` ([tree](https://github.com/pyramation/pgsql-parser/tree/39b7b1adc8914253226e286a48105785219a81ca)) |
+
+
+## Troubleshooting
+
+### Common Issues
+
+**"fetch failed" errors during tests:**
+- This indicates stale or missing WASM artifacts
+- Solution: `pnpm run clean && pnpm run build`
+
+**"WASM module not initialized" errors:**
+- Ensure you call an async method first to initialize the WASM module
+- Or use the async versions of methods which handle initialization automatically
+
+**Build environment issues:**
+- Ensure Emscripten SDK is properly installed and configured
+- Check that all required build dependencies are available
+
+### Build Artifacts
+
+The build process generates these files:
+- `wasm/libpg-query.js` - Emscripten-generated JavaScript loader
+- `wasm/libpg-query.wasm` - WebAssembly binary
+- `wasm/index.js` - ES module exports
+- `wasm/index.cjs` - CommonJS exports with sync wrappers
+
+## Related Projects
+
+* [libpg_query](https://github.com/pganalyze/libpg_query)
+* [pgsql-parser](https://github.com/pyramation/pgsql-parser)
+* [pg_query](https://github.com/lfittl/pg_query)
+* [pg_query.go](https://github.com/lfittl/pg_query.go)
+
+## Credit
+
+* 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.
+
+* All credit for the hard problems goes to [Lukas Fittl](https://github.com/lfittl).
+
+* Additional thanks for the original Node.js integration work by [Ethan Resnick](https://github.com/ethanresnick).
+
+* Original [Code](https://github.com/zhm/node-pg-query-native) and [License](https://github.com/zhm/node-pg-query-native/blob/master/LICENSE.md)
+
+## Related
+
+* [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.
+* [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`.
+* [@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.
+* [@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.
+* [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.
+* [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.
+
+## Disclaimer
+
+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.
\ No newline at end of file
diff --git a/versions/16/package.json b/versions/16/package.json
new file mode 100644
index 00000000..6e783b64
--- /dev/null
+++ b/versions/16/package.json
@@ -0,0 +1,52 @@
+{
+ "name": "@libpg-query/v16",
+ "version": "16.4.0",
+ "description": "The real PostgreSQL query parser",
+ "homepage": "https://github.com/launchql/libpg-query-node",
+ "main": "./wasm/index.cjs",
+ "module": "./wasm/index.js",
+ "typings": "./wasm/index.d.ts",
+ "publishConfig": {
+ "access": "public"
+ },
+ "x-publish": {
+ "publishName": "libpg-query",
+ "pgVersion": "16",
+ "distTag": "pg16",
+ "libpgQueryTag": "16-5.2.0"
+ },
+ "files": [
+ "wasm/*"
+ ],
+ "scripts": {
+ "clean": "pnpm wasm:clean && rimraf wasm/*.js wasm/*.cjs wasm/*.d.ts",
+ "build:js": "node scripts/build.js",
+ "build": "pnpm clean && pnpm wasm:build && pnpm build:js",
+ "publish:pkg": "node ../../scripts/publish-versions.js",
+ "wasm:make": "docker run --rm -v $(pwd):/src -u $(id -u):$(id -g) emscripten/emsdk emmake make",
+ "wasm:build": "pnpm wasm:make build",
+ "wasm:rebuild": "pnpm wasm:make rebuild",
+ "wasm:clean": "pnpm wasm:make clean",
+ "wasm:clean-cache": "pnpm wasm:make clean-cache",
+ "test": "node --test test/parsing.test.js"
+ },
+ "author": "Dan Lynch (http://github.com/pyramation)",
+ "license": "LICENSE IN LICENSE",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/launchql/libpg-query-node.git"
+ },
+ "devDependencies": {},
+ "dependencies": {
+ "@pgsql/types": "^16.0.0"
+ },
+ "keywords": [
+ "sql",
+ "postgres",
+ "postgresql",
+ "pg",
+ "query",
+ "plpgsql",
+ "database"
+ ]
+}
\ No newline at end of file
diff --git a/versions/16/scripts/build.js b/versions/16/scripts/build.js
new file mode 100644
index 00000000..48c95b8a
--- /dev/null
+++ b/versions/16/scripts/build.js
@@ -0,0 +1,39 @@
+const fs = require('fs');
+const path = require('path');
+const { execSync } = require('child_process');
+
+// Run TypeScript compilation
+console.log('Compiling TypeScript...');
+const tscPath = path.join(__dirname, '../../../node_modules/.bin/tsc');
+execSync(`${tscPath}`, { stdio: 'inherit', cwd: path.join(__dirname, '..') });
+execSync(`${tscPath} -p tsconfig.esm.json`, { stdio: 'inherit', cwd: path.join(__dirname, '..') });
+
+// Rename files to have correct extensions
+const wasmDir = path.join(__dirname, '../wasm');
+const cjsDir = path.join(__dirname, '../cjs');
+const esmDir = path.join(__dirname, '../esm');
+
+// Ensure wasm directory exists
+if (!fs.existsSync(wasmDir)) {
+ fs.mkdirSync(wasmDir, { recursive: true });
+}
+
+// Rename CommonJS files
+fs.renameSync(
+ path.join(cjsDir, 'index.js'),
+ path.join(wasmDir, 'index.cjs')
+);
+
+// Rename ESM files
+fs.renameSync(
+ path.join(esmDir, 'index.js'),
+ path.join(wasmDir, 'index.js')
+);
+
+// Rename declaration files
+fs.renameSync(
+ path.join(cjsDir, 'index.d.ts'),
+ path.join(wasmDir, 'index.d.ts')
+);
+
+console.log('Build completed successfully!');
\ No newline at end of file
diff --git a/versions/16/src/index.ts b/versions/16/src/index.ts
new file mode 100644
index 00000000..28bfd9e4
--- /dev/null
+++ b/versions/16/src/index.ts
@@ -0,0 +1,87 @@
+export * from "@pgsql/types";
+
+// @ts-ignore
+import PgQueryModule from './libpg-query.js';
+
+let wasmModule: any;
+
+const initPromise = PgQueryModule().then((module: any) => {
+ wasmModule = module;
+});
+
+function ensureLoaded() {
+ if (!wasmModule) throw new Error("WASM module not initialized. Call `loadModule()` first.");
+}
+
+export async function loadModule() {
+ if (!wasmModule) {
+ await initPromise;
+ }
+}
+
+function awaitInit any>(fn: T): T {
+ return (async (...args: Parameters) => {
+ await initPromise;
+ return fn(...args);
+ }) as T;
+}
+
+function stringToPtr(str: string): number {
+ ensureLoaded();
+ if (typeof str !== 'string') {
+ throw new TypeError(`Expected a string, got ${typeof str}`);
+ }
+ const len = wasmModule.lengthBytesUTF8(str) + 1;
+ const ptr = wasmModule._malloc(len);
+ try {
+ wasmModule.stringToUTF8(str, ptr, len);
+ return ptr;
+ } catch (error) {
+ wasmModule._free(ptr);
+ throw error;
+ }
+}
+
+function ptrToString(ptr: number): string {
+ ensureLoaded();
+ if (typeof ptr !== 'number') {
+ throw new TypeError(`Expected a number, got ${typeof ptr}`);
+ }
+ return wasmModule.UTF8ToString(ptr);
+}
+
+export const parse = awaitInit(async (query: string) => {
+ const queryPtr = stringToPtr(query);
+ let resultPtr = 0;
+ try {
+ resultPtr = wasmModule._wasm_parse_query(queryPtr);
+ const resultStr = ptrToString(resultPtr);
+ if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
+ throw new Error(resultStr);
+ }
+ return JSON.parse(resultStr);
+ } finally {
+ wasmModule._free(queryPtr);
+ if (resultPtr) {
+ wasmModule._wasm_free_string(resultPtr);
+ }
+ }
+});
+
+export function parseSync(query: string) {
+ const queryPtr = stringToPtr(query);
+ let resultPtr = 0;
+ try {
+ resultPtr = wasmModule._wasm_parse_query(queryPtr);
+ const resultStr = ptrToString(resultPtr);
+ if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
+ throw new Error(resultStr);
+ }
+ return JSON.parse(resultStr);
+ } finally {
+ wasmModule._free(queryPtr);
+ if (resultPtr) {
+ wasmModule._wasm_free_string(resultPtr);
+ }
+ }
+}
\ No newline at end of file
diff --git a/versions/16/src/libpg-query.d.ts b/versions/16/src/libpg-query.d.ts
new file mode 100644
index 00000000..396fef83
--- /dev/null
+++ b/versions/16/src/libpg-query.d.ts
@@ -0,0 +1,15 @@
+declare module './libpg-query.js' {
+ interface WasmModule {
+ _malloc: (size: number) => number;
+ _free: (ptr: number) => void;
+ _wasm_free_string: (ptr: number) => void;
+ _wasm_parse_query: (queryPtr: number) => number;
+ lengthBytesUTF8: (str: string) => number;
+ stringToUTF8: (str: string, ptr: number, len: number) => void;
+ UTF8ToString: (ptr: number) => string;
+ HEAPU8: Uint8Array;
+ }
+
+ const PgQueryModule: () => Promise;
+ export default PgQueryModule;
+}
\ No newline at end of file
diff --git a/versions/16/src/wasm_wrapper.c b/versions/16/src/wasm_wrapper.c
new file mode 100644
index 00000000..bf297c6e
--- /dev/null
+++ b/versions/16/src/wasm_wrapper.c
@@ -0,0 +1,49 @@
+#include
+#include
+#include
+#include
+
+static int validate_input(const char* input) {
+ return input != NULL && strlen(input) > 0;
+}
+
+static char* safe_strdup(const char* str) {
+ if (!str) return NULL;
+ char* result = strdup(str);
+ if (!result) {
+ return NULL;
+ }
+ return result;
+}
+
+static void* safe_malloc(size_t size) {
+ void* ptr = malloc(size);
+ if (!ptr && size > 0) {
+ return NULL;
+ }
+ return ptr;
+}
+
+EMSCRIPTEN_KEEPALIVE
+char* wasm_parse_query(const char* input) {
+ if (!validate_input(input)) {
+ return safe_strdup("Invalid input: query cannot be null or empty");
+ }
+
+ PgQueryParseResult result = pg_query_parse(input);
+
+ if (result.error) {
+ char* error_msg = safe_strdup(result.error->message);
+ pg_query_free_parse_result(result);
+ return error_msg ? error_msg : safe_strdup("Memory allocation failed");
+ }
+
+ char* parse_tree = safe_strdup(result.parse_tree);
+ pg_query_free_parse_result(result);
+ return parse_tree;
+}
+
+EMSCRIPTEN_KEEPALIVE
+void wasm_free_string(char* str) {
+ free(str);
+}
\ No newline at end of file
diff --git a/versions/16/test/parsing.test.js b/versions/16/test/parsing.test.js
new file mode 100644
index 00000000..9315d7d4
--- /dev/null
+++ b/versions/16/test/parsing.test.js
@@ -0,0 +1,89 @@
+const { describe, it, before } = require('node:test');
+const assert = require('node:assert/strict');
+const query = require("../");
+
+function removeLocationProperties(obj) {
+ if (typeof obj !== 'object' || obj === null) {
+ return obj;
+ }
+
+ if (Array.isArray(obj)) {
+ return obj.map(item => removeLocationProperties(item));
+ }
+
+ const result = {};
+ for (const key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ if (key === 'location' || key === 'stmt_len' || key === 'stmt_location') {
+ continue; // Skip location-related properties
+ }
+ result[key] = removeLocationProperties(obj[key]);
+ }
+ }
+ return result;
+}
+
+describe("Query Parsing", () => {
+ before(async () => {
+ await query.parse("SELECT 1");
+ });
+
+ describe("Sync Parsing", () => {
+ it("should return a single-item parse result for common queries", () => {
+ const queries = ["select 1", "select null", "select ''", "select a, b"];
+ const results = queries.map(query.parseSync);
+ results.forEach((res) => {
+ assert.equal(res.stmts.length, 1);
+ });
+
+ const selectedDatas = results.map(
+ (it) => it.stmts[0].stmt.SelectStmt.targetList
+ );
+
+ assert.equal(selectedDatas[0][0].ResTarget.val.A_Const.ival.ival, 1);
+ assert.equal(selectedDatas[1][0].ResTarget.val.A_Const.isnull, true);
+ assert.equal(selectedDatas[2][0].ResTarget.val.A_Const.sval.sval, "");
+ assert.equal(selectedDatas[3].length, 2);
+ });
+
+ it("should support parsing multiple queries", () => {
+ const res = query.parseSync("select 1; select null;");
+ assert.deepEqual(
+ res.stmts.map(removeLocationProperties),
+ [
+ ...query.parseSync("select 1;").stmts.map(removeLocationProperties),
+ ...query.parseSync("select null;").stmts.map(removeLocationProperties),
+ ]
+ );
+ });
+
+ it("should not parse a bogus query", () => {
+ assert.throws(
+ () => query.parseSync("NOT A QUERY"),
+ Error
+ );
+ });
+ });
+
+ describe("Async parsing", () => {
+ it("should return a promise resolving to same result", async () => {
+ const testQuery = "select * from john;";
+ const resPromise = query.parse(testQuery);
+ const res = await resPromise;
+
+ assert.ok(resPromise instanceof Promise);
+ assert.deepEqual(res, query.parseSync(testQuery));
+ });
+
+ it("should reject on bogus queries", async () => {
+ await assert.rejects(
+ query.parse("NOT A QUERY"),
+ (err) => {
+ assert.ok(err instanceof Error);
+ assert.match(err.message, /NOT/);
+ return true;
+ }
+ );
+ });
+ });
+});
diff --git a/versions/16/tsconfig.esm.json b/versions/16/tsconfig.esm.json
new file mode 100644
index 00000000..63012c17
--- /dev/null
+++ b/versions/16/tsconfig.esm.json
@@ -0,0 +1,9 @@
+{
+ "extends": "./tsconfig.json",
+ "compilerOptions": {
+ "module": "es2022",
+ "rootDir": "src/",
+ "declaration": false,
+ "outDir": "esm/"
+ }
+ }
\ No newline at end of file
diff --git a/versions/16/tsconfig.json b/versions/16/tsconfig.json
new file mode 100644
index 00000000..d7da207b
--- /dev/null
+++ b/versions/16/tsconfig.json
@@ -0,0 +1,18 @@
+{
+ "compilerOptions": {
+ "target": "es2022",
+ "module": "commonjs",
+ "esModuleInterop": true,
+ "forceConsistentCasingInFileNames": true,
+ "strict": true,
+ "strictNullChecks": false,
+ "skipLibCheck": true,
+ "sourceMap": false,
+ "declaration": true,
+ "resolveJsonModule": true,
+ "moduleResolution": "node",
+ "outDir": "cjs/",
+ "rootDir": "src"
+ },
+ "exclude": ["cjs", "esm", "wasm", "node_modules", "**/*.test.ts"]
+}
\ No newline at end of file
diff --git a/versions/17/LICENSE b/versions/17/LICENSE
new file mode 100644
index 00000000..883d29d0
--- /dev/null
+++ b/versions/17/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2021 Dan Lynch
+Copyright (c) 2025 Interweb, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/versions/17/Makefile b/versions/17/Makefile
new file mode 100644
index 00000000..ac31dd95
--- /dev/null
+++ b/versions/17/Makefile
@@ -0,0 +1,89 @@
+WASM_OUT_DIR := wasm
+WASM_OUT_NAME := libpg-query
+WASM_MODULE_NAME := PgQueryModule
+LIBPG_QUERY_REPO := https://github.com/pganalyze/libpg_query.git
+LIBPG_QUERY_TAG := 17-6.1.0
+
+CACHE_DIR := .cache
+
+OS ?= $(shell uname -s)
+ARCH ?= $(shell uname -m)
+
+ifdef EMSCRIPTEN
+PLATFORM := emscripten
+else ifeq ($(OS),Darwin)
+PLATFORM := darwin
+else ifeq ($(OS),Linux)
+PLATFORM := linux
+else
+$(error Unsupported platform: $(OS))
+endif
+
+ifdef EMSCRIPTEN
+ARCH := wasm
+endif
+
+PLATFORM_ARCH := $(PLATFORM)-$(ARCH)
+SRC_FILES := src/wasm_wrapper.c
+LIBPG_QUERY_DIR := $(CACHE_DIR)/$(PLATFORM_ARCH)/libpg_query/$(LIBPG_QUERY_TAG)
+LIBPG_QUERY_ARCHIVE := $(LIBPG_QUERY_DIR)/libpg_query.a
+LIBPG_QUERY_HEADER := $(LIBPG_QUERY_DIR)/pg_query.h
+CXXFLAGS := -O3 -flto
+
+ifdef EMSCRIPTEN
+OUT_FILES := $(foreach EXT,.js .wasm,$(WASM_OUT_DIR)/$(WASM_OUT_NAME)$(EXT))
+else
+$(error Native builds are no longer supported. Use EMSCRIPTEN=1 for WASM builds only.)
+endif
+
+# Clone libpg_query source (lives in CACHE_DIR)
+$(LIBPG_QUERY_DIR):
+ mkdir -p $(CACHE_DIR)
+ git clone -b $(LIBPG_QUERY_TAG) --single-branch $(LIBPG_QUERY_REPO) $(LIBPG_QUERY_DIR)
+
+$(LIBPG_QUERY_HEADER): $(LIBPG_QUERY_DIR)
+
+# Build libpg_query
+$(LIBPG_QUERY_ARCHIVE): $(LIBPG_QUERY_DIR)
+ cd $(LIBPG_QUERY_DIR); $(MAKE) build
+
+# Build libpg-query-node WASM module
+$(OUT_FILES): $(LIBPG_QUERY_ARCHIVE) $(LIBPG_QUERY_HEADER) $(SRC_FILES)
+ifdef EMSCRIPTEN
+ mkdir -p $(WASM_OUT_DIR)
+ $(CC) \
+ -v \
+ $(CXXFLAGS) \
+ -I$(LIBPG_QUERY_DIR) \
+ -I$(LIBPG_QUERY_DIR)/vendor \
+ -L$(LIBPG_QUERY_DIR) \
+ -sEXPORTED_FUNCTIONS="['_malloc','_free','_wasm_parse_query','_wasm_free_string']" \
+ -sEXPORTED_RUNTIME_METHODS="['lengthBytesUTF8','stringToUTF8','UTF8ToString','HEAPU8','HEAPU32']" \
+ -sEXPORT_NAME="$(WASM_MODULE_NAME)" \
+ -sENVIRONMENT="web,node" \
+ -sMODULARIZE=1 \
+ -sEXPORT_ES6=0 \
+ -sALLOW_MEMORY_GROWTH=1 \
+ -lpg_query \
+ -o $@ \
+ $(SRC_FILES)
+else
+$(error Native builds are no longer supported. Use EMSCRIPTEN=1 for WASM builds only.)
+endif
+
+# Commands
+build: $(OUT_FILES)
+
+build-cache: $(LIBPG_QUERY_ARCHIVE) $(LIBPG_QUERY_HEADER)
+
+rebuild: clean build
+
+rebuild-cache: clean-cache build-cache
+
+clean:
+ -@ rm -r $(OUT_FILES) > /dev/null 2>&1
+
+clean-cache:
+ -@ rm -rf $(LIBPG_QUERY_DIR)
+
+.PHONY: build build-cache rebuild rebuild-cache clean clean-cache
diff --git a/versions/17/README.md b/versions/17/README.md
new file mode 100644
index 00000000..5da03391
--- /dev/null
+++ b/versions/17/README.md
@@ -0,0 +1,274 @@
+# libpg-query
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+
+# 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](https://github.com/pyramation/pgsql-parser), this library delivers full fidelity with the Postgres C codebase β no rewrites, no shortcuts.
+
+### Features
+
+* π§ **Powered by PostgreSQL** β Uses the official Postgres C parser compiled to WebAssembly
+* π₯οΈ **Cross-Platform** β Runs smoothly on macOS, Linux, and Windows
+* π **Node.js & Browser Support** β Consistent behavior in any JS environment
+* π¦ **No Native Builds Required** β No compilation, no system-specific dependencies
+* π§ **Spec-Accurate Parsing** β Produces faithful, standards-compliant ASTs
+* π **Production-Grade** β Powers tools like [`pgsql-parser`](https://github.com/pyramation/pgsql-parser)
+
+## Installation
+
+```sh
+npm install libpg-query
+```
+
+## Usage
+
+### `parse(query: string): Promise`
+
+Parses the SQL and returns a Promise for the parse tree. May reject with a parse error.
+
+```typescript
+import { parse } from 'libpg-query';
+
+const result = await parse('SELECT * FROM users WHERE active = true');
+// Returns: ParseResult - parsed query object
+```
+
+### `parseSync(query: string): ParseResult`
+
+Synchronous version that returns the parse tree directly. May throw a parse error.
+
+```typescript
+import { parseSync } from 'libpg-query';
+
+const result = parseSync('SELECT * FROM users WHERE active = true');
+// Returns: ParseResult - parsed query object
+```
+
+
+
+
+
+
+### Initialization
+
+The library provides both async and sync methods. Async methods handle initialization automatically, while sync methods require explicit initialization.
+
+#### Async Methods (Recommended)
+
+Async methods handle initialization automatically and are always safe to use:
+
+```typescript
+import { parse } from 'libpg-query';
+
+// These handle initialization automatically
+const result = await parse('SELECT * FROM users');
+```
+
+#### Sync Methods
+
+Sync methods require explicit initialization using `loadModule()`:
+
+```typescript
+import { loadModule, parseSync } from 'libpg-query';
+
+// Initialize first
+await loadModule();
+
+// Now safe to use sync methods
+const result = parseSync('SELECT * FROM users');
+```
+
+### `loadModule(): Promise`
+
+Explicitly initializes the WASM module. Required before using any sync methods.
+
+```typescript
+import { loadModule, parseSync } from 'libpg-query';
+
+// Initialize before using sync methods
+await loadModule();
+const result = parseSync('SELECT * FROM users');
+```
+
+Note: We recommend using async methods as they handle initialization automatically. Use sync methods only when necessary, and always call `loadModule()` first.
+
+### Type Definitions
+
+```typescript
+interface ParseResult {
+ version: number;
+ stmts: Statement[];
+}
+
+interface Statement {
+ stmt_type: string;
+ stmt_len: number;
+ stmt_location: number;
+ query: string;
+}
+
+interface ScanResult {
+ version: number;
+ tokens: ScanToken[];
+}
+
+interface ScanToken {
+ start: number; // Starting position in the SQL string
+ end: number; // Ending position in the SQL string
+ text: string; // The actual token text
+ tokenType: number; // Numeric token type identifier
+ tokenName: string; // Human-readable token type name
+ keywordKind: number; // Numeric keyword classification
+ keywordName: string; // Human-readable keyword classification
+}
+```
+
+**Note:** The return value is an array, as multiple queries may be provided in a single string (semicolon-delimited, as PostgreSQL expects).
+
+## Build Instructions
+
+This package uses a **WASM-only build system** for true cross-platform compatibility without native compilation dependencies.
+
+### Prerequisites
+
+- Node.js (version 16 or higher recommended)
+- [pnpm](https://pnpm.io/) (v8+ recommended)
+
+### Building WASM Artifacts
+
+1. **Install dependencies:**
+ ```bash
+ pnpm install
+ ```
+
+2. **Build WASM artifacts:**
+ ```bash
+ pnpm run build
+ ```
+
+3. **Clean WASM build (if needed):**
+ ```bash
+ pnpm run clean
+ ```
+
+4. **Rebuild WASM artifacts from scratch:**
+ ```bash
+ pnpm run clean && pnpm run build
+ ```
+
+### Build Process Details
+
+The WASM build process:
+- Uses Emscripten SDK for compilation
+- Compiles C wrapper code to WebAssembly
+- Generates `wasm/libpg-query.js` and `wasm/libpg-query.wasm` files
+- No native compilation or node-gyp dependencies required
+
+## Testing
+
+### Running Tests
+
+```bash
+pnpm run test
+```
+
+### Test Requirements
+
+- WASM artifacts must be built before running tests
+- If tests fail with "fetch failed" errors, rebuild WASM artifacts:
+ ```bash
+ pnpm run clean && pnpm run build && pnpm run test
+ ```
+
+
+
+## Versions
+
+Our latest is built with `17-latest` branch from libpg_query
+
+
+| PG Major Version | libpg_query | npm dist-tag
+|--------------------------|-------------|---------|
+| 17 | 17-6.1.0 | [`pg17`](https://www.npmjs.com/package/libpg-query/v/latest)
+| 16 | 16-5.2.0 | [`pg16`](https://www.npmjs.com/package/libpg-query/v/pg16)
+| 15 | 15-4.2.4 | [`pg15`](https://www.npmjs.com/package/libpg-query/v/pg15)
+| 14 | 14-3.0.0 | [`pg14`](https://www.npmjs.com/package/libpg-query/v/pg14)
+| 13 | 13-2.2.0 | [`pg13`](https://www.npmjs.com/package/libpg-query/v/pg13)
+| 12 | (n/a) | |
+| 11 | (n/a) | |
+| 10 | 10-latest | | `@1.3.1` ([tree](https://github.com/pyramation/pgsql-parser/tree/39b7b1adc8914253226e286a48105785219a81ca)) |
+
+
+## Troubleshooting
+
+### Common Issues
+
+**"fetch failed" errors during tests:**
+- This indicates stale or missing WASM artifacts
+- Solution: `pnpm run clean && pnpm run build`
+
+**"WASM module not initialized" errors:**
+- Ensure you call an async method first to initialize the WASM module
+- Or use the async versions of methods which handle initialization automatically
+
+**Build environment issues:**
+- Ensure Emscripten SDK is properly installed and configured
+- Check that all required build dependencies are available
+
+### Build Artifacts
+
+The build process generates these files:
+- `wasm/libpg-query.js` - Emscripten-generated JavaScript loader
+- `wasm/libpg-query.wasm` - WebAssembly binary
+- `wasm/index.js` - ES module exports
+- `wasm/index.cjs` - CommonJS exports with sync wrappers
+
+## Related Projects
+
+* [libpg_query](https://github.com/pganalyze/libpg_query)
+* [pgsql-parser](https://github.com/pyramation/pgsql-parser)
+* [pg_query](https://github.com/lfittl/pg_query)
+* [pg_query.go](https://github.com/lfittl/pg_query.go)
+
+## Credit
+
+* 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.
+
+* All credit for the hard problems goes to [Lukas Fittl](https://github.com/lfittl).
+
+* Additional thanks for the original Node.js integration work by [Ethan Resnick](https://github.com/ethanresnick).
+
+* Original [Code](https://github.com/zhm/node-pg-query-native) and [License](https://github.com/zhm/node-pg-query-native/blob/master/LICENSE.md)
+
+## Related
+
+* [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.
+* [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`.
+* [@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.
+* [@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.
+* [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.
+* [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.
+
+## Disclaimer
+
+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.
\ No newline at end of file
diff --git a/versions/17/package.json b/versions/17/package.json
new file mode 100644
index 00000000..434aa1dc
--- /dev/null
+++ b/versions/17/package.json
@@ -0,0 +1,52 @@
+{
+ "name": "@libpg-query/v17",
+ "version": "17.4.0",
+ "description": "The real PostgreSQL query parser",
+ "homepage": "https://github.com/launchql/libpg-query-node",
+ "main": "./wasm/index.cjs",
+ "module": "./wasm/index.js",
+ "typings": "./wasm/index.d.ts",
+ "publishConfig": {
+ "access": "public"
+ },
+ "x-publish": {
+ "publishName": "libpg-query",
+ "pgVersion": "17",
+ "distTag": "pg17",
+ "libpgQueryTag": "17-6.1.0"
+ },
+ "files": [
+ "wasm/*"
+ ],
+ "scripts": {
+ "clean": "pnpm wasm:clean && rimraf wasm/*.js wasm/*.cjs wasm/*.d.ts",
+ "build:js": "node scripts/build.js",
+ "build": "pnpm clean && pnpm wasm:build && pnpm build:js",
+ "publish:pkg": "node ../../scripts/publish-versions.js",
+ "wasm:make": "docker run --rm -v $(pwd):/src -u $(id -u):$(id -g) emscripten/emsdk emmake make",
+ "wasm:build": "pnpm wasm:make build",
+ "wasm:rebuild": "pnpm wasm:make rebuild",
+ "wasm:clean": "pnpm wasm:make clean",
+ "wasm:clean-cache": "pnpm wasm:make clean-cache",
+ "test": "node --test test/parsing.test.js"
+ },
+ "author": "Dan Lynch (http://github.com/pyramation)",
+ "license": "LICENSE IN LICENSE",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/launchql/libpg-query-node.git"
+ },
+ "devDependencies": {},
+ "dependencies": {
+ "@pgsql/types": "^17.4.2"
+ },
+ "keywords": [
+ "sql",
+ "postgres",
+ "postgresql",
+ "pg",
+ "query",
+ "plpgsql",
+ "database"
+ ]
+}
\ No newline at end of file
diff --git a/versions/17/scripts/build.js b/versions/17/scripts/build.js
new file mode 100644
index 00000000..48c95b8a
--- /dev/null
+++ b/versions/17/scripts/build.js
@@ -0,0 +1,39 @@
+const fs = require('fs');
+const path = require('path');
+const { execSync } = require('child_process');
+
+// Run TypeScript compilation
+console.log('Compiling TypeScript...');
+const tscPath = path.join(__dirname, '../../../node_modules/.bin/tsc');
+execSync(`${tscPath}`, { stdio: 'inherit', cwd: path.join(__dirname, '..') });
+execSync(`${tscPath} -p tsconfig.esm.json`, { stdio: 'inherit', cwd: path.join(__dirname, '..') });
+
+// Rename files to have correct extensions
+const wasmDir = path.join(__dirname, '../wasm');
+const cjsDir = path.join(__dirname, '../cjs');
+const esmDir = path.join(__dirname, '../esm');
+
+// Ensure wasm directory exists
+if (!fs.existsSync(wasmDir)) {
+ fs.mkdirSync(wasmDir, { recursive: true });
+}
+
+// Rename CommonJS files
+fs.renameSync(
+ path.join(cjsDir, 'index.js'),
+ path.join(wasmDir, 'index.cjs')
+);
+
+// Rename ESM files
+fs.renameSync(
+ path.join(esmDir, 'index.js'),
+ path.join(wasmDir, 'index.js')
+);
+
+// Rename declaration files
+fs.renameSync(
+ path.join(cjsDir, 'index.d.ts'),
+ path.join(wasmDir, 'index.d.ts')
+);
+
+console.log('Build completed successfully!');
\ No newline at end of file
diff --git a/versions/17/src/index.ts b/versions/17/src/index.ts
new file mode 100644
index 00000000..28bfd9e4
--- /dev/null
+++ b/versions/17/src/index.ts
@@ -0,0 +1,87 @@
+export * from "@pgsql/types";
+
+// @ts-ignore
+import PgQueryModule from './libpg-query.js';
+
+let wasmModule: any;
+
+const initPromise = PgQueryModule().then((module: any) => {
+ wasmModule = module;
+});
+
+function ensureLoaded() {
+ if (!wasmModule) throw new Error("WASM module not initialized. Call `loadModule()` first.");
+}
+
+export async function loadModule() {
+ if (!wasmModule) {
+ await initPromise;
+ }
+}
+
+function awaitInit any>(fn: T): T {
+ return (async (...args: Parameters) => {
+ await initPromise;
+ return fn(...args);
+ }) as T;
+}
+
+function stringToPtr(str: string): number {
+ ensureLoaded();
+ if (typeof str !== 'string') {
+ throw new TypeError(`Expected a string, got ${typeof str}`);
+ }
+ const len = wasmModule.lengthBytesUTF8(str) + 1;
+ const ptr = wasmModule._malloc(len);
+ try {
+ wasmModule.stringToUTF8(str, ptr, len);
+ return ptr;
+ } catch (error) {
+ wasmModule._free(ptr);
+ throw error;
+ }
+}
+
+function ptrToString(ptr: number): string {
+ ensureLoaded();
+ if (typeof ptr !== 'number') {
+ throw new TypeError(`Expected a number, got ${typeof ptr}`);
+ }
+ return wasmModule.UTF8ToString(ptr);
+}
+
+export const parse = awaitInit(async (query: string) => {
+ const queryPtr = stringToPtr(query);
+ let resultPtr = 0;
+ try {
+ resultPtr = wasmModule._wasm_parse_query(queryPtr);
+ const resultStr = ptrToString(resultPtr);
+ if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
+ throw new Error(resultStr);
+ }
+ return JSON.parse(resultStr);
+ } finally {
+ wasmModule._free(queryPtr);
+ if (resultPtr) {
+ wasmModule._wasm_free_string(resultPtr);
+ }
+ }
+});
+
+export function parseSync(query: string) {
+ const queryPtr = stringToPtr(query);
+ let resultPtr = 0;
+ try {
+ resultPtr = wasmModule._wasm_parse_query(queryPtr);
+ const resultStr = ptrToString(resultPtr);
+ if (resultStr.startsWith('syntax error') || resultStr.startsWith('deparse error') || resultStr.includes('ERROR')) {
+ throw new Error(resultStr);
+ }
+ return JSON.parse(resultStr);
+ } finally {
+ wasmModule._free(queryPtr);
+ if (resultPtr) {
+ wasmModule._wasm_free_string(resultPtr);
+ }
+ }
+}
\ No newline at end of file
diff --git a/versions/17/src/libpg-query.d.ts b/versions/17/src/libpg-query.d.ts
new file mode 100644
index 00000000..396fef83
--- /dev/null
+++ b/versions/17/src/libpg-query.d.ts
@@ -0,0 +1,15 @@
+declare module './libpg-query.js' {
+ interface WasmModule {
+ _malloc: (size: number) => number;
+ _free: (ptr: number) => void;
+ _wasm_free_string: (ptr: number) => void;
+ _wasm_parse_query: (queryPtr: number) => number;
+ lengthBytesUTF8: (str: string) => number;
+ stringToUTF8: (str: string, ptr: number, len: number) => void;
+ UTF8ToString: (ptr: number) => string;
+ HEAPU8: Uint8Array;
+ }
+
+ const PgQueryModule: () => Promise;
+ export default PgQueryModule;
+}
\ No newline at end of file
diff --git a/versions/17/src/wasm_wrapper.c b/versions/17/src/wasm_wrapper.c
new file mode 100644
index 00000000..bf297c6e
--- /dev/null
+++ b/versions/17/src/wasm_wrapper.c
@@ -0,0 +1,49 @@
+#include
+#include
+#include
+#include
+
+static int validate_input(const char* input) {
+ return input != NULL && strlen(input) > 0;
+}
+
+static char* safe_strdup(const char* str) {
+ if (!str) return NULL;
+ char* result = strdup(str);
+ if (!result) {
+ return NULL;
+ }
+ return result;
+}
+
+static void* safe_malloc(size_t size) {
+ void* ptr = malloc(size);
+ if (!ptr && size > 0) {
+ return NULL;
+ }
+ return ptr;
+}
+
+EMSCRIPTEN_KEEPALIVE
+char* wasm_parse_query(const char* input) {
+ if (!validate_input(input)) {
+ return safe_strdup("Invalid input: query cannot be null or empty");
+ }
+
+ PgQueryParseResult result = pg_query_parse(input);
+
+ if (result.error) {
+ char* error_msg = safe_strdup(result.error->message);
+ pg_query_free_parse_result(result);
+ return error_msg ? error_msg : safe_strdup("Memory allocation failed");
+ }
+
+ char* parse_tree = safe_strdup(result.parse_tree);
+ pg_query_free_parse_result(result);
+ return parse_tree;
+}
+
+EMSCRIPTEN_KEEPALIVE
+void wasm_free_string(char* str) {
+ free(str);
+}
\ No newline at end of file
diff --git a/versions/17/test/parsing.test.js b/versions/17/test/parsing.test.js
new file mode 100644
index 00000000..9315d7d4
--- /dev/null
+++ b/versions/17/test/parsing.test.js
@@ -0,0 +1,89 @@
+const { describe, it, before } = require('node:test');
+const assert = require('node:assert/strict');
+const query = require("../");
+
+function removeLocationProperties(obj) {
+ if (typeof obj !== 'object' || obj === null) {
+ return obj;
+ }
+
+ if (Array.isArray(obj)) {
+ return obj.map(item => removeLocationProperties(item));
+ }
+
+ const result = {};
+ for (const key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ if (key === 'location' || key === 'stmt_len' || key === 'stmt_location') {
+ continue; // Skip location-related properties
+ }
+ result[key] = removeLocationProperties(obj[key]);
+ }
+ }
+ return result;
+}
+
+describe("Query Parsing", () => {
+ before(async () => {
+ await query.parse("SELECT 1");
+ });
+
+ describe("Sync Parsing", () => {
+ it("should return a single-item parse result for common queries", () => {
+ const queries = ["select 1", "select null", "select ''", "select a, b"];
+ const results = queries.map(query.parseSync);
+ results.forEach((res) => {
+ assert.equal(res.stmts.length, 1);
+ });
+
+ const selectedDatas = results.map(
+ (it) => it.stmts[0].stmt.SelectStmt.targetList
+ );
+
+ assert.equal(selectedDatas[0][0].ResTarget.val.A_Const.ival.ival, 1);
+ assert.equal(selectedDatas[1][0].ResTarget.val.A_Const.isnull, true);
+ assert.equal(selectedDatas[2][0].ResTarget.val.A_Const.sval.sval, "");
+ assert.equal(selectedDatas[3].length, 2);
+ });
+
+ it("should support parsing multiple queries", () => {
+ const res = query.parseSync("select 1; select null;");
+ assert.deepEqual(
+ res.stmts.map(removeLocationProperties),
+ [
+ ...query.parseSync("select 1;").stmts.map(removeLocationProperties),
+ ...query.parseSync("select null;").stmts.map(removeLocationProperties),
+ ]
+ );
+ });
+
+ it("should not parse a bogus query", () => {
+ assert.throws(
+ () => query.parseSync("NOT A QUERY"),
+ Error
+ );
+ });
+ });
+
+ describe("Async parsing", () => {
+ it("should return a promise resolving to same result", async () => {
+ const testQuery = "select * from john;";
+ const resPromise = query.parse(testQuery);
+ const res = await resPromise;
+
+ assert.ok(resPromise instanceof Promise);
+ assert.deepEqual(res, query.parseSync(testQuery));
+ });
+
+ it("should reject on bogus queries", async () => {
+ await assert.rejects(
+ query.parse("NOT A QUERY"),
+ (err) => {
+ assert.ok(err instanceof Error);
+ assert.match(err.message, /NOT/);
+ return true;
+ }
+ );
+ });
+ });
+});
diff --git a/versions/17/tsconfig.esm.json b/versions/17/tsconfig.esm.json
new file mode 100644
index 00000000..63012c17
--- /dev/null
+++ b/versions/17/tsconfig.esm.json
@@ -0,0 +1,9 @@
+{
+ "extends": "./tsconfig.json",
+ "compilerOptions": {
+ "module": "es2022",
+ "rootDir": "src/",
+ "declaration": false,
+ "outDir": "esm/"
+ }
+ }
\ No newline at end of file
diff --git a/versions/17/tsconfig.json b/versions/17/tsconfig.json
new file mode 100644
index 00000000..d7da207b
--- /dev/null
+++ b/versions/17/tsconfig.json
@@ -0,0 +1,18 @@
+{
+ "compilerOptions": {
+ "target": "es2022",
+ "module": "commonjs",
+ "esModuleInterop": true,
+ "forceConsistentCasingInFileNames": true,
+ "strict": true,
+ "strictNullChecks": false,
+ "skipLibCheck": true,
+ "sourceMap": false,
+ "declaration": true,
+ "resolveJsonModule": true,
+ "moduleResolution": "node",
+ "outDir": "cjs/",
+ "rootDir": "src"
+ },
+ "exclude": ["cjs", "esm", "wasm", "node_modules", "**/*.test.ts"]
+}
\ No newline at end of file