From 52acdb63b9688d03d2575d57662281644af51a95 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 22 May 2026 00:07:24 +0000 Subject: [PATCH 1/8] feat: add PostgreSQL 18 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add versions/18/ package targeting libpg_query 18.0.0 - Add types/18/ and enums/18/ packages with proto parser pointing to protos/18/ - Fetch protos/18/pg_query.proto from upstream 18.0.0 tag - Update pnpm-workspace.yaml with v18 entries - Update parser/ with v18 exports and build configs (full: 13-18, lts: 15-18) - Update CI workflow with v18 build/test matrix entries - Update scripts (fetch-protos, update-versions-types) for v18 - Update README.md and PUBLISH.md with PG 18 references Note: The full/ package (@libpg-query/parser with deparse, fingerprint, etc.) remains on PG 17 — upgrading it to PG 18 requires wasm_wrapper.c changes for the new API (deparse opts by pointer, new functions like pg_query_summary, pg_query_is_utility_stmt, reworked PL/pgSQL parsing). --- .github/workflows/ci.yml | 16 +- PUBLISH.md | 4 +- README.md | 29 +- enums/18/README.md | 81 + enums/18/jest.config.js | 18 + enums/18/package.json | 39 + enums/18/scripts/pg-proto-parser.ts | 17 + enums/18/src/index.ts | 1144 +++++++ enums/18/tsconfig.esm.json | 9 + enums/18/tsconfig.json | 9 + parser/package.json | 5 + parser/scripts/prepare.js | 6 +- pnpm-lock.yaml | 20 + pnpm-workspace.yaml | 3 + protos/18/pg_query.proto | 4234 ++++++++++++++++++++++++++ scripts/fetch-protos.js | 2 +- scripts/update-versions-types.js | 2 +- types/18/CHANGELOG.md | 40 + types/18/README.md | 106 + types/18/jest.config.js | 18 + types/18/package.json | 39 + types/18/scripts/pg-proto-parser.ts | 20 + types/18/src/enums.ts | 76 + types/18/src/index.ts | 2 + types/18/src/types.ts | 2485 +++++++++++++++ types/18/tsconfig.esm.json | 9 + types/18/tsconfig.json | 9 + versions/18/LICENSE | 22 + versions/18/Makefile | 99 + versions/18/README.md | 263 ++ versions/18/README_ERROR_HANDLING.md | 174 ++ versions/18/package.json | 52 + versions/18/scripts/build.js | 39 + versions/18/src/index.ts | 315 ++ versions/18/src/libpg-query.d.ts | 22 + versions/18/src/wasm_wrapper.c | 47 + versions/18/test/errors.test.js | 325 ++ versions/18/test/parsing.test.js | 89 + versions/18/tsconfig.esm.json | 9 + versions/18/tsconfig.json | 18 + 40 files changed, 9894 insertions(+), 22 deletions(-) create mode 100644 enums/18/README.md create mode 100644 enums/18/jest.config.js create mode 100644 enums/18/package.json create mode 100644 enums/18/scripts/pg-proto-parser.ts create mode 100644 enums/18/src/index.ts create mode 100644 enums/18/tsconfig.esm.json create mode 100644 enums/18/tsconfig.json create mode 100644 protos/18/pg_query.proto create mode 100644 types/18/CHANGELOG.md create mode 100644 types/18/README.md create mode 100644 types/18/jest.config.js create mode 100644 types/18/package.json create mode 100644 types/18/scripts/pg-proto-parser.ts create mode 100644 types/18/src/enums.ts create mode 100644 types/18/src/index.ts create mode 100644 types/18/src/types.ts create mode 100644 types/18/tsconfig.esm.json create mode 100644 types/18/tsconfig.json create mode 100644 versions/18/LICENSE create mode 100644 versions/18/Makefile create mode 100644 versions/18/README.md create mode 100644 versions/18/README_ERROR_HANDLING.md create mode 100644 versions/18/package.json create mode 100644 versions/18/scripts/build.js create mode 100644 versions/18/src/index.ts create mode 100644 versions/18/src/libpg-query.d.ts create mode 100644 versions/18/src/wasm_wrapper.c create mode 100644 versions/18/test/errors.test.js create mode 100644 versions/18/test/parsing.test.js create mode 100644 versions/18/tsconfig.esm.json create mode 100644 versions/18/tsconfig.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0f8af4..e5cad16 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,7 @@ jobs: - { name: 'v15', path: 'versions/15', version: '15' } - { name: 'v16', path: 'versions/16', version: '16' } - { name: 'v17', path: 'versions/17', version: '17' } + - { name: 'v18', path: 'versions/18', version: '18' } fail-fast: false steps: - name: Checkout Repository 📥 @@ -83,6 +84,7 @@ jobs: - { name: 'v15', path: 'versions/15', version: '15' } - { name: 'v16', path: 'versions/16', version: '16' } - { name: 'v17', path: 'versions/17', version: '17' } + - { name: 'v18', path: 'versions/18', version: '18' } fail-fast: false runs-on: ${{ matrix.os }} steps: @@ -193,9 +195,15 @@ jobs: name: wasm-artifacts-v17 path: versions/17/wasm/ + - name: Download v18 WASM Artifacts 📥 + uses: actions/download-artifact@v4 + with: + name: wasm-artifacts-v18 + path: versions/18/wasm/ + - name: Build Types Packages 🏗 run: | - for version in 13 14 15 16 17; do + for version in 13 14 15 16 17 18; do echo "Building types for v${version}..." cd types/${version} pnpm run build @@ -285,6 +293,12 @@ jobs: name: wasm-artifacts-v17 path: versions/17/wasm/ + - name: Download v18 WASM Artifacts 📥 + uses: actions/download-artifact@v4 + with: + name: wasm-artifacts-v18 + path: versions/18/wasm/ + - name: Download Parser Artifacts 📥 uses: actions/download-artifact@v4 with: diff --git a/PUBLISH.md b/PUBLISH.md index 74574b2..9de2a28 100644 --- a/PUBLISH.md +++ b/PUBLISH.md @@ -45,14 +45,14 @@ This interactive script will: The parser package supports multiple build configurations: -#### Full Build (all versions 13-17) +#### Full Build (all versions 13-18) ```bash pnpm run publish:parser # or with specific build type PARSER_BUILD_TYPE=full pnpm run publish:parser ``` -#### LTS Build (versions 16-17) +#### LTS Build (versions 15-18) ```bash PARSER_BUILD_TYPE=lts pnpm run publish:parser ``` diff --git a/README.md b/README.md index d79ee54..a277766 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ -
+
@@ -40,14 +40,14 @@ Built to power [pgsql-parser](https://github.com/constructive-io/pgsql-parser), ### 🔀 Multi-Version Support with @pgsql/parser > **Need to support multiple PostgreSQL versions at runtime?** -> Use [`@pgsql/parser`](https://github.com/constructive-io/libpg-query-node/tree/main/parser) for dynamic version selection — parse SQL with PostgreSQL 15, 16, or 17 in a single package! +> Use [`@pgsql/parser`](https://github.com/constructive-io/libpg-query-node/tree/main/parser) for dynamic version selection — parse SQL with PostgreSQL 15, 16, 17, or 18 in a single package! > > ```typescript > import { parse } from '@pgsql/parser'; > > // Parse with specific PostgreSQL version > const result15 = await parse('SELECT * FROM users', 15); -> const result17 = await parse('SELECT * FROM users', 17); +> const result18 = await parse('SELECT * FROM users', 18); > ``` ## Installation @@ -62,7 +62,7 @@ npm install libpg-query import { parse } from 'libpg-query'; const result = await parse('SELECT * FROM users WHERE active = true'); -// {"version":170004,"stmts":[{"stmt":{"SelectStmt":{"targetList":[{"ResTarget" ... "op":"SETOP_NONE"}}}]} +// {"version":180004,"stmts":[{"stmt":{"SelectStmt":{"targetList":[{"ResTarget" ... "op":"SETOP_NONE"}}}]} ``` ## 📦 Packages @@ -73,10 +73,10 @@ This repository contains multiple packages to support different PostgreSQL versi | Package | Description | PostgreSQL Versions | npm Package | |---------|-------------|---------------------|-------------| -| **[libpg-query](https://github.com/constructive-io/libpg-query-node/tree/main/versions)** | Lightweight parser (parse only) | 13, 14, 15, 16, 17 | [`libpg-query`](https://www.npmjs.com/package/libpg-query) | -| **[@pgsql/parser](https://github.com/constructive-io/libpg-query-node/tree/main/parser)** | Multi-version parser (runtime selection) | 15, 16, 17 | [`@pgsql/parser`](https://www.npmjs.com/package/@pgsql/parser) | -| **[@pgsql/types](https://github.com/constructive-io/libpg-query-node/tree/main/types)** | TypeScript type definitions | 13, 14, 15, 16, 17 | [`@pgsql/types`](https://www.npmjs.com/package/@pgsql/types) | -| **[@pgsql/enums](https://github.com/constructive-io/libpg-query-node/tree/main/enums)** | TypeScript enum definitions | 13, 14, 15, 16, 17 | [`@pgsql/enums`](https://www.npmjs.com/package/@pgsql/enums) | +| **[libpg-query](https://github.com/constructive-io/libpg-query-node/tree/main/versions)** | Lightweight parser (parse only) | 13, 14, 15, 16, 17, 18 | [`libpg-query`](https://www.npmjs.com/package/libpg-query) | +| **[@pgsql/parser](https://github.com/constructive-io/libpg-query-node/tree/main/parser)** | Multi-version parser (runtime selection) | 15, 16, 17, 18 | [`@pgsql/parser`](https://www.npmjs.com/package/@pgsql/parser) | +| **[@pgsql/types](https://github.com/constructive-io/libpg-query-node/tree/main/types)** | TypeScript type definitions | 13, 14, 15, 16, 17, 18 | [`@pgsql/types`](https://www.npmjs.com/package/@pgsql/types) | +| **[@pgsql/enums](https://github.com/constructive-io/libpg-query-node/tree/main/enums)** | TypeScript enum definitions | 13, 14, 15, 16, 17, 18 | [`@pgsql/enums`](https://www.npmjs.com/package/@pgsql/enums) | | **[@libpg-query/parser](https://github.com/constructive-io/libpg-query-node/tree/main/full)** | Full parser with all features | 17 only | [`@libpg-query/parser`](https://www.npmjs.com/package/@libpg-query/parser) | ### Version Tags @@ -85,12 +85,13 @@ Each versioned package uses npm dist-tags for PostgreSQL version selection: ```bash # Install specific PostgreSQL version -npm install libpg-query@pg17 # PostgreSQL 17 (latest) +npm install libpg-query@pg18 # PostgreSQL 18 (latest) +npm install libpg-query@pg17 # PostgreSQL 17 npm install libpg-query@pg16 # PostgreSQL 16 -npm install @pgsql/types@pg17 # Types for PostgreSQL 17 +npm install @pgsql/types@pg18 # Types for PostgreSQL 18 npm install @pgsql/enums@pg15 # Enums for PostgreSQL 15 -# Install latest (defaults to pg17) +# Install latest (defaults to pg18) npm install libpg-query npm install @pgsql/types npm install @pgsql/enums @@ -108,10 +109,10 @@ npm install @pgsql/enums For detailed API documentation and usage examples, see the package-specific READMEs: -- **libpg-query** - [Parser API Documentation](https://github.com/constructive-io/libpg-query-node/tree/main/versions/17) +- **libpg-query** - [Parser API Documentation](https://github.com/constructive-io/libpg-query-node/tree/main/versions/18) - **@pgsql/parser** - [Multi-Version Parser Documentation](https://github.com/constructive-io/libpg-query-node/tree/main/parser) -- **@pgsql/types** - [Types Documentation](https://github.com/constructive-io/libpg-query-node/tree/main/types/17) -- **@pgsql/enums** - [Enums Documentation](https://github.com/constructive-io/libpg-query-node/tree/main/enums/17) +- **@pgsql/types** - [Types Documentation](https://github.com/constructive-io/libpg-query-node/tree/main/types/18) +- **@pgsql/enums** - [Enums Documentation](https://github.com/constructive-io/libpg-query-node/tree/main/enums/18) - **@libpg-query/parser** - [Full Parser Documentation](https://github.com/constructive-io/libpg-query-node/tree/main/full) ## Build Instructions diff --git a/enums/18/README.md b/enums/18/README.md new file mode 100644 index 0000000..b94add9 --- /dev/null +++ b/enums/18/README.md @@ -0,0 +1,81 @@ +# @pgsql/enums + +

+ +

+ +

+ + + + + + + +

+ +`@pgsql/enums` is a TypeScript library providing enum definitions for PostgreSQL AST nodes, primarily used in conjunction with [`pgsql-parser`](https://github.com/constructive-io/pgsql-parser). It offers a comprehensive and type-safe way to work with PostgreSQL enum values in query parsing and AST manipulation. + + +## Installation + +Install the package via npm: + +```bash +npm install @pgsql/enums +``` + +## Usage + +Here's a simple example showing how to work with enums, converting between enum names and their numeric values: + +```ts +import { ObjectType } from '@pgsql/enums'; + +// Get the numeric value of an enum +const tableValue = ObjectType.OBJECT_TABLE; +console.log(tableValue); // 41 + +// Convert from value back to enum name +const enumName = ObjectType[41]; +console.log(enumName); // "OBJECT_TABLE" + +// Use in comparisons +if (someNode.objectType === ObjectType.OBJECT_TABLE) { + console.log("This is a table object"); +} +``` + +## Versions + +Our latest is built with PostgreSQL 17 enum definitions. + +| PG Major Version | libpg_query | npm dist-tag +|--------------------------|-------------|---------| +| 17 | 17-6.1.0 | [`pg17`](https://www.npmjs.com/package/@pgsql/enums/v/latest) +| 16 | 16-5.2.0 | [`pg16`](https://www.npmjs.com/package/@pgsql/enums/v/pg16) +| 15 | 15-4.2.4 | [`pg15`](https://www.npmjs.com/package/@pgsql/enums/v/pg15) +| 14 | 14-3.0.0 | [`pg14`](https://www.npmjs.com/package/@pgsql/enums/v/pg14) +| 13 | 13-2.2.0 | [`pg13`](https://www.npmjs.com/package/@pgsql/enums/v/pg13) + +## Related + +* [pgsql-parser](https://www.npmjs.com/package/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://www.npmjs.com/package/pgsql-deparser): A streamlined tool designed for converting PostgreSQL ASTs back into SQL queries, focusing solely on deparser functionality to complement `pgsql-parser`. +* [@pgsql/parser](https://www.npmjs.com/package/@pgsql/parser): Multi-version PostgreSQL parser with dynamic version selection at runtime, supporting PostgreSQL 15, 16, and 17 in a single package. +* [@pgsql/types](https://www.npmjs.com/package/@pgsql/types): Offers TypeScript type definitions for PostgreSQL AST nodes, facilitating type-safe construction, analysis, and manipulation of ASTs. +* [@pgsql/enums](https://www.npmjs.com/package/@pgsql/enums): Provides TypeScript enum definitions for PostgreSQL constants, enabling type-safe usage of PostgreSQL enums and constants in your applications. +* [@pgsql/utils](https://www.npmjs.com/package/@pgsql/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://www.npmjs.com/package/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/constructive-io/libpg-query-node): The real PostgreSQL parser exposed for Node.js, used primarily in `pgsql-parser` for parsing and deparsing SQL queries. + +## Credits + +**🛠 Built by the [Constructive](https://constructive.io) team — creators of modular Postgres tooling for secure, composable backends. If you like our work, contribute on [GitHub](https://github.com/constructive-io).** + + +## 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/enums/18/jest.config.js b/enums/18/jest.config.js new file mode 100644 index 0000000..dd240f0 --- /dev/null +++ b/enums/18/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/*"] +}; \ No newline at end of file diff --git a/enums/18/package.json b/enums/18/package.json new file mode 100644 index 0000000..e8257aa --- /dev/null +++ b/enums/18/package.json @@ -0,0 +1,39 @@ +{ + "name": "@libpg-query/enums18", + "version": "18.0.1", + "author": "Constructive ", + "description": "PostgreSQL AST enums from the real Postgres parser", + "main": "index.js", + "module": "esm/index.js", + "types": "index.d.ts", + "homepage": "https://github.com/constructive-io/libpg-query-node", + "license": "MIT", + "publishConfig": { + "access": "public", + "directory": "dist" + }, + "repository": { + "type": "git", + "url": "https://github.com/constructive-io/libpg-query-node" + }, + "bugs": { + "url": "https://github.com/constructive-io/libpg-query-node/issues" + }, + "x-publish": { + "publishName": "@pgsql/enums", + "distTag": "pg18" + }, + "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:enums": "node -e \"require('../../scripts/prepare-enums.js').preparePackageForPublish('.')\"", + "lint": "eslint . --fix" + }, + "keywords": [], + "devDependencies": { + "pg-proto-parser": "^1.28.2" + } +} diff --git a/enums/18/scripts/pg-proto-parser.ts b/enums/18/scripts/pg-proto-parser.ts new file mode 100644 index 0000000..0134cf4 --- /dev/null +++ b/enums/18/scripts/pg-proto-parser.ts @@ -0,0 +1,17 @@ +import { PgProtoParser, PgProtoParserOptions } from 'pg-proto-parser'; +import { resolve, join } from 'path'; + +const inFile: string = join(__dirname, '../../../protos/18/pg_query.proto'); +const outDir: string = resolve(join(__dirname, '../src')); + +const options: PgProtoParserOptions = { + outDir, + enums: { + enabled: true, + enumsAsTypeUnion: false, + filename: 'index.ts' + } +}; +const parser = new PgProtoParser(inFile, options); + +parser.write(); \ No newline at end of file diff --git a/enums/18/src/index.ts b/enums/18/src/index.ts new file mode 100644 index 0000000..9a9e632 --- /dev/null +++ b/enums/18/src/index.ts @@ -0,0 +1,1144 @@ +/** +* 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 enum QuerySource { + QSRC_ORIGINAL = 0, + QSRC_PARSER = 1, + QSRC_INSTEAD_RULE = 2, + QSRC_QUAL_INSTEAD_RULE = 3, + QSRC_NON_INSTEAD_RULE = 4, +} +export enum SortByDir { + SORTBY_DEFAULT = 0, + SORTBY_ASC = 1, + SORTBY_DESC = 2, + SORTBY_USING = 3, +} +export enum SortByNulls { + SORTBY_NULLS_DEFAULT = 0, + SORTBY_NULLS_FIRST = 1, + SORTBY_NULLS_LAST = 2, +} +export enum SetQuantifier { + SET_QUANTIFIER_DEFAULT = 0, + SET_QUANTIFIER_ALL = 1, + SET_QUANTIFIER_DISTINCT = 2, +} +export enum A_Expr_Kind { + AEXPR_OP = 0, + AEXPR_OP_ANY = 1, + AEXPR_OP_ALL = 2, + AEXPR_DISTINCT = 3, + AEXPR_NOT_DISTINCT = 4, + AEXPR_NULLIF = 5, + AEXPR_IN = 6, + AEXPR_LIKE = 7, + AEXPR_ILIKE = 8, + AEXPR_SIMILAR = 9, + AEXPR_BETWEEN = 10, + AEXPR_NOT_BETWEEN = 11, + AEXPR_BETWEEN_SYM = 12, + AEXPR_NOT_BETWEEN_SYM = 13, +} +export enum RoleSpecType { + ROLESPEC_CSTRING = 0, + ROLESPEC_CURRENT_ROLE = 1, + ROLESPEC_CURRENT_USER = 2, + ROLESPEC_SESSION_USER = 3, + ROLESPEC_PUBLIC = 4, +} +export enum TableLikeOption { + CREATE_TABLE_LIKE_COMMENTS = 0, + CREATE_TABLE_LIKE_COMPRESSION = 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, +} +export enum DefElemAction { + DEFELEM_UNSPEC = 0, + DEFELEM_SET = 1, + DEFELEM_ADD = 2, + DEFELEM_DROP = 3, +} +export enum PartitionStrategy { + PARTITION_STRATEGY_LIST = 0, + PARTITION_STRATEGY_RANGE = 1, + PARTITION_STRATEGY_HASH = 2, +} +export enum PartitionRangeDatumKind { + PARTITION_RANGE_DATUM_MINVALUE = 0, + PARTITION_RANGE_DATUM_VALUE = 1, + PARTITION_RANGE_DATUM_MAXVALUE = 2, +} +export enum RTEKind { + RTE_RELATION = 0, + RTE_SUBQUERY = 1, + RTE_JOIN = 2, + RTE_FUNCTION = 3, + RTE_TABLEFUNC = 4, + RTE_VALUES = 5, + RTE_CTE = 6, + RTE_NAMEDTUPLESTORE = 7, + RTE_RESULT = 8, +} +export enum WCOKind { + WCO_VIEW_CHECK = 0, + WCO_RLS_INSERT_CHECK = 1, + WCO_RLS_UPDATE_CHECK = 2, + WCO_RLS_CONFLICT_CHECK = 3, + WCO_RLS_MERGE_UPDATE_CHECK = 4, + WCO_RLS_MERGE_DELETE_CHECK = 5, +} +export enum GroupingSetKind { + GROUPING_SET_EMPTY = 0, + GROUPING_SET_SIMPLE = 1, + GROUPING_SET_ROLLUP = 2, + GROUPING_SET_CUBE = 3, + GROUPING_SET_SETS = 4, +} +export enum CTEMaterialize { + CTEMaterializeDefault = 0, + CTEMaterializeAlways = 1, + CTEMaterializeNever = 2, +} +export enum JsonQuotes { + JS_QUOTES_UNSPEC = 0, + JS_QUOTES_KEEP = 1, + JS_QUOTES_OMIT = 2, +} +export enum JsonTableColumnType { + JTC_FOR_ORDINALITY = 0, + JTC_REGULAR = 1, + JTC_EXISTS = 2, + JTC_FORMATTED = 3, + JTC_NESTED = 4, +} +export enum SetOperation { + SETOP_NONE = 0, + SETOP_UNION = 1, + SETOP_INTERSECT = 2, + SETOP_EXCEPT = 3, +} +export enum ObjectType { + OBJECT_ACCESS_METHOD = 0, + OBJECT_AGGREGATE = 1, + OBJECT_AMOP = 2, + OBJECT_AMPROC = 3, + OBJECT_ATTRIBUTE = 4, + OBJECT_CAST = 5, + OBJECT_COLUMN = 6, + OBJECT_COLLATION = 7, + OBJECT_CONVERSION = 8, + OBJECT_DATABASE = 9, + OBJECT_DEFAULT = 10, + OBJECT_DEFACL = 11, + OBJECT_DOMAIN = 12, + OBJECT_DOMCONSTRAINT = 13, + OBJECT_EVENT_TRIGGER = 14, + OBJECT_EXTENSION = 15, + OBJECT_FDW = 16, + OBJECT_FOREIGN_SERVER = 17, + OBJECT_FOREIGN_TABLE = 18, + OBJECT_FUNCTION = 19, + OBJECT_INDEX = 20, + OBJECT_LANGUAGE = 21, + OBJECT_LARGEOBJECT = 22, + OBJECT_MATVIEW = 23, + OBJECT_OPCLASS = 24, + OBJECT_OPERATOR = 25, + OBJECT_OPFAMILY = 26, + OBJECT_PARAMETER_ACL = 27, + OBJECT_POLICY = 28, + OBJECT_PROCEDURE = 29, + OBJECT_PUBLICATION = 30, + OBJECT_PUBLICATION_NAMESPACE = 31, + OBJECT_PUBLICATION_REL = 32, + OBJECT_ROLE = 33, + OBJECT_ROUTINE = 34, + OBJECT_RULE = 35, + OBJECT_SCHEMA = 36, + OBJECT_SEQUENCE = 37, + OBJECT_SUBSCRIPTION = 38, + OBJECT_STATISTIC_EXT = 39, + OBJECT_TABCONSTRAINT = 40, + OBJECT_TABLE = 41, + OBJECT_TABLESPACE = 42, + OBJECT_TRANSFORM = 43, + OBJECT_TRIGGER = 44, + OBJECT_TSCONFIGURATION = 45, + OBJECT_TSDICTIONARY = 46, + OBJECT_TSPARSER = 47, + OBJECT_TSTEMPLATE = 48, + OBJECT_TYPE = 49, + OBJECT_USER_MAPPING = 50, + OBJECT_VIEW = 51, +} +export enum DropBehavior { + DROP_RESTRICT = 0, + DROP_CASCADE = 1, +} +export enum AlterTableType { + AT_AddColumn = 0, + AT_AddColumnToView = 1, + AT_ColumnDefault = 2, + AT_CookedColumnDefault = 3, + AT_DropNotNull = 4, + AT_SetNotNull = 5, + AT_SetExpression = 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, +} +export enum GrantTargetType { + ACL_TARGET_OBJECT = 0, + ACL_TARGET_ALL_IN_SCHEMA = 1, + ACL_TARGET_DEFAULTS = 2, +} +export enum VariableSetKind { + VAR_SET_VALUE = 0, + VAR_SET_DEFAULT = 1, + VAR_SET_CURRENT = 2, + VAR_SET_MULTI = 3, + VAR_RESET = 4, + VAR_RESET_ALL = 5, +} +export enum ConstrType { + CONSTR_NULL = 0, + CONSTR_NOTNULL = 1, + CONSTR_DEFAULT = 2, + CONSTR_IDENTITY = 3, + CONSTR_GENERATED = 4, + CONSTR_CHECK = 5, + CONSTR_PRIMARY = 6, + CONSTR_UNIQUE = 7, + CONSTR_EXCLUSION = 8, + CONSTR_FOREIGN = 9, + CONSTR_ATTR_DEFERRABLE = 10, + CONSTR_ATTR_NOT_DEFERRABLE = 11, + CONSTR_ATTR_DEFERRED = 12, + CONSTR_ATTR_IMMEDIATE = 13, +} +export enum ImportForeignSchemaType { + FDW_IMPORT_SCHEMA_ALL = 0, + FDW_IMPORT_SCHEMA_LIMIT_TO = 1, + FDW_IMPORT_SCHEMA_EXCEPT = 2, +} +export enum RoleStmtType { + ROLESTMT_ROLE = 0, + ROLESTMT_USER = 1, + ROLESTMT_GROUP = 2, +} +export enum FetchDirection { + FETCH_FORWARD = 0, + FETCH_BACKWARD = 1, + FETCH_ABSOLUTE = 2, + FETCH_RELATIVE = 3, +} +export enum FunctionParameterMode { + FUNC_PARAM_IN = 0, + FUNC_PARAM_OUT = 1, + FUNC_PARAM_INOUT = 2, + FUNC_PARAM_VARIADIC = 3, + FUNC_PARAM_TABLE = 4, + FUNC_PARAM_DEFAULT = 5, +} +export enum TransactionStmtKind { + TRANS_STMT_BEGIN = 0, + TRANS_STMT_START = 1, + TRANS_STMT_COMMIT = 2, + TRANS_STMT_ROLLBACK = 3, + TRANS_STMT_SAVEPOINT = 4, + TRANS_STMT_RELEASE = 5, + TRANS_STMT_ROLLBACK_TO = 6, + TRANS_STMT_PREPARE = 7, + TRANS_STMT_COMMIT_PREPARED = 8, + TRANS_STMT_ROLLBACK_PREPARED = 9, +} +export enum ViewCheckOption { + NO_CHECK_OPTION = 0, + LOCAL_CHECK_OPTION = 1, + CASCADED_CHECK_OPTION = 2, +} +export enum DiscardMode { + DISCARD_ALL = 0, + DISCARD_PLANS = 1, + DISCARD_SEQUENCES = 2, + DISCARD_TEMP = 3, +} +export enum ReindexObjectType { + REINDEX_OBJECT_INDEX = 0, + REINDEX_OBJECT_TABLE = 1, + REINDEX_OBJECT_SCHEMA = 2, + REINDEX_OBJECT_SYSTEM = 3, + REINDEX_OBJECT_DATABASE = 4, +} +export enum AlterTSConfigType { + ALTER_TSCONFIG_ADD_MAPPING = 0, + ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN = 1, + ALTER_TSCONFIG_REPLACE_DICT = 2, + ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN = 3, + ALTER_TSCONFIG_DROP_MAPPING = 4, +} +export enum PublicationObjSpecType { + PUBLICATIONOBJ_TABLE = 0, + PUBLICATIONOBJ_TABLES_IN_SCHEMA = 1, + PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA = 2, + PUBLICATIONOBJ_CONTINUATION = 3, +} +export enum AlterPublicationAction { + AP_AddObjects = 0, + AP_DropObjects = 1, + AP_SetObjects = 2, +} +export enum AlterSubscriptionType { + ALTER_SUBSCRIPTION_OPTIONS = 0, + ALTER_SUBSCRIPTION_CONNECTION = 1, + ALTER_SUBSCRIPTION_SET_PUBLICATION = 2, + ALTER_SUBSCRIPTION_ADD_PUBLICATION = 3, + ALTER_SUBSCRIPTION_DROP_PUBLICATION = 4, + ALTER_SUBSCRIPTION_REFRESH = 5, + ALTER_SUBSCRIPTION_ENABLED = 6, + ALTER_SUBSCRIPTION_SKIP = 7, +} +export enum OverridingKind { + OVERRIDING_NOT_SET = 0, + OVERRIDING_USER_VALUE = 1, + OVERRIDING_SYSTEM_VALUE = 2, +} +export enum OnCommitAction { + ONCOMMIT_NOOP = 0, + ONCOMMIT_PRESERVE_ROWS = 1, + ONCOMMIT_DELETE_ROWS = 2, + ONCOMMIT_DROP = 3, +} +export enum TableFuncType { + TFT_XMLTABLE = 0, + TFT_JSON_TABLE = 1, +} +export enum ParamKind { + PARAM_EXTERN = 0, + PARAM_EXEC = 1, + PARAM_SUBLINK = 2, + PARAM_MULTIEXPR = 3, +} +export enum CoercionContext { + COERCION_IMPLICIT = 0, + COERCION_ASSIGNMENT = 1, + COERCION_PLPGSQL = 2, + COERCION_EXPLICIT = 3, +} +export enum CoercionForm { + COERCE_EXPLICIT_CALL = 0, + COERCE_EXPLICIT_CAST = 1, + COERCE_IMPLICIT_CAST = 2, + COERCE_SQL_SYNTAX = 3, +} +export enum BoolExprType { + AND_EXPR = 0, + OR_EXPR = 1, + NOT_EXPR = 2, +} +export enum SubLinkType { + EXISTS_SUBLINK = 0, + ALL_SUBLINK = 1, + ANY_SUBLINK = 2, + ROWCOMPARE_SUBLINK = 3, + EXPR_SUBLINK = 4, + MULTIEXPR_SUBLINK = 5, + ARRAY_SUBLINK = 6, + CTE_SUBLINK = 7, +} +export enum RowCompareType { + ROWCOMPARE_LT = 0, + ROWCOMPARE_LE = 1, + ROWCOMPARE_EQ = 2, + ROWCOMPARE_GE = 3, + ROWCOMPARE_GT = 4, + ROWCOMPARE_NE = 5, +} +export enum MinMaxOp { + IS_GREATEST = 0, + IS_LEAST = 1, +} +export enum SQLValueFunctionOp { + SVFOP_CURRENT_DATE = 0, + SVFOP_CURRENT_TIME = 1, + SVFOP_CURRENT_TIME_N = 2, + SVFOP_CURRENT_TIMESTAMP = 3, + SVFOP_CURRENT_TIMESTAMP_N = 4, + SVFOP_LOCALTIME = 5, + SVFOP_LOCALTIME_N = 6, + SVFOP_LOCALTIMESTAMP = 7, + SVFOP_LOCALTIMESTAMP_N = 8, + SVFOP_CURRENT_ROLE = 9, + SVFOP_CURRENT_USER = 10, + SVFOP_USER = 11, + SVFOP_SESSION_USER = 12, + SVFOP_CURRENT_CATALOG = 13, + SVFOP_CURRENT_SCHEMA = 14, +} +export enum XmlExprOp { + IS_XMLCONCAT = 0, + IS_XMLELEMENT = 1, + IS_XMLFOREST = 2, + IS_XMLPARSE = 3, + IS_XMLPI = 4, + IS_XMLROOT = 5, + IS_XMLSERIALIZE = 6, + IS_DOCUMENT = 7, +} +export enum XmlOptionType { + XMLOPTION_DOCUMENT = 0, + XMLOPTION_CONTENT = 1, +} +export enum JsonEncoding { + JS_ENC_DEFAULT = 0, + JS_ENC_UTF8 = 1, + JS_ENC_UTF16 = 2, + JS_ENC_UTF32 = 3, +} +export enum JsonFormatType { + JS_FORMAT_DEFAULT = 0, + JS_FORMAT_JSON = 1, + JS_FORMAT_JSONB = 2, +} +export enum JsonConstructorType { + JSCTOR_JSON_OBJECT = 0, + JSCTOR_JSON_ARRAY = 1, + JSCTOR_JSON_OBJECTAGG = 2, + JSCTOR_JSON_ARRAYAGG = 3, + JSCTOR_JSON_PARSE = 4, + JSCTOR_JSON_SCALAR = 5, + JSCTOR_JSON_SERIALIZE = 6, +} +export enum JsonValueType { + JS_TYPE_ANY = 0, + JS_TYPE_OBJECT = 1, + JS_TYPE_ARRAY = 2, + JS_TYPE_SCALAR = 3, +} +export enum JsonWrapper { + JSW_UNSPEC = 0, + JSW_NONE = 1, + JSW_CONDITIONAL = 2, + JSW_UNCONDITIONAL = 3, +} +export enum JsonBehaviorType { + JSON_BEHAVIOR_NULL = 0, + JSON_BEHAVIOR_ERROR = 1, + JSON_BEHAVIOR_EMPTY = 2, + JSON_BEHAVIOR_TRUE = 3, + JSON_BEHAVIOR_FALSE = 4, + JSON_BEHAVIOR_UNKNOWN = 5, + JSON_BEHAVIOR_EMPTY_ARRAY = 6, + JSON_BEHAVIOR_EMPTY_OBJECT = 7, + JSON_BEHAVIOR_DEFAULT = 8, +} +export enum JsonExprOp { + JSON_EXISTS_OP = 0, + JSON_QUERY_OP = 1, + JSON_VALUE_OP = 2, + JSON_TABLE_OP = 3, +} +export enum NullTestType { + IS_NULL = 0, + IS_NOT_NULL = 1, +} +export enum BoolTestType { + IS_TRUE = 0, + IS_NOT_TRUE = 1, + IS_FALSE = 2, + IS_NOT_FALSE = 3, + IS_UNKNOWN = 4, + IS_NOT_UNKNOWN = 5, +} +export enum MergeMatchKind { + MERGE_WHEN_MATCHED = 0, + MERGE_WHEN_NOT_MATCHED_BY_SOURCE = 1, + MERGE_WHEN_NOT_MATCHED_BY_TARGET = 2, +} +export enum CmdType { + CMD_UNKNOWN = 0, + CMD_SELECT = 1, + CMD_UPDATE = 2, + CMD_INSERT = 3, + CMD_DELETE = 4, + CMD_MERGE = 5, + CMD_UTILITY = 6, + CMD_NOTHING = 7, +} +export enum JoinType { + JOIN_INNER = 0, + JOIN_LEFT = 1, + JOIN_FULL = 2, + JOIN_RIGHT = 3, + JOIN_SEMI = 4, + JOIN_ANTI = 5, + JOIN_RIGHT_ANTI = 6, + JOIN_UNIQUE_OUTER = 7, + JOIN_UNIQUE_INNER = 8, +} +export enum AggStrategy { + AGG_PLAIN = 0, + AGG_SORTED = 1, + AGG_HASHED = 2, + AGG_MIXED = 3, +} +export enum AggSplit { + AGGSPLIT_SIMPLE = 0, + AGGSPLIT_INITIAL_SERIAL = 1, + AGGSPLIT_FINAL_DESERIAL = 2, +} +export enum SetOpCmd { + SETOPCMD_INTERSECT = 0, + SETOPCMD_INTERSECT_ALL = 1, + SETOPCMD_EXCEPT = 2, + SETOPCMD_EXCEPT_ALL = 3, +} +export enum SetOpStrategy { + SETOP_SORTED = 0, + SETOP_HASHED = 1, +} +export enum OnConflictAction { + ONCONFLICT_NONE = 0, + ONCONFLICT_NOTHING = 1, + ONCONFLICT_UPDATE = 2, +} +export enum LimitOption { + LIMIT_OPTION_DEFAULT = 0, + LIMIT_OPTION_COUNT = 1, + LIMIT_OPTION_WITH_TIES = 2, +} +export enum LockClauseStrength { + LCS_NONE = 0, + LCS_FORKEYSHARE = 1, + LCS_FORSHARE = 2, + LCS_FORNOKEYUPDATE = 3, + LCS_FORUPDATE = 4, +} +export enum LockWaitPolicy { + LockWaitBlock = 0, + LockWaitSkip = 1, + LockWaitError = 2, +} +export enum LockTupleMode { + LockTupleKeyShare = 0, + LockTupleShare = 1, + LockTupleNoKeyExclusive = 2, + LockTupleExclusive = 3, +} +export enum KeywordKind { + NO_KEYWORD = 0, + UNRESERVED_KEYWORD = 1, + COL_NAME_KEYWORD = 2, + TYPE_FUNC_NAME_KEYWORD = 3, + RESERVED_KEYWORD = 4, +} +export enum Token { + NUL = 0, + 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, + 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, +} \ No newline at end of file diff --git a/enums/18/tsconfig.esm.json b/enums/18/tsconfig.esm.json new file mode 100644 index 0000000..819f8f0 --- /dev/null +++ b/enums/18/tsconfig.esm.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "dist/esm", + "module": "es2022", + "rootDir": "src/", + "declaration": false + } +} \ No newline at end of file diff --git a/enums/18/tsconfig.json b/enums/18/tsconfig.json new file mode 100644 index 0000000..42cb86b --- /dev/null +++ b/enums/18/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "dist", + "rootDir": "src/" + }, + "include": ["src/**/*.ts"], + "exclude": ["dist", "node_modules", "**/*.spec.*", "**/*.test.*"] +} \ No newline at end of file diff --git a/parser/package.json b/parser/package.json index e286547..87fb3d6 100644 --- a/parser/package.json +++ b/parser/package.json @@ -36,6 +36,11 @@ "import": "./wasm/v17.js", "require": "./wasm/v17.cjs", "types": "./wasm/v17.d.ts" + }, + "./v18": { + "import": "./wasm/v18.js", + "require": "./wasm/v18.cjs", + "types": "./wasm/v18.d.ts" } }, "files": [ diff --git a/parser/scripts/prepare.js b/parser/scripts/prepare.js index 7d48dbf..a5df29e 100644 --- a/parser/scripts/prepare.js +++ b/parser/scripts/prepare.js @@ -5,11 +5,11 @@ const path = require('path'); // Build configurations for different tags const BUILD_CONFIGS = { 'full': { - versions: ['13', '14', '15', '16', '17'], - description: 'Full build with all PostgreSQL versions (13-17)' + versions: ['13', '14', '15', '16', '17', '18'], + description: 'Full build with all PostgreSQL versions (13-18)' }, 'lts': { - versions: ['15', '16', '17'], + versions: ['15', '16', '17', '18'], description: 'LTS (Long Term Support)' } }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8d34582..545c689 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -65,6 +65,13 @@ importers: version: 1.28.2 publishDirectory: dist + enums/18: + devDependencies: + pg-proto-parser: + specifier: ^1.28.2 + version: 1.28.2 + publishDirectory: dist + full: dependencies: '@launchql/protobufjs': @@ -125,6 +132,13 @@ importers: version: 1.28.2 publishDirectory: dist + types/18: + devDependencies: + pg-proto-parser: + specifier: ^1.28.2 + version: 1.28.2 + publishDirectory: dist + versions/13: dependencies: '@pgsql/types': @@ -155,6 +169,12 @@ importers: specifier: ^17.6.2 version: 17.6.2 + versions/18: + dependencies: + '@pgsql/types': + specifier: ^17.6.2 + version: 17.6.2 + packages: /@babel/code-frame@7.27.1: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 39d90fe..7135354 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,16 +1,19 @@ packages: - 'parser' - 'full' + - 'versions/18' - 'versions/17' - 'versions/16' - 'versions/15' - 'versions/14' - 'versions/13' + - 'types/18' - 'types/17' - 'types/16' - 'types/15' - 'types/14' - 'types/13' + - 'enums/18' - 'enums/17' - 'enums/16' - 'enums/15' diff --git a/protos/18/pg_query.proto b/protos/18/pg_query.proto new file mode 100644 index 0000000..3f8bf1a --- /dev/null +++ b/protos/18/pg_query.proto @@ -0,0 +1,4234 @@ +// 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"]; + ReturningExpr returning_expr = 59 [json_name="ReturningExpr"]; + TargetEntry target_entry = 60 [json_name="TargetEntry"]; + RangeTblRef range_tbl_ref = 61 [json_name="RangeTblRef"]; + JoinExpr join_expr = 62 [json_name="JoinExpr"]; + FromExpr from_expr = 63 [json_name="FromExpr"]; + OnConflictExpr on_conflict_expr = 64 [json_name="OnConflictExpr"]; + Query query = 65 [json_name="Query"]; + TypeName type_name = 66 [json_name="TypeName"]; + ColumnRef column_ref = 67 [json_name="ColumnRef"]; + ParamRef param_ref = 68 [json_name="ParamRef"]; + A_Expr a_expr = 69 [json_name="A_Expr"]; + TypeCast type_cast = 70 [json_name="TypeCast"]; + CollateClause collate_clause = 71 [json_name="CollateClause"]; + RoleSpec role_spec = 72 [json_name="RoleSpec"]; + FuncCall func_call = 73 [json_name="FuncCall"]; + A_Star a_star = 74 [json_name="A_Star"]; + A_Indices a_indices = 75 [json_name="A_Indices"]; + A_Indirection a_indirection = 76 [json_name="A_Indirection"]; + A_ArrayExpr a_array_expr = 77 [json_name="A_ArrayExpr"]; + ResTarget res_target = 78 [json_name="ResTarget"]; + MultiAssignRef multi_assign_ref = 79 [json_name="MultiAssignRef"]; + SortBy sort_by = 80 [json_name="SortBy"]; + WindowDef window_def = 81 [json_name="WindowDef"]; + RangeSubselect range_subselect = 82 [json_name="RangeSubselect"]; + RangeFunction range_function = 83 [json_name="RangeFunction"]; + RangeTableFunc range_table_func = 84 [json_name="RangeTableFunc"]; + RangeTableFuncCol range_table_func_col = 85 [json_name="RangeTableFuncCol"]; + RangeTableSample range_table_sample = 86 [json_name="RangeTableSample"]; + ColumnDef column_def = 87 [json_name="ColumnDef"]; + TableLikeClause table_like_clause = 88 [json_name="TableLikeClause"]; + IndexElem index_elem = 89 [json_name="IndexElem"]; + DefElem def_elem = 90 [json_name="DefElem"]; + LockingClause locking_clause = 91 [json_name="LockingClause"]; + XmlSerialize xml_serialize = 92 [json_name="XmlSerialize"]; + PartitionElem partition_elem = 93 [json_name="PartitionElem"]; + PartitionSpec partition_spec = 94 [json_name="PartitionSpec"]; + PartitionBoundSpec partition_bound_spec = 95 [json_name="PartitionBoundSpec"]; + PartitionRangeDatum partition_range_datum = 96 [json_name="PartitionRangeDatum"]; + 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"]; + ReturningOption returning_option = 114 [json_name="ReturningOption"]; + ReturningClause returning_clause = 115 [json_name="ReturningClause"]; + TriggerTransition trigger_transition = 116 [json_name="TriggerTransition"]; + JsonOutput json_output = 117 [json_name="JsonOutput"]; + JsonArgument json_argument = 118 [json_name="JsonArgument"]; + JsonFuncExpr json_func_expr = 119 [json_name="JsonFuncExpr"]; + JsonTablePathSpec json_table_path_spec = 120 [json_name="JsonTablePathSpec"]; + JsonTable json_table = 121 [json_name="JsonTable"]; + JsonTableColumn json_table_column = 122 [json_name="JsonTableColumn"]; + JsonKeyValue json_key_value = 123 [json_name="JsonKeyValue"]; + JsonParseExpr json_parse_expr = 124 [json_name="JsonParseExpr"]; + JsonScalarExpr json_scalar_expr = 125 [json_name="JsonScalarExpr"]; + JsonSerializeExpr json_serialize_expr = 126 [json_name="JsonSerializeExpr"]; + JsonObjectConstructor json_object_constructor = 127 [json_name="JsonObjectConstructor"]; + JsonArrayConstructor json_array_constructor = 128 [json_name="JsonArrayConstructor"]; + JsonArrayQueryConstructor json_array_query_constructor = 129 [json_name="JsonArrayQueryConstructor"]; + JsonAggConstructor json_agg_constructor = 130 [json_name="JsonAggConstructor"]; + JsonObjectAgg json_object_agg = 131 [json_name="JsonObjectAgg"]; + JsonArrayAgg json_array_agg = 132 [json_name="JsonArrayAgg"]; + RawStmt raw_stmt = 133 [json_name="RawStmt"]; + InsertStmt insert_stmt = 134 [json_name="InsertStmt"]; + DeleteStmt delete_stmt = 135 [json_name="DeleteStmt"]; + UpdateStmt update_stmt = 136 [json_name="UpdateStmt"]; + MergeStmt merge_stmt = 137 [json_name="MergeStmt"]; + SelectStmt select_stmt = 138 [json_name="SelectStmt"]; + SetOperationStmt set_operation_stmt = 139 [json_name="SetOperationStmt"]; + ReturnStmt return_stmt = 140 [json_name="ReturnStmt"]; + PLAssignStmt plassign_stmt = 141 [json_name="PLAssignStmt"]; + CreateSchemaStmt create_schema_stmt = 142 [json_name="CreateSchemaStmt"]; + AlterTableStmt alter_table_stmt = 143 [json_name="AlterTableStmt"]; + AlterTableCmd alter_table_cmd = 144 [json_name="AlterTableCmd"]; + ATAlterConstraint atalter_constraint = 145 [json_name="ATAlterConstraint"]; + ReplicaIdentityStmt replica_identity_stmt = 146 [json_name="ReplicaIdentityStmt"]; + AlterCollationStmt alter_collation_stmt = 147 [json_name="AlterCollationStmt"]; + AlterDomainStmt alter_domain_stmt = 148 [json_name="AlterDomainStmt"]; + GrantStmt grant_stmt = 149 [json_name="GrantStmt"]; + ObjectWithArgs object_with_args = 150 [json_name="ObjectWithArgs"]; + AccessPriv access_priv = 151 [json_name="AccessPriv"]; + GrantRoleStmt grant_role_stmt = 152 [json_name="GrantRoleStmt"]; + AlterDefaultPrivilegesStmt alter_default_privileges_stmt = 153 [json_name="AlterDefaultPrivilegesStmt"]; + CopyStmt copy_stmt = 154 [json_name="CopyStmt"]; + VariableSetStmt variable_set_stmt = 155 [json_name="VariableSetStmt"]; + VariableShowStmt variable_show_stmt = 156 [json_name="VariableShowStmt"]; + CreateStmt create_stmt = 157 [json_name="CreateStmt"]; + Constraint constraint = 158 [json_name="Constraint"]; + CreateTableSpaceStmt create_table_space_stmt = 159 [json_name="CreateTableSpaceStmt"]; + DropTableSpaceStmt drop_table_space_stmt = 160 [json_name="DropTableSpaceStmt"]; + AlterTableSpaceOptionsStmt alter_table_space_options_stmt = 161 [json_name="AlterTableSpaceOptionsStmt"]; + AlterTableMoveAllStmt alter_table_move_all_stmt = 162 [json_name="AlterTableMoveAllStmt"]; + CreateExtensionStmt create_extension_stmt = 163 [json_name="CreateExtensionStmt"]; + AlterExtensionStmt alter_extension_stmt = 164 [json_name="AlterExtensionStmt"]; + AlterExtensionContentsStmt alter_extension_contents_stmt = 165 [json_name="AlterExtensionContentsStmt"]; + CreateFdwStmt create_fdw_stmt = 166 [json_name="CreateFdwStmt"]; + AlterFdwStmt alter_fdw_stmt = 167 [json_name="AlterFdwStmt"]; + CreateForeignServerStmt create_foreign_server_stmt = 168 [json_name="CreateForeignServerStmt"]; + AlterForeignServerStmt alter_foreign_server_stmt = 169 [json_name="AlterForeignServerStmt"]; + CreateForeignTableStmt create_foreign_table_stmt = 170 [json_name="CreateForeignTableStmt"]; + CreateUserMappingStmt create_user_mapping_stmt = 171 [json_name="CreateUserMappingStmt"]; + AlterUserMappingStmt alter_user_mapping_stmt = 172 [json_name="AlterUserMappingStmt"]; + DropUserMappingStmt drop_user_mapping_stmt = 173 [json_name="DropUserMappingStmt"]; + ImportForeignSchemaStmt import_foreign_schema_stmt = 174 [json_name="ImportForeignSchemaStmt"]; + CreatePolicyStmt create_policy_stmt = 175 [json_name="CreatePolicyStmt"]; + AlterPolicyStmt alter_policy_stmt = 176 [json_name="AlterPolicyStmt"]; + CreateAmStmt create_am_stmt = 177 [json_name="CreateAmStmt"]; + CreateTrigStmt create_trig_stmt = 178 [json_name="CreateTrigStmt"]; + CreateEventTrigStmt create_event_trig_stmt = 179 [json_name="CreateEventTrigStmt"]; + AlterEventTrigStmt alter_event_trig_stmt = 180 [json_name="AlterEventTrigStmt"]; + CreatePLangStmt create_plang_stmt = 181 [json_name="CreatePLangStmt"]; + CreateRoleStmt create_role_stmt = 182 [json_name="CreateRoleStmt"]; + AlterRoleStmt alter_role_stmt = 183 [json_name="AlterRoleStmt"]; + AlterRoleSetStmt alter_role_set_stmt = 184 [json_name="AlterRoleSetStmt"]; + DropRoleStmt drop_role_stmt = 185 [json_name="DropRoleStmt"]; + CreateSeqStmt create_seq_stmt = 186 [json_name="CreateSeqStmt"]; + AlterSeqStmt alter_seq_stmt = 187 [json_name="AlterSeqStmt"]; + DefineStmt define_stmt = 188 [json_name="DefineStmt"]; + CreateDomainStmt create_domain_stmt = 189 [json_name="CreateDomainStmt"]; + CreateOpClassStmt create_op_class_stmt = 190 [json_name="CreateOpClassStmt"]; + CreateOpClassItem create_op_class_item = 191 [json_name="CreateOpClassItem"]; + CreateOpFamilyStmt create_op_family_stmt = 192 [json_name="CreateOpFamilyStmt"]; + AlterOpFamilyStmt alter_op_family_stmt = 193 [json_name="AlterOpFamilyStmt"]; + DropStmt drop_stmt = 194 [json_name="DropStmt"]; + TruncateStmt truncate_stmt = 195 [json_name="TruncateStmt"]; + CommentStmt comment_stmt = 196 [json_name="CommentStmt"]; + SecLabelStmt sec_label_stmt = 197 [json_name="SecLabelStmt"]; + DeclareCursorStmt declare_cursor_stmt = 198 [json_name="DeclareCursorStmt"]; + ClosePortalStmt close_portal_stmt = 199 [json_name="ClosePortalStmt"]; + FetchStmt fetch_stmt = 200 [json_name="FetchStmt"]; + IndexStmt index_stmt = 201 [json_name="IndexStmt"]; + CreateStatsStmt create_stats_stmt = 202 [json_name="CreateStatsStmt"]; + StatsElem stats_elem = 203 [json_name="StatsElem"]; + AlterStatsStmt alter_stats_stmt = 204 [json_name="AlterStatsStmt"]; + CreateFunctionStmt create_function_stmt = 205 [json_name="CreateFunctionStmt"]; + FunctionParameter function_parameter = 206 [json_name="FunctionParameter"]; + AlterFunctionStmt alter_function_stmt = 207 [json_name="AlterFunctionStmt"]; + DoStmt do_stmt = 208 [json_name="DoStmt"]; + InlineCodeBlock inline_code_block = 209 [json_name="InlineCodeBlock"]; + CallStmt call_stmt = 210 [json_name="CallStmt"]; + CallContext call_context = 211 [json_name="CallContext"]; + RenameStmt rename_stmt = 212 [json_name="RenameStmt"]; + AlterObjectDependsStmt alter_object_depends_stmt = 213 [json_name="AlterObjectDependsStmt"]; + AlterObjectSchemaStmt alter_object_schema_stmt = 214 [json_name="AlterObjectSchemaStmt"]; + AlterOwnerStmt alter_owner_stmt = 215 [json_name="AlterOwnerStmt"]; + AlterOperatorStmt alter_operator_stmt = 216 [json_name="AlterOperatorStmt"]; + AlterTypeStmt alter_type_stmt = 217 [json_name="AlterTypeStmt"]; + RuleStmt rule_stmt = 218 [json_name="RuleStmt"]; + NotifyStmt notify_stmt = 219 [json_name="NotifyStmt"]; + ListenStmt listen_stmt = 220 [json_name="ListenStmt"]; + UnlistenStmt unlisten_stmt = 221 [json_name="UnlistenStmt"]; + TransactionStmt transaction_stmt = 222 [json_name="TransactionStmt"]; + CompositeTypeStmt composite_type_stmt = 223 [json_name="CompositeTypeStmt"]; + CreateEnumStmt create_enum_stmt = 224 [json_name="CreateEnumStmt"]; + CreateRangeStmt create_range_stmt = 225 [json_name="CreateRangeStmt"]; + AlterEnumStmt alter_enum_stmt = 226 [json_name="AlterEnumStmt"]; + ViewStmt view_stmt = 227 [json_name="ViewStmt"]; + LoadStmt load_stmt = 228 [json_name="LoadStmt"]; + CreatedbStmt createdb_stmt = 229 [json_name="CreatedbStmt"]; + AlterDatabaseStmt alter_database_stmt = 230 [json_name="AlterDatabaseStmt"]; + AlterDatabaseRefreshCollStmt alter_database_refresh_coll_stmt = 231 [json_name="AlterDatabaseRefreshCollStmt"]; + AlterDatabaseSetStmt alter_database_set_stmt = 232 [json_name="AlterDatabaseSetStmt"]; + DropdbStmt dropdb_stmt = 233 [json_name="DropdbStmt"]; + AlterSystemStmt alter_system_stmt = 234 [json_name="AlterSystemStmt"]; + ClusterStmt cluster_stmt = 235 [json_name="ClusterStmt"]; + VacuumStmt vacuum_stmt = 236 [json_name="VacuumStmt"]; + VacuumRelation vacuum_relation = 237 [json_name="VacuumRelation"]; + ExplainStmt explain_stmt = 238 [json_name="ExplainStmt"]; + CreateTableAsStmt create_table_as_stmt = 239 [json_name="CreateTableAsStmt"]; + RefreshMatViewStmt refresh_mat_view_stmt = 240 [json_name="RefreshMatViewStmt"]; + CheckPointStmt check_point_stmt = 241 [json_name="CheckPointStmt"]; + DiscardStmt discard_stmt = 242 [json_name="DiscardStmt"]; + LockStmt lock_stmt = 243 [json_name="LockStmt"]; + ConstraintsSetStmt constraints_set_stmt = 244 [json_name="ConstraintsSetStmt"]; + ReindexStmt reindex_stmt = 245 [json_name="ReindexStmt"]; + CreateConversionStmt create_conversion_stmt = 246 [json_name="CreateConversionStmt"]; + CreateCastStmt create_cast_stmt = 247 [json_name="CreateCastStmt"]; + CreateTransformStmt create_transform_stmt = 248 [json_name="CreateTransformStmt"]; + PrepareStmt prepare_stmt = 249 [json_name="PrepareStmt"]; + ExecuteStmt execute_stmt = 250 [json_name="ExecuteStmt"]; + DeallocateStmt deallocate_stmt = 251 [json_name="DeallocateStmt"]; + DropOwnedStmt drop_owned_stmt = 252 [json_name="DropOwnedStmt"]; + ReassignOwnedStmt reassign_owned_stmt = 253 [json_name="ReassignOwnedStmt"]; + AlterTSDictionaryStmt alter_tsdictionary_stmt = 254 [json_name="AlterTSDictionaryStmt"]; + AlterTSConfigurationStmt alter_tsconfiguration_stmt = 255 [json_name="AlterTSConfigurationStmt"]; + PublicationTable publication_table = 256 [json_name="PublicationTable"]; + PublicationObjSpec publication_obj_spec = 257 [json_name="PublicationObjSpec"]; + CreatePublicationStmt create_publication_stmt = 258 [json_name="CreatePublicationStmt"]; + AlterPublicationStmt alter_publication_stmt = 259 [json_name="AlterPublicationStmt"]; + CreateSubscriptionStmt create_subscription_stmt = 260 [json_name="CreateSubscriptionStmt"]; + AlterSubscriptionStmt alter_subscription_stmt = 261 [json_name="AlterSubscriptionStmt"]; + DropSubscriptionStmt drop_subscription_stmt = 262 [json_name="DropSubscriptionStmt"]; + Integer integer = 263 [json_name="Integer"]; + Float float = 264 [json_name="Float"]; + Boolean boolean = 265 [json_name="Boolean"]; + String string = 266 [json_name="String"]; + BitString bit_string = 267 [json_name="BitString"]; + List list = 268 [json_name="List"]; + IntList int_list = 269 [json_name="IntList"]; + OidList oid_list = 270 [json_name="OidList"]; + A_Const a_const = 271 [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"]; + Query 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"]; + VarReturningType varreturningtype = 9 [json_name="varreturningtype"]; + 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"]; + 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 list_start = 7 [json_name="list_start"]; + int32 list_end = 8 [json_name="list_end"]; + int32 location = 9 [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"]; + CompareType cmptype = 2 [json_name="cmptype"]; + 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 ReturningExpr +{ + Node xpr = 1 [json_name="xpr"]; + int32 retlevelsup = 2 [json_name="retlevelsup"]; + bool retold = 3 [json_name="retold"]; + Node retexpr = 4 [json_name="retexpr"]; +} + +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 has_group_rte = 15 [json_name="hasGroupRTE"]; + bool is_return = 16 [json_name="isReturn"]; + repeated Node cte_list = 17 [json_name="cteList"]; + repeated Node rtable = 18 [json_name="rtable"]; + repeated Node rteperminfos = 19 [json_name="rteperminfos"]; + FromExpr jointree = 20 [json_name="jointree"]; + repeated Node merge_action_list = 21 [json_name="mergeActionList"]; + int32 merge_target_relation = 22 [json_name="mergeTargetRelation"]; + Node merge_join_condition = 23 [json_name="mergeJoinCondition"]; + repeated Node target_list = 24 [json_name="targetList"]; + OverridingKind override = 25 [json_name="override"]; + OnConflictExpr on_conflict = 26 [json_name="onConflict"]; + string returning_old_alias = 27 [json_name="returningOldAlias"]; + string returning_new_alias = 28 [json_name="returningNewAlias"]; + repeated Node returning_list = 29 [json_name="returningList"]; + repeated Node group_clause = 30 [json_name="groupClause"]; + bool group_distinct = 31 [json_name="groupDistinct"]; + repeated Node grouping_sets = 32 [json_name="groupingSets"]; + Node having_qual = 33 [json_name="havingQual"]; + repeated Node window_clause = 34 [json_name="windowClause"]; + repeated Node distinct_clause = 35 [json_name="distinctClause"]; + repeated Node sort_clause = 36 [json_name="sortClause"]; + Node limit_offset = 37 [json_name="limitOffset"]; + Node limit_count = 38 [json_name="limitCount"]; + LimitOption limit_option = 39 [json_name="limitOption"]; + repeated Node row_marks = 40 [json_name="rowMarks"]; + Node set_operations = 41 [json_name="setOperations"]; + repeated Node constraint_deps = 42 [json_name="constraintDeps"]; + repeated Node with_check_options = 43 [json_name="withCheckOptions"]; + int32 stmt_location = 44 [json_name="stmt_location"]; + int32 stmt_len = 45 [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 rexpr_list_start = 5 [json_name="rexpr_list_start"]; + int32 rexpr_list_end = 6 [json_name="rexpr_list_end"]; + int32 location = 7 [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 list_start = 2 [json_name="list_start"]; + int32 list_end = 3 [json_name="list_end"]; + int32 location = 4 [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 +{ + 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"]; + repeated Node groupexprs = 30 [json_name="groupexprs"]; + bool lateral = 31 [json_name="lateral"]; + bool in_from_cl = 32 [json_name="inFromCl"]; + repeated Node security_quals = 33 [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 reverse_sort = 4 [json_name="reverse_sort"]; + bool nulls_first = 5 [json_name="nulls_first"]; + bool hashable = 6 [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 ReturningOption +{ + ReturningOptionKind option = 1 [json_name="option"]; + string value = 2 [json_name="value"]; + int32 location = 3 [json_name="location"]; +} + +message ReturningClause +{ + repeated Node options = 1 [json_name="options"]; + repeated Node exprs = 2 [json_name="exprs"]; +} + +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"]; + ReturningClause returning_clause = 5 [json_name="returningClause"]; + 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"]; + ReturningClause returning_clause = 4 [json_name="returningClause"]; + 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"]; + ReturningClause returning_clause = 5 [json_name="returningClause"]; + 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"]; + ReturningClause returning_clause = 5 [json_name="returningClause"]; + 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 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 ATAlterConstraint +{ + string conname = 1 [json_name="conname"]; + bool alter_enforceability = 2 [json_name="alterEnforceability"]; + bool is_enforced = 3 [json_name="is_enforced"]; + bool alter_deferrability = 4 [json_name="alterDeferrability"]; + bool deferrable = 5 [json_name="deferrable"]; + bool initdeferred = 6 [json_name="initdeferred"]; + bool alter_inheritability = 7 [json_name="alterInheritability"]; + bool noinherit = 8 [json_name="noinherit"]; +} + +message ReplicaIdentityStmt +{ + string identity_type = 1 [json_name="identity_type"]; + string name = 2 [json_name="name"]; +} + +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 jumble_args = 4 [json_name="jumble_args"]; + bool is_local = 5 [json_name="is_local"]; + int32 location = 6 [json_name="location"]; +} + +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 nnconstraints = 8 [json_name="nnconstraints"]; + repeated Node options = 9 [json_name="options"]; + OnCommitAction oncommit = 10 [json_name="oncommit"]; + string tablespacename = 11 [json_name="tablespacename"]; + string access_method = 12 [json_name="accessMethod"]; + bool if_not_exists = 13 [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 is_enforced = 5 [json_name="is_enforced"]; + bool skip_validation = 6 [json_name="skip_validation"]; + bool initially_valid = 7 [json_name="initially_valid"]; + bool is_no_inherit = 8 [json_name="is_no_inherit"]; + Node raw_expr = 9 [json_name="raw_expr"]; + string cooked_expr = 10 [json_name="cooked_expr"]; + string generated_when = 11 [json_name="generated_when"]; + string generated_kind = 12 [json_name="generated_kind"]; + bool nulls_not_distinct = 13 [json_name="nulls_not_distinct"]; + repeated Node keys = 14 [json_name="keys"]; + bool without_overlaps = 15 [json_name="without_overlaps"]; + repeated Node including = 16 [json_name="including"]; + repeated Node exclusions = 17 [json_name="exclusions"]; + repeated Node options = 18 [json_name="options"]; + string indexname = 19 [json_name="indexname"]; + string indexspace = 20 [json_name="indexspace"]; + bool reset_default_tblspc = 21 [json_name="reset_default_tblspc"]; + string access_method = 22 [json_name="access_method"]; + Node where_clause = 23 [json_name="where_clause"]; + RangeVar pktable = 24 [json_name="pktable"]; + repeated Node fk_attrs = 25 [json_name="fk_attrs"]; + repeated Node pk_attrs = 26 [json_name="pk_attrs"]; + bool fk_with_period = 27 [json_name="fk_with_period"]; + bool pk_with_period = 28 [json_name="pk_with_period"]; + string fk_matchtype = 29 [json_name="fk_matchtype"]; + string fk_upd_action = 30 [json_name="fk_upd_action"]; + string fk_del_action = 31 [json_name="fk_del_action"]; + repeated Node fk_del_set_cols = 32 [json_name="fk_del_set_cols"]; + repeated Node old_conpfeqop = 33 [json_name="old_conpfeqop"]; + uint32 old_pktable_oid = 34 [json_name="old_pktable_oid"]; + int32 location = 35 [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 iswithoutoverlaps = 19 [json_name="iswithoutoverlaps"]; + bool deferrable = 20 [json_name="deferrable"]; + bool initdeferred = 21 [json_name="initdeferred"]; + bool transformed = 22 [json_name="transformed"]; + bool concurrent = 23 [json_name="concurrent"]; + bool if_not_exists = 24 [json_name="if_not_exists"]; + bool reset_default_tblspc = 25 [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"]; + int32 location = 5 [json_name="location"]; +} + +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; + RTE_GROUP = 10; +} + +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 ReturningOptionKind +{ + RETURNING_OPTION_KIND_UNDEFINED = 0; + RETURNING_OPTION_OLD = 1; + RETURNING_OPTION_NEW = 2; +} + +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_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; + CONSTR_ATTR_ENFORCED = 15; + CONSTR_ATTR_NOT_ENFORCED = 16; +} + +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 VarReturningType +{ + VAR_RETURNING_TYPE_UNDEFINED = 0; + VAR_RETURNING_DEFAULT = 1; + VAR_RETURNING_OLD = 2; + VAR_RETURNING_NEW = 3; +} + +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 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_SEMI = 7; + JOIN_RIGHT_ANTI = 8; + JOIN_UNIQUE_OUTER = 9; + JOIN_UNIQUE_INNER = 10; +} + +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; +} + +enum CompareType +{ + COMPARE_TYPE_UNDEFINED = 0; + COMPARE_INVALID = 1; + COMPARE_LT = 2; + COMPARE_LE = 3; + COMPARE_EQ = 4; + COMPARE_GE = 5; + COMPARE_GT = 6; + COMPARE_NE = 7; + COMPARE_OVERLAP = 8; + COMPARE_CONTAINED_BY = 9; +} + +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; + ENFORCED = 405; + ENUM_P = 406; + ERROR_P = 407; + ESCAPE = 408; + EVENT = 409; + EXCEPT = 410; + EXCLUDE = 411; + EXCLUDING = 412; + EXCLUSIVE = 413; + EXECUTE = 414; + EXISTS = 415; + EXPLAIN = 416; + EXPRESSION = 417; + EXTENSION = 418; + EXTERNAL = 419; + EXTRACT = 420; + FALSE_P = 421; + FAMILY = 422; + FETCH = 423; + FILTER = 424; + FINALIZE = 425; + FIRST_P = 426; + FLOAT_P = 427; + FOLLOWING = 428; + FOR = 429; + FORCE = 430; + FOREIGN = 431; + FORMAT = 432; + FORWARD = 433; + FREEZE = 434; + FROM = 435; + FULL = 436; + FUNCTION = 437; + FUNCTIONS = 438; + GENERATED = 439; + GLOBAL = 440; + GRANT = 441; + GRANTED = 442; + GREATEST = 443; + GROUP_P = 444; + GROUPING = 445; + GROUPS = 446; + HANDLER = 447; + HAVING = 448; + HEADER_P = 449; + HOLD = 450; + HOUR_P = 451; + IDENTITY_P = 452; + IF_P = 453; + ILIKE = 454; + IMMEDIATE = 455; + IMMUTABLE = 456; + IMPLICIT_P = 457; + IMPORT_P = 458; + IN_P = 459; + INCLUDE = 460; + INCLUDING = 461; + INCREMENT = 462; + INDENT = 463; + INDEX = 464; + INDEXES = 465; + INHERIT = 466; + INHERITS = 467; + INITIALLY = 468; + INLINE_P = 469; + INNER_P = 470; + INOUT = 471; + INPUT_P = 472; + INSENSITIVE = 473; + INSERT = 474; + INSTEAD = 475; + INT_P = 476; + INTEGER = 477; + INTERSECT = 478; + INTERVAL = 479; + INTO = 480; + INVOKER = 481; + IS = 482; + ISNULL = 483; + ISOLATION = 484; + JOIN = 485; + JSON = 486; + JSON_ARRAY = 487; + JSON_ARRAYAGG = 488; + JSON_EXISTS = 489; + JSON_OBJECT = 490; + JSON_OBJECTAGG = 491; + JSON_QUERY = 492; + JSON_SCALAR = 493; + JSON_SERIALIZE = 494; + JSON_TABLE = 495; + JSON_VALUE = 496; + KEEP = 497; + KEY = 498; + KEYS = 499; + LABEL = 500; + LANGUAGE = 501; + LARGE_P = 502; + LAST_P = 503; + LATERAL_P = 504; + LEADING = 505; + LEAKPROOF = 506; + LEAST = 507; + LEFT = 508; + LEVEL = 509; + LIKE = 510; + LIMIT = 511; + LISTEN = 512; + LOAD = 513; + LOCAL = 514; + LOCALTIME = 515; + LOCALTIMESTAMP = 516; + LOCATION = 517; + LOCK_P = 518; + LOCKED = 519; + LOGGED = 520; + MAPPING = 521; + MATCH = 522; + MATCHED = 523; + MATERIALIZED = 524; + MAXVALUE = 525; + MERGE = 526; + MERGE_ACTION = 527; + METHOD = 528; + MINUTE_P = 529; + MINVALUE = 530; + MODE = 531; + MONTH_P = 532; + MOVE = 533; + NAME_P = 534; + NAMES = 535; + NATIONAL = 536; + NATURAL = 537; + NCHAR = 538; + NESTED = 539; + NEW = 540; + NEXT = 541; + NFC = 542; + NFD = 543; + NFKC = 544; + NFKD = 545; + NO = 546; + NONE = 547; + NORMALIZE = 548; + NORMALIZED = 549; + NOT = 550; + NOTHING = 551; + NOTIFY = 552; + NOTNULL = 553; + NOWAIT = 554; + NULL_P = 555; + NULLIF = 556; + NULLS_P = 557; + NUMERIC = 558; + OBJECT_P = 559; + OBJECTS_P = 560; + OF = 561; + OFF = 562; + OFFSET = 563; + OIDS = 564; + OLD = 565; + OMIT = 566; + ON = 567; + ONLY = 568; + OPERATOR = 569; + OPTION = 570; + OPTIONS = 571; + OR = 572; + ORDER = 573; + ORDINALITY = 574; + OTHERS = 575; + OUT_P = 576; + OUTER_P = 577; + OVER = 578; + OVERLAPS = 579; + OVERLAY = 580; + OVERRIDING = 581; + OWNED = 582; + OWNER = 583; + PARALLEL = 584; + PARAMETER = 585; + PARSER = 586; + PARTIAL = 587; + PARTITION = 588; + PASSING = 589; + PASSWORD = 590; + PATH = 591; + PERIOD = 592; + PLACING = 593; + PLAN = 594; + PLANS = 595; + POLICY = 596; + POSITION = 597; + PRECEDING = 598; + PRECISION = 599; + PRESERVE = 600; + PREPARE = 601; + PREPARED = 602; + PRIMARY = 603; + PRIOR = 604; + PRIVILEGES = 605; + PROCEDURAL = 606; + PROCEDURE = 607; + PROCEDURES = 608; + PROGRAM = 609; + PUBLICATION = 610; + QUOTE = 611; + QUOTES = 612; + RANGE = 613; + READ = 614; + REAL = 615; + REASSIGN = 616; + RECURSIVE = 617; + REF_P = 618; + REFERENCES = 619; + REFERENCING = 620; + REFRESH = 621; + REINDEX = 622; + RELATIVE_P = 623; + RELEASE = 624; + RENAME = 625; + REPEATABLE = 626; + REPLACE = 627; + REPLICA = 628; + RESET = 629; + RESTART = 630; + RESTRICT = 631; + RETURN = 632; + RETURNING = 633; + RETURNS = 634; + REVOKE = 635; + RIGHT = 636; + ROLE = 637; + ROLLBACK = 638; + ROLLUP = 639; + ROUTINE = 640; + ROUTINES = 641; + ROW = 642; + ROWS = 643; + RULE = 644; + SAVEPOINT = 645; + SCALAR = 646; + SCHEMA = 647; + SCHEMAS = 648; + SCROLL = 649; + SEARCH = 650; + SECOND_P = 651; + SECURITY = 652; + SELECT = 653; + SEQUENCE = 654; + SEQUENCES = 655; + SERIALIZABLE = 656; + SERVER = 657; + SESSION = 658; + SESSION_USER = 659; + SET = 660; + SETS = 661; + SETOF = 662; + SHARE = 663; + SHOW = 664; + SIMILAR = 665; + SIMPLE = 666; + SKIP = 667; + SMALLINT = 668; + SNAPSHOT = 669; + SOME = 670; + SOURCE = 671; + SQL_P = 672; + STABLE = 673; + STANDALONE_P = 674; + START = 675; + STATEMENT = 676; + STATISTICS = 677; + STDIN = 678; + STDOUT = 679; + STORAGE = 680; + STORED = 681; + STRICT_P = 682; + STRING_P = 683; + STRIP_P = 684; + SUBSCRIPTION = 685; + SUBSTRING = 686; + SUPPORT = 687; + SYMMETRIC = 688; + SYSID = 689; + SYSTEM_P = 690; + SYSTEM_USER = 691; + TABLE = 692; + TABLES = 693; + TABLESAMPLE = 694; + TABLESPACE = 695; + TARGET = 696; + TEMP = 697; + TEMPLATE = 698; + TEMPORARY = 699; + TEXT_P = 700; + THEN = 701; + TIES = 702; + TIME = 703; + TIMESTAMP = 704; + TO = 705; + TRAILING = 706; + TRANSACTION = 707; + TRANSFORM = 708; + TREAT = 709; + TRIGGER = 710; + TRIM = 711; + TRUE_P = 712; + TRUNCATE = 713; + TRUSTED = 714; + TYPE_P = 715; + TYPES_P = 716; + UESCAPE = 717; + UNBOUNDED = 718; + UNCONDITIONAL = 719; + UNCOMMITTED = 720; + UNENCRYPTED = 721; + UNION = 722; + UNIQUE = 723; + UNKNOWN = 724; + UNLISTEN = 725; + UNLOGGED = 726; + UNTIL = 727; + UPDATE = 728; + USER = 729; + USING = 730; + VACUUM = 731; + VALID = 732; + VALIDATE = 733; + VALIDATOR = 734; + VALUE_P = 735; + VALUES = 736; + VARCHAR = 737; + VARIADIC = 738; + VARYING = 739; + VERBOSE = 740; + VERSION_P = 741; + VIEW = 742; + VIEWS = 743; + VIRTUAL = 744; + VOLATILE = 745; + WHEN = 746; + WHERE = 747; + WHITESPACE_P = 748; + WINDOW = 749; + WITH = 750; + WITHIN = 751; + WITHOUT = 752; + WORK = 753; + WRAPPER = 754; + WRITE = 755; + XML_P = 756; + XMLATTRIBUTES = 757; + XMLCONCAT = 758; + XMLELEMENT = 759; + XMLEXISTS = 760; + XMLFOREST = 761; + XMLNAMESPACES = 762; + XMLPARSE = 763; + XMLPI = 764; + XMLROOT = 765; + XMLSERIALIZE = 766; + XMLTABLE = 767; + YEAR_P = 768; + YES_P = 769; + ZONE = 770; + FORMAT_LA = 771; + NOT_LA = 772; + NULLS_LA = 773; + WITH_LA = 774; + WITHOUT_LA = 775; + MODE_TYPE_NAME = 776; + MODE_PLPGSQL_EXPR = 777; + MODE_PLPGSQL_ASSIGN1 = 778; + MODE_PLPGSQL_ASSIGN2 = 779; + MODE_PLPGSQL_ASSIGN3 = 780; + UMINUS = 781; +} + + +// protobuf-c doesn't support optional fields, so any optional strings +// are just an empty string if it should be the equivalent of None/nil. +// +// These fields have `// optional` at the end of the line. +// +// Upstream issue: https://github.com/protobuf-c/protobuf-c/issues/476 +message SummaryResult { + enum Context { + None = 0; + Select = 1; + DML = 2; + DDL = 3; + Call = 4; + } + + message Table { + string name = 1; + string schema_name = 2; + string table_name = 3; + Context context = 4; + } + repeated Table tables = 1; + + // The value here is the table name (i.e. schema.table or just table). + map aliases = 2; + + repeated string cte_names = 3; + + message Function { + string name = 1; + string function_name = 2; + string schema_name = 3; // optional + Context context = 4; + } + repeated Function functions = 4; + + message FilterColumn { + string schema_name = 1; // optional + string table_name = 2; // optional + string column = 3; + } + repeated FilterColumn filter_columns = 5; + repeated string statement_types = 6; + string truncated_query = 7; /* optional, empty if truncation limit is -1 */ +} diff --git a/scripts/fetch-protos.js b/scripts/fetch-protos.js index caf3fb1..646130a 100644 --- a/scripts/fetch-protos.js +++ b/scripts/fetch-protos.js @@ -9,7 +9,7 @@ function getVersionMappings() { const versionsDir = path.join(__dirname, '..', 'versions'); const mappings = []; - for (const version of ['13', '14', '15', '16', '17']) { + for (const version of ['13', '14', '15', '16', '17', '18']) { const packagePath = path.join(versionsDir, version, 'package.json'); if (fs.existsSync(packagePath)) { const pkg = JSON.parse(fs.readFileSync(packagePath, 'utf8')); diff --git a/scripts/update-versions-types.js b/scripts/update-versions-types.js index b85a3c4..805d1d4 100755 --- a/scripts/update-versions-types.js +++ b/scripts/update-versions-types.js @@ -19,7 +19,7 @@ try { // Extract versions for PostgreSQL 13-17 const typeVersions = {}; -for (let pgVersion = 13; pgVersion <= 17; pgVersion++) { +for (let pgVersion = 13; pgVersion <= 18; pgVersion++) { const tag = `pg${pgVersion}`; if (distTags[tag]) { typeVersions[pgVersion.toString()] = distTags[tag]; diff --git a/types/18/CHANGELOG.md b/types/18/CHANGELOG.md new file mode 100644 index 0000000..0a0545e --- /dev/null +++ b/types/18/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/constructive-io/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/constructive-io/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/constructive-io/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/constructive-io/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/constructive-io/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/18/README.md b/types/18/README.md new file mode 100644 index 0000000..b81d04f --- /dev/null +++ b/types/18/README.md @@ -0,0 +1,106 @@ +# @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/constructive-io/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://www.npmjs.com/package/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://www.npmjs.com/package/pgsql-deparser): A streamlined tool designed for converting PostgreSQL ASTs back into SQL queries, focusing solely on deparser functionality to complement `pgsql-parser`. +* [@pgsql/parser](https://www.npmjs.com/package/@pgsql/parser): Multi-version PostgreSQL parser with dynamic version selection at runtime, supporting PostgreSQL 15, 16, and 17 in a single package. +* [@pgsql/types](https://www.npmjs.com/package/@pgsql/types): Offers TypeScript type definitions for PostgreSQL AST nodes, facilitating type-safe construction, analysis, and manipulation of ASTs. +* [@pgsql/enums](https://www.npmjs.com/package/@pgsql/enums): Provides TypeScript enum definitions for PostgreSQL constants, enabling type-safe usage of PostgreSQL enums and constants in your applications. +* [@pgsql/utils](https://www.npmjs.com/package/@pgsql/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://www.npmjs.com/package/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/constructive-io/libpg-query-node): The real PostgreSQL parser exposed for Node.js, used primarily in `pgsql-parser` for parsing and deparsing SQL queries. + +## Credits + +**🛠 Built by the [Constructive](https://constructive.io) team — creators of modular Postgres tooling for secure, composable backends. If you like our work, contribute on [GitHub](https://github.com/constructive-io).** + + +## 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/18/jest.config.js b/types/18/jest.config.js new file mode 100644 index 0000000..0aa3aaa --- /dev/null +++ b/types/18/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/18/package.json b/types/18/package.json new file mode 100644 index 0000000..509a427 --- /dev/null +++ b/types/18/package.json @@ -0,0 +1,39 @@ +{ + "name": "@libpg-query/types18", + "version": "18.0.1", + "author": "Constructive ", + "description": "PostgreSQL AST types from the real Postgres parser", + "main": "index.js", + "module": "esm/index.js", + "types": "index.d.ts", + "homepage": "https://github.com/constructive-io/libpg-query-node", + "license": "MIT", + "publishConfig": { + "access": "public", + "directory": "dist" + }, + "repository": { + "type": "git", + "url": "https://github.com/constructive-io/libpg-query-node" + }, + "bugs": { + "url": "https://github.com/constructive-io/libpg-query-node/issues" + }, + "x-publish": { + "publishName": "@pgsql/types", + "distTag": "pg18" + }, + "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/18/scripts/pg-proto-parser.ts b/types/18/scripts/pg-proto-parser.ts new file mode 100644 index 0000000..929e054 --- /dev/null +++ b/types/18/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/18/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/18/src/enums.ts b/types/18/src/enums.ts new file mode 100644 index 0000000..0446df6 --- /dev/null +++ b/types/18/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/18/src/index.ts b/types/18/src/index.ts new file mode 100644 index 0000000..dc5ee06 --- /dev/null +++ b/types/18/src/index.ts @@ -0,0 +1,2 @@ +export * from './types'; +export * from './enums'; diff --git a/types/18/src/types.ts b/types/18/src/types.ts new file mode 100644 index 0000000..837af26 --- /dev/null +++ b/types/18/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/18/tsconfig.esm.json b/types/18/tsconfig.esm.json new file mode 100644 index 0000000..800d750 --- /dev/null +++ b/types/18/tsconfig.esm.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "dist/esm", + "module": "es2022", + "rootDir": "src/", + "declaration": false + } +} diff --git a/types/18/tsconfig.json b/types/18/tsconfig.json new file mode 100644 index 0000000..1a9d569 --- /dev/null +++ b/types/18/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/18/LICENSE b/versions/18/LICENSE new file mode 100644 index 0000000..48cff16 --- /dev/null +++ b/versions/18/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2021 Dan Lynch +Copyright (c) 2025 Constructive + +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/18/Makefile b/versions/18/Makefile new file mode 100644 index 0000000..b66d7d4 --- /dev/null +++ b/versions/18/Makefile @@ -0,0 +1,99 @@ +# DO NOT MODIFY MANUALLY — this is generated from the templates dir +# +# To make changes, edit the files in the templates/ directory and run: +# npm run copy:templates + +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 := 18.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_raw','_wasm_free_parse_result']" \ + -sEXPORTED_RUNTIME_METHODS="['lengthBytesUTF8','stringToUTF8','getValue','UTF8ToString','HEAPU8','HEAPU32']" \ + -sEXPORT_NAME="$(WASM_MODULE_NAME)" \ + -sENVIRONMENT="web,node,worker" \ + -sASSERTIONS=0 \ + -sSINGLE_FILE=0 \ + -sMODULARIZE=1 \ + -sEXPORT_ES6=0 \ + -sALLOW_MEMORY_GROWTH=1 \ + -sINITIAL_MEMORY=134217728 \ + -sMAXIMUM_MEMORY=1073741824 \ + -sSTACK_SIZE=33554432 \ + -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/18/README.md b/versions/18/README.md new file mode 100644 index 0000000..646c476 --- /dev/null +++ b/versions/18/README.md @@ -0,0 +1,263 @@ +# libpg-query + +

+ constructive.io +

+ +

+ + + +
+ + + + +

+ +# 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/constructive-io/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** – Millions of downloads and trusted by countless projects and top teams + +## 🚀 For Round-trip Codegen + +> 🎯 **Want to parse + deparse (full round trip)?** +> We highly recommend using [`pgsql-parser`](https://github.com/constructive-io/pgsql-parser) which leverages a pure TypeScript deparser that has been battle-tested against 23,000+ SQL statements and is built on top of libpg-query. + +## Installation + +```sh +npm install libpg-query +``` + +## Example + +```typescript +import { parse } from 'libpg-query'; + +const result = await parse('SELECT * FROM users WHERE active = true'); +// {"version":180004,"stmts":[{"stmt":{"SelectStmt":{"targetList":[{"ResTarget" ... "op":"SETOP_NONE"}}}]} +``` + +## Versions + +Our latest is built with the `18.0.0` tag from libpg_query + +| PG Major Version | libpg_query | npm dist-tag +|--------------------------|-------------|---------| +| 18 | 18.0.0 | [`pg18`](https://www.npmjs.com/package/libpg-query/v/pg18) +| 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) + +## 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 +``` + +⚠ **Note:** If you need additional functionality like `fingerprint`, `scan`, `deparse`, or `normalize`, check out the full package (`@libpg-query/parser`) in the [./full](https://github.com/constructive-io/libpg-query-node/tree/main/full) folder of the repo. + +### 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; +} + +``` + +**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 + ``` + +## 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 + +## Credits + +Built on the excellent work of several contributors: + +* **[Dan Lynch](https://github.com/pyramation)** — official maintainer since 2018 and architect of the current implementation +* **[Lukas Fittl](https://github.com/lfittl)** for [libpg_query](https://github.com/pganalyze/libpg_query) — the core PostgreSQL parser that powers this project +* **[Greg Richardson](https://github.com/gregnr)** for AST guidance and pushing the transition to WASM and multiple PG runtimes for better interoperability +* **[Ethan Resnick](https://github.com/ethanresnick)** for the original Node.js N-API bindings +* **[Zac McCormick](https://github.com/zhm)** for the foundational [node-pg-query-native](https://github.com/zhm/node-pg-query-native) parser + +**🛠 Built by the [Constructive](https://constructive.io) team — creators of modular Postgres tooling for secure, composable backends. If you like our work, contribute on [GitHub](https://github.com/constructive-io).** + + +## Related + +* [pgsql-parser](https://www.npmjs.com/package/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://www.npmjs.com/package/pgsql-deparser): A streamlined tool designed for converting PostgreSQL ASTs back into SQL queries, focusing solely on deparser functionality to complement `pgsql-parser`. +* [@pgsql/parser](https://www.npmjs.com/package/@pgsql/parser): Multi-version PostgreSQL parser with dynamic version selection at runtime, supporting PostgreSQL 15, 16, 17, and 18 in a single package. +* [@pgsql/types](https://www.npmjs.com/package/@pgsql/types): Offers TypeScript type definitions for PostgreSQL AST nodes, facilitating type-safe construction, analysis, and manipulation of ASTs. +* [@pgsql/enums](https://www.npmjs.com/package/@pgsql/enums): Provides TypeScript enum definitions for PostgreSQL constants, enabling type-safe usage of PostgreSQL enums and constants in your applications. +* [@pgsql/utils](https://www.npmjs.com/package/@pgsql/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://www.npmjs.com/package/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/constructive-io/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/18/README_ERROR_HANDLING.md b/versions/18/README_ERROR_HANDLING.md new file mode 100644 index 0000000..c9f23c6 --- /dev/null +++ b/versions/18/README_ERROR_HANDLING.md @@ -0,0 +1,174 @@ +# Enhanced Error Handling in libpg-query-node v18 + +## Overview + +Version 18 includes enhanced error handling that provides detailed information about SQL parsing errors, including exact error positions, source file information, and visual error indicators. + +## Error Details + +When a parsing error occurs, the error object now includes a `sqlDetails` property with the following information: + +```typescript +interface SqlErrorDetails { + message: string; // Full error message + cursorPosition: number; // 0-based position in the query + fileName?: string; // Source file (e.g., 'scan.l', 'gram.y') + functionName?: string; // Internal function name + lineNumber?: number; // Line number in source file + context?: string; // Additional context +} +``` + +## Basic Usage + +```javascript +const { parseSync, loadModule } = require('@libpg-query/v18'); + +await loadModule(); + +try { + const result = parseSync("SELECT * FROM users WHERE id = 'unclosed"); +} catch (error) { + if (error.sqlDetails) { + console.log('Error:', error.message); + console.log('Position:', error.sqlDetails.cursorPosition); + console.log('Source:', error.sqlDetails.fileName); + } +} +``` + +## Error Formatting Helper + +The library includes a built-in `formatSqlError()` function for consistent error formatting: + +```javascript +const { parseSync, loadModule, formatSqlError } = require('@libpg-query/v18'); + +await loadModule(); + +const query = "SELECT * FROM users WHERE id = 'unclosed"; + +try { + parseSync(query); +} catch (error) { + console.log(formatSqlError(error, query)); +} +``` + +Output: +``` +Error: unterminated quoted string at or near "'unclosed" +Position: 31 +Source: file: scan.l, function: scanner_yyerror, line: 1262 +SELECT * FROM users WHERE id = 'unclosed + ^ +``` + +## Formatting Options + +The `formatSqlError()` function accepts options to customize the output: + +```typescript +interface SqlErrorFormatOptions { + showPosition?: boolean; // Show the error position marker (default: true) + showQuery?: boolean; // Show the query text (default: true) + color?: boolean; // Use ANSI colors (default: false) + maxQueryLength?: number; // Max query length to display (default: no limit) +} +``` + +### Examples + +#### With Colors (for terminal output) +```javascript +console.log(formatSqlError(error, query, { color: true })); +``` + +#### Without Position Marker +```javascript +console.log(formatSqlError(error, query, { showPosition: false })); +``` + +#### With Query Truncation (for long queries) +```javascript +console.log(formatSqlError(error, longQuery, { maxQueryLength: 80 })); +``` + +## Type Guard + +Use the `hasSqlDetails()` function to check if an error has SQL details: + +```javascript +const { hasSqlDetails } = require('@libpg-query/v18'); + +try { + parseSync(query); +} catch (error) { + if (hasSqlDetails(error)) { + // TypeScript knows error has sqlDetails property + console.log('Error at position:', error.sqlDetails.cursorPosition); + } +} +``` + +## Error Types + +Errors are classified by their source file: +- **Lexer errors** (`scan.l`): Token recognition errors (invalid characters, unterminated strings) +- **Parser errors** (`gram.y`): Grammar violations (syntax errors, missing keywords) + +## Examples of Common Errors + +### Unterminated String +```sql +SELECT * FROM users WHERE name = 'unclosed +``` +Error: `unterminated quoted string at or near "'unclosed"` + +### Invalid Character +```sql +SELECT * FROM users WHERE id = @ +``` +Error: `syntax error at end of input` + +### Reserved Keyword +```sql +SELECT * FROM table +``` +Error: `syntax error at or near "table"` (use quotes: `"table"`) + +### Missing Keyword +```sql +SELECT * WHERE id = 1 +``` +Error: `syntax error at or near "WHERE"` + +## Backward Compatibility + +The enhanced error handling is fully backward compatible: +- Existing code that catches errors will continue to work +- The `sqlDetails` property is added without modifying the base Error object +- All existing error properties and methods remain unchanged + +## Migration Guide + +To take advantage of the new error handling: + +1. **Check for sqlDetails**: + ```javascript + if (error.sqlDetails) { + // Use enhanced error information + } + ``` + +2. **Use the formatting helper**: + ```javascript + console.log(formatSqlError(error, query)); + ``` + +3. **Type-safe access** (TypeScript): + ```typescript + if (hasSqlDetails(error)) { + // error.sqlDetails is now typed + } + ``` \ No newline at end of file diff --git a/versions/18/package.json b/versions/18/package.json new file mode 100644 index 0000000..bb1cd31 --- /dev/null +++ b/versions/18/package.json @@ -0,0 +1,52 @@ +{ + "name": "@libpg-query/v18", + "version": "18.0.1", + "description": "The real PostgreSQL query parser", + "homepage": "https://github.com/constructive-io/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": "18", + "distTag": "pg18", + "libpgQueryTag": "18.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-single-version.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 test/errors.test.js" + }, + "author": "Constructive ", + "license": "MIT", + "repository": { + "type": "git", + "url": "git://github.com/constructive-io/libpg-query-node.git" + }, + "devDependencies": {}, + "dependencies": { + "@pgsql/types": "^17.6.2" + }, + "keywords": [ + "sql", + "postgres", + "postgresql", + "pg", + "query", + "plpgsql", + "database" + ] +} diff --git a/versions/18/scripts/build.js b/versions/18/scripts/build.js new file mode 100644 index 0000000..48c95b8 --- /dev/null +++ b/versions/18/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/18/src/index.ts b/versions/18/src/index.ts new file mode 100644 index 0000000..27eeb49 --- /dev/null +++ b/versions/18/src/index.ts @@ -0,0 +1,315 @@ +/** + * DO NOT MODIFY MANUALLY — this is generated from the templates dir + * + * To make changes, edit the files in the templates/ directory and run: + * npm run copy:templates + */ + +export * from "@pgsql/types"; + +// @ts-ignore +import PgQueryModule from './libpg-query.js'; + +let wasmModule: any; + +// SQL error details interface +export interface SqlErrorDetails { + message: string; + cursorPosition: number; // 0-based position in the query + fileName?: string; // Source file where error occurred (e.g., 'scan.l', 'gram.y') + functionName?: string; // Internal function name + lineNumber?: number; // Line number in source file + context?: string; // Additional context +} + +// Options for formatting SQL errors +export interface SqlErrorFormatOptions { + showPosition?: boolean; // Show the error position marker (default: true) + showQuery?: boolean; // Show the query text (default: true) + color?: boolean; // Use ANSI colors (default: false) + maxQueryLength?: number; // Max query length to display (default: no limit) +} + +export class SqlError extends Error { + sqlDetails?: SqlErrorDetails; + + constructor(message: string, details?: SqlErrorDetails) { + super(message); + this.name = 'SqlError'; + this.sqlDetails = details; + } +} + + + +// Helper function to classify error source +function getErrorSource(filename: string | null): string { + if (!filename) return 'unknown'; + if (filename === 'scan.l') return 'lexer'; // Lexical analysis errors + if (filename === 'gram.y') return 'parser'; // Grammar/parsing errors + return filename; +} + +// Format SQL error with visual position indicator +export function formatSqlError( + error: Error & { sqlDetails?: SqlErrorDetails }, + query: string, + options: SqlErrorFormatOptions = {} +): string { + const { + showPosition = true, + showQuery = true, + color = false, + maxQueryLength + } = options; + + const lines: string[] = []; + + // ANSI color codes + const red = color ? '\x1b[31m' : ''; + const yellow = color ? '\x1b[33m' : ''; + const reset = color ? '\x1b[0m' : ''; + + // Add error message + lines.push(`${red}Error: ${error.message}${reset}`); + + // Add SQL details if available + if (error.sqlDetails) { + const { cursorPosition, fileName, functionName, lineNumber } = error.sqlDetails; + + if (cursorPosition !== undefined && cursorPosition >= 0) { + lines.push(`Position: ${cursorPosition}`); + } + + if (fileName || functionName || lineNumber) { + const details = []; + if (fileName) details.push(`file: ${fileName}`); + if (functionName) details.push(`function: ${functionName}`); + if (lineNumber) details.push(`line: ${lineNumber}`); + lines.push(`Source: ${details.join(', ')}`); + } + + // Show query with position marker + if (showQuery && showPosition && cursorPosition !== undefined && cursorPosition >= 0) { + let displayQuery = query; + + // Truncate if needed + if (maxQueryLength && query.length > maxQueryLength) { + const start = Math.max(0, cursorPosition - Math.floor(maxQueryLength / 2)); + const end = Math.min(query.length, start + maxQueryLength); + displayQuery = (start > 0 ? '...' : '') + + query.substring(start, end) + + (end < query.length ? '...' : ''); + // Adjust cursor position for truncation + const adjustedPosition = cursorPosition - start + (start > 0 ? 3 : 0); + lines.push(displayQuery); + lines.push(' '.repeat(adjustedPosition) + `${yellow}^${reset}`); + } else { + lines.push(displayQuery); + lines.push(' '.repeat(cursorPosition) + `${yellow}^${reset}`); + } + } + } else if (showQuery) { + // No SQL details, just show the query if requested + let displayQuery = query; + if (maxQueryLength && query.length > maxQueryLength) { + displayQuery = query.substring(0, maxQueryLength) + '...'; + } + lines.push(`Query: ${displayQuery}`); + } + + return lines.join('\n'); +} + +// Check if an error has SQL details +export function hasSqlDetails(error: any): error is Error & { sqlDetails: SqlErrorDetails } { + return error instanceof Error && + 'sqlDetails' in error && + typeof (error as any).sqlDetails === 'object' && + (error as any).sqlDetails !== null && + 'message' in (error as any).sqlDetails && + 'cursorPosition' in (error as any).sqlDetails; +} + +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) => { + // Pre-validation + if (query === null || query === undefined) { + throw new Error('Query cannot be null or undefined'); + } + if (typeof query !== 'string') { + throw new Error(`Query must be a string, got ${typeof query}`); + } + if (query.trim() === '') { + throw new Error('Query cannot be empty'); + } + + const queryPtr = stringToPtr(query); + let resultPtr = 0; + + try { + // Call the raw function that returns a struct pointer + resultPtr = wasmModule._wasm_parse_query_raw(queryPtr); + if (!resultPtr) { + throw new Error('Failed to allocate memory for parse result'); + } + + // Read the PgQueryParseResult struct fields + // struct { char* parse_tree; char* stderr_buffer; PgQueryError* error; } + const parseTreePtr = wasmModule.getValue(resultPtr, 'i32'); // offset 0 + const stderrBufferPtr = wasmModule.getValue(resultPtr + 4, 'i32'); // offset 4 + const errorPtr = wasmModule.getValue(resultPtr + 8, 'i32'); // offset 8 + + // Check for error + if (errorPtr) { + // Read PgQueryError struct fields + // struct { char* message; char* funcname; char* filename; int lineno; int cursorpos; char* context; } + const messagePtr = wasmModule.getValue(errorPtr, 'i32'); // offset 0 + const funcnamePtr = wasmModule.getValue(errorPtr + 4, 'i32'); // offset 4 + const filenamePtr = wasmModule.getValue(errorPtr + 8, 'i32'); // offset 8 + const lineno = wasmModule.getValue(errorPtr + 12, 'i32'); // offset 12 + const cursorpos = wasmModule.getValue(errorPtr + 16, 'i32'); // offset 16 + const contextPtr = wasmModule.getValue(errorPtr + 20, 'i32'); // offset 20 + + const message = messagePtr ? wasmModule.UTF8ToString(messagePtr) : 'Unknown error'; + const filename = filenamePtr ? wasmModule.UTF8ToString(filenamePtr) : null; + + const errorDetails: SqlErrorDetails = { + message: message, + cursorPosition: cursorpos > 0 ? cursorpos - 1 : 0, // Convert to 0-based + fileName: filename || undefined, + functionName: funcnamePtr ? wasmModule.UTF8ToString(funcnamePtr) : undefined, + lineNumber: lineno > 0 ? lineno : undefined, + context: contextPtr ? wasmModule.UTF8ToString(contextPtr) : undefined + }; + + throw new SqlError(message, errorDetails); + } + + if (!parseTreePtr) { + throw new Error('Parse result is null'); + } + + const parseTree = wasmModule.UTF8ToString(parseTreePtr); + return JSON.parse(parseTree); + } + finally { + wasmModule._free(queryPtr); + if (resultPtr) { + wasmModule._wasm_free_parse_result(resultPtr); + } + } +}); + +export function parseSync(query: string) { + // Pre-validation + if (query === null || query === undefined) { + throw new Error('Query cannot be null or undefined'); + } + if (typeof query !== 'string') { + throw new Error(`Query must be a string, got ${typeof query}`); + } + if (query.trim() === '') { + throw new Error('Query cannot be empty'); + } + + const queryPtr = stringToPtr(query); + let resultPtr = 0; + + try { + // Call the raw function that returns a struct pointer + resultPtr = wasmModule._wasm_parse_query_raw(queryPtr); + if (!resultPtr) { + throw new Error('Failed to allocate memory for parse result'); + } + + // Read the PgQueryParseResult struct fields + // struct { char* parse_tree; char* stderr_buffer; PgQueryError* error; } + const parseTreePtr = wasmModule.getValue(resultPtr, 'i32'); // offset 0 + const stderrBufferPtr = wasmModule.getValue(resultPtr + 4, 'i32'); // offset 4 + const errorPtr = wasmModule.getValue(resultPtr + 8, 'i32'); // offset 8 + + // Check for error + if (errorPtr) { + // Read PgQueryError struct fields + // struct { char* message; char* funcname; char* filename; int lineno; int cursorpos; char* context; } + const messagePtr = wasmModule.getValue(errorPtr, 'i32'); // offset 0 + const funcnamePtr = wasmModule.getValue(errorPtr + 4, 'i32'); // offset 4 + const filenamePtr = wasmModule.getValue(errorPtr + 8, 'i32'); // offset 8 + const lineno = wasmModule.getValue(errorPtr + 12, 'i32'); // offset 12 + const cursorpos = wasmModule.getValue(errorPtr + 16, 'i32'); // offset 16 + const contextPtr = wasmModule.getValue(errorPtr + 20, 'i32'); // offset 20 + + const message = messagePtr ? wasmModule.UTF8ToString(messagePtr) : 'Unknown error'; + const filename = filenamePtr ? wasmModule.UTF8ToString(filenamePtr) : null; + + const errorDetails: SqlErrorDetails = { + message: message, + cursorPosition: cursorpos > 0 ? cursorpos - 1 : 0, // Convert to 0-based + fileName: filename || undefined, + functionName: funcnamePtr ? wasmModule.UTF8ToString(funcnamePtr) : undefined, + lineNumber: lineno > 0 ? lineno : undefined, + context: contextPtr ? wasmModule.UTF8ToString(contextPtr) : undefined + }; + + throw new SqlError(message, errorDetails); + } + + if (!parseTreePtr) { + throw new Error('Parse result is null'); + } + + const parseTree = wasmModule.UTF8ToString(parseTreePtr); + return JSON.parse(parseTree); + } + finally { + wasmModule._free(queryPtr); + if (resultPtr) { + wasmModule._wasm_free_parse_result(resultPtr); + } + } +} \ No newline at end of file diff --git a/versions/18/src/libpg-query.d.ts b/versions/18/src/libpg-query.d.ts new file mode 100644 index 0000000..2098ee1 --- /dev/null +++ b/versions/18/src/libpg-query.d.ts @@ -0,0 +1,22 @@ +/** + * DO NOT MODIFY MANUALLY — this is generated from the templates dir + * + * To make changes, edit the files in the templates/ directory and run: + * npm run copy:templates + */ + +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/18/src/wasm_wrapper.c b/versions/18/src/wasm_wrapper.c new file mode 100644 index 0000000..3815168 --- /dev/null +++ b/versions/18/src/wasm_wrapper.c @@ -0,0 +1,47 @@ +/** + * DO NOT MODIFY MANUALLY — this is generated from the templates dir + * + * To make changes, edit the files in the templates/ directory and run: + * npm run copy:templates + */ + +#include +#include +#include +#include + +static int validate_input(const char* input) { + return input != NULL && strlen(input) > 0; +} + +static void* safe_malloc(size_t size) { + void* ptr = malloc(size); + if (!ptr && size > 0) { + return NULL; + } + return ptr; +} + +// Raw struct access functions for parse +EMSCRIPTEN_KEEPALIVE +PgQueryParseResult* wasm_parse_query_raw(const char* input) { + if (!validate_input(input)) { + return NULL; + } + + PgQueryParseResult* result = (PgQueryParseResult*)safe_malloc(sizeof(PgQueryParseResult)); + if (!result) { + return NULL; + } + + *result = pg_query_parse(input); + return result; +} + +EMSCRIPTEN_KEEPALIVE +void wasm_free_parse_result(PgQueryParseResult* result) { + if (result) { + pg_query_free_parse_result(*result); + free(result); + } +} \ No newline at end of file diff --git a/versions/18/test/errors.test.js b/versions/18/test/errors.test.js new file mode 100644 index 0000000..f6c0fd6 --- /dev/null +++ b/versions/18/test/errors.test.js @@ -0,0 +1,325 @@ +const { describe, it, before } = require('node:test'); +const assert = require('node:assert/strict'); +const { parseSync, loadModule, formatSqlError, hasSqlDetails } = require('../wasm/index.cjs'); + +describe('Enhanced Error Handling', () => { + before(async () => { + await loadModule(); + }); + + describe('Error Details Structure', () => { + it('should include sqlDetails property on parse errors', () => { + assert.throws(() => { + parseSync('SELECT * FROM users WHERE id = @'); + }); + + try { + parseSync('SELECT * FROM users WHERE id = @'); + } catch (error) { + assert.ok('sqlDetails' in error); + assert.ok('message' in error.sqlDetails); + assert.ok('cursorPosition' in error.sqlDetails); + assert.ok('fileName' in error.sqlDetails); + assert.ok('functionName' in error.sqlDetails); + assert.ok('lineNumber' in error.sqlDetails); + } + }); + + it('should have correct cursor position (0-based)', () => { + try { + parseSync('SELECT * FROM users WHERE id = @'); + assert.fail('Expected error'); + } catch (error) { + assert.equal(error.sqlDetails.cursorPosition, 32); + } + }); + + it('should identify error source file', () => { + try { + parseSync('SELECT * FROM users WHERE id = @'); + assert.fail('Expected error'); + } catch (error) { + assert.equal(error.sqlDetails.fileName, 'scan.l'); + assert.equal(error.sqlDetails.functionName, 'scanner_yyerror'); + } + }); + }); + + describe('Error Position Accuracy', () => { + const positionTests = [ + { query: '@ SELECT * FROM users', expectedPos: 0, desc: 'error at start' }, + { query: 'SELECT @ FROM users', expectedPos: 9, desc: 'error after SELECT' }, + { query: 'SELECT * FROM users WHERE @ = 1', expectedPos: 28, desc: 'error after WHERE' }, + { query: 'SELECT * FROM users WHERE id = @', expectedPos: 32, desc: 'error at end' }, + { query: 'INSERT INTO users (id, name) VALUES (1, @)', expectedPos: 41, desc: 'error in VALUES' }, + { query: 'UPDATE users SET name = @ WHERE id = 1', expectedPos: 26, desc: 'error in SET' }, + { query: 'CREATE TABLE test (id INT, name @)', expectedPos: 32, desc: 'error in CREATE TABLE' }, + ]; + + positionTests.forEach(({ query, expectedPos, desc }) => { + it(`should correctly identify position for ${desc}`, () => { + try { + parseSync(query); + assert.fail('Expected error'); + } catch (error) { + assert.equal(error.sqlDetails.cursorPosition, expectedPos); + } + }); + }); + }); + + describe('Error Types', () => { + it('should handle unterminated string literals', () => { + try { + parseSync("SELECT * FROM users WHERE name = 'unclosed"); + assert.fail('Expected error'); + } catch (error) { + assert.ok(error.message.includes('unterminated quoted string')); + assert.equal(error.sqlDetails.cursorPosition, 33); + } + }); + + it('should handle unterminated quoted identifiers', () => { + try { + parseSync('SELECT * FROM users WHERE name = "unclosed'); + assert.fail('Expected error'); + } catch (error) { + assert.ok(error.message.includes('unterminated quoted identifier')); + assert.equal(error.sqlDetails.cursorPosition, 33); + } + }); + + it('should handle invalid tokens', () => { + try { + parseSync('SELECT * FROM users WHERE id = $'); + assert.fail('Expected error'); + } catch (error) { + assert.ok(error.message.includes('syntax error at or near "$"')); + assert.equal(error.sqlDetails.cursorPosition, 31); + } + }); + + it('should handle reserved keywords', () => { + try { + parseSync('SELECT * FROM table'); + assert.fail('Expected error'); + } catch (error) { + assert.ok(error.message.includes('syntax error at or near "table"')); + assert.equal(error.sqlDetails.cursorPosition, 14); + } + }); + + it('should handle syntax error in WHERE clause', () => { + try { + parseSync('SELECT * FROM users WHERE'); + assert.fail('Expected error'); + } catch (error) { + assert.ok(error.message.includes('syntax error at end of input')); + assert.equal(error.sqlDetails.cursorPosition, 25); + } + }); + }); + + describe('formatSqlError Helper', () => { + it('should format error with position indicator', () => { + try { + parseSync("SELECT * FROM users WHERE id = 'unclosed"); + assert.fail('Expected error'); + } catch (error) { + const formatted = formatSqlError(error, "SELECT * FROM users WHERE id = 'unclosed"); + assert.ok(formatted.includes('Error: unterminated quoted string')); + assert.ok(formatted.includes('Position: 31')); + assert.ok(formatted.includes("SELECT * FROM users WHERE id = 'unclosed")); + assert.ok(formatted.includes(' ^')); + } + }); + + it('should respect showPosition option', () => { + try { + parseSync('SELECT * FROM users WHERE id = @'); + assert.fail('Expected error'); + } catch (error) { + const formatted = formatSqlError(error, 'SELECT * FROM users WHERE id = @', { + showPosition: false + }); + assert.ok(!formatted.includes('^')); + assert.ok(formatted.includes('Position: 32')); + } + }); + + it('should respect showQuery option', () => { + try { + parseSync('SELECT * FROM users WHERE id = @'); + assert.fail('Expected error'); + } catch (error) { + const formatted = formatSqlError(error, 'SELECT * FROM users WHERE id = @', { + showQuery: false + }); + assert.ok(!formatted.includes('SELECT * FROM users')); + assert.ok(formatted.includes('Error:')); + assert.ok(formatted.includes('Position:')); + } + }); + + it('should truncate long queries', () => { + const longQuery = 'SELECT ' + 'a, '.repeat(50) + 'z FROM users WHERE id = @'; + try { + parseSync(longQuery); + assert.fail('Expected error'); + } catch (error) { + const formatted = formatSqlError(error, longQuery, { maxQueryLength: 50 }); + assert.ok(formatted.includes('...')); + const lines = formatted.split('\n'); + const queryLine = lines.find(line => line.includes('...')); + assert.ok(queryLine.length <= 56); // 50 + 2*3 for ellipsis + } + }); + + it('should handle color option without breaking output', () => { + try { + parseSync('SELECT * FROM users WHERE id = @'); + assert.fail('Expected error'); + } catch (error) { + const formatted = formatSqlError(error, 'SELECT * FROM users WHERE id = @', { + color: true + }); + assert.ok(formatted.includes('Error:')); + assert.ok(formatted.includes('Position:')); + // Should contain ANSI codes but still be readable + const cleanFormatted = formatted.replace(/\x1b\[[0-9;]*m/g, ''); + assert.ok(cleanFormatted.includes('syntax error')); + } + }); + }); + + describe('hasSqlDetails Type Guard', () => { + it('should return true for SQL parse errors', () => { + try { + parseSync('SELECT * FROM users WHERE id = @'); + assert.fail('Expected error'); + } catch (error) { + assert.equal(hasSqlDetails(error), true); + } + }); + + it('should return false for regular errors', () => { + const regularError = new Error('Regular error'); + assert.equal(hasSqlDetails(regularError), false); + }); + + it('should return false for non-Error objects', () => { + assert.equal(hasSqlDetails('string'), false); + assert.equal(hasSqlDetails(123), false); + assert.equal(hasSqlDetails(null), false); + assert.equal(hasSqlDetails(undefined), false); + assert.equal(hasSqlDetails({}), false); + }); + + it('should return false for Error with incomplete sqlDetails', () => { + const error = new Error('Test'); + error.sqlDetails = { message: 'test' }; // Missing cursorPosition + assert.equal(hasSqlDetails(error), false); + }); + }); + + describe('Edge Cases', () => { + it('should handle empty query', () => { + assert.throws(() => parseSync(''), { + message: 'Query cannot be empty' + }); + }); + + it('should handle null query', () => { + assert.throws(() => parseSync(null), { + message: 'Query cannot be null or undefined' + }); + }); + + it('should handle undefined query', () => { + assert.throws(() => parseSync(undefined), { + message: 'Query cannot be null or undefined' + }); + }); + + it('should handle @ in comments', () => { + const query = 'SELECT * FROM users /* @ in comment */ WHERE id = 1'; + assert.doesNotThrow(() => parseSync(query)); + }); + + it('should handle @ in strings', () => { + const query = 'SELECT * FROM users WHERE email = \'user@example.com\''; + assert.doesNotThrow(() => parseSync(query)); + }); + }); + + describe('Complex Error Scenarios', () => { + it('should handle errors in CASE statements', () => { + try { + parseSync('SELECT CASE WHEN id = 1 THEN "one" WHEN id = 2 THEN @ ELSE "other" END FROM users'); + assert.fail('Expected error'); + } catch (error) { + assert.equal(error.sqlDetails.cursorPosition, 54); + } + }); + + it('should handle errors in subqueries', () => { + try { + parseSync('SELECT * FROM users WHERE id IN (SELECT @ FROM orders)'); + assert.fail('Expected error'); + } catch (error) { + assert.equal(error.sqlDetails.cursorPosition, 42); + } + }); + + it('should handle errors in function calls', () => { + try { + parseSync('SELECT COUNT(@) FROM users'); + assert.fail('Expected error'); + } catch (error) { + assert.equal(error.sqlDetails.cursorPosition, 14); + } + }); + + it('should handle errors in second statement', () => { + try { + parseSync('SELECT * FROM users; SELECT * FROM orders WHERE id = @'); + assert.fail('Expected error'); + } catch (error) { + assert.equal(error.sqlDetails.cursorPosition, 54); + } + }); + + it('should handle errors in CTE', () => { + try { + parseSync('WITH cte AS (SELECT * FROM users WHERE id = @) SELECT * FROM cte'); + assert.fail('Expected error'); + } catch (error) { + assert.equal(error.sqlDetails.cursorPosition, 45); + } + }); + }); + + describe('Backward Compatibility', () => { + it('should maintain Error instance', () => { + try { + parseSync('SELECT * FROM users WHERE id = @'); + assert.fail('Expected error'); + } catch (error) { + assert.ok(error instanceof Error); + assert.ok(error.message); + assert.ok(error.stack); + } + }); + + it('should work with standard error handling', () => { + let caught = false; + try { + parseSync('SELECT * FROM users WHERE id = @'); + } catch (e) { + caught = true; + assert.ok(e.message.includes('syntax error')); + } + assert.equal(caught, true); + }); + }); +}); \ No newline at end of file diff --git a/versions/18/test/parsing.test.js b/versions/18/test/parsing.test.js new file mode 100644 index 0000000..9315d7d --- /dev/null +++ b/versions/18/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/18/tsconfig.esm.json b/versions/18/tsconfig.esm.json new file mode 100644 index 0000000..779892a --- /dev/null +++ b/versions/18/tsconfig.esm.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "es2022", + "rootDir": "src/", + "declaration": false, + "outDir": "esm/" + } + } diff --git a/versions/18/tsconfig.json b/versions/18/tsconfig.json new file mode 100644 index 0000000..5383f9b --- /dev/null +++ b/versions/18/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"] +} From 083c4c63a6969243611c97076319ca08fe4d093b Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 22 May 2026 00:11:43 +0000 Subject: [PATCH 2/8] fix: update parser tests for PG 18 version arrays --- parser/test/errors.test.js | 2 +- parser/test/parsing.test.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/parser/test/errors.test.js b/parser/test/errors.test.js index 1d5355a..8774128 100644 --- a/parser/test/errors.test.js +++ b/parser/test/errors.test.js @@ -67,7 +67,7 @@ describe('Parser Error Handling', () => { assert.throws( () => new Parser({ version: 12 }), { - message: 'Unsupported PostgreSQL version: 12. Supported versions are 13, 14, 15, 16, 17.' + message: 'Unsupported PostgreSQL version: 12. Supported versions are 13, 14, 15, 16, 17, 18.' } ); }); diff --git a/parser/test/parsing.test.js b/parser/test/parsing.test.js index 444de47..97fda79 100644 --- a/parser/test/parsing.test.js +++ b/parser/test/parsing.test.js @@ -71,7 +71,7 @@ describe('Parser', () => { describe('Version-specific imports', () => { // Dynamically test available version imports - const versions = [13, 14, 15, 16, 17]; + const versions = [13, 14, 15, 16, 17, 18]; for (const version of versions) { it(`should parse with v${version} if available`, async () => { @@ -92,7 +92,7 @@ describe('Parser', () => { describe('Issue Test - INSERT with multiple VALUES', () => { const testSQL = "INSERT INTO logtable (message) VALUES ('Init'), ('Reboot'), ('ERROR'), ('Warning'), ('info');"; - const versions = [13, 14, 15, 16, 17]; + const versions = [13, 14, 15, 16, 17, 18]; for (const version of versions) { it(`should parse with PostgreSQL v${version} without throwing`, async () => { From 43746d95c2576d51d8c218277c0eb1a303d648f9 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 22 May 2026 00:23:06 +0000 Subject: [PATCH 3/8] docs: update all version READMEs with PG 18 in version tables --- versions/13/README.md | 5 +++-- versions/14/README.md | 5 +++-- versions/15/README.md | 5 +++-- versions/16/README.md | 5 +++-- versions/17/README.md | 5 +++-- versions/18/README.md | 2 +- 6 files changed, 16 insertions(+), 11 deletions(-) diff --git a/versions/13/README.md b/versions/13/README.md index 02878d8..18715b2 100644 --- a/versions/13/README.md +++ b/versions/13/README.md @@ -54,10 +54,11 @@ const result = await parse('SELECT * FROM users WHERE active = true'); ## Versions -Our latest is built with `17-latest` branch from libpg_query +Our latest is built with the `18-latest` branch from libpg_query | PG Major Version | libpg_query | npm dist-tag |--------------------------|-------------|---------| +| 18 | 18.0.0 | [`pg18`](https://www.npmjs.com/package/libpg-query/v/pg18) | 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) @@ -248,7 +249,7 @@ Built on the excellent work of several contributors: * [pgsql-parser](https://www.npmjs.com/package/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://www.npmjs.com/package/pgsql-deparser): A streamlined tool designed for converting PostgreSQL ASTs back into SQL queries, focusing solely on deparser functionality to complement `pgsql-parser`. -* [@pgsql/parser](https://www.npmjs.com/package/@pgsql/parser): Multi-version PostgreSQL parser with dynamic version selection at runtime, supporting PostgreSQL 15, 16, and 17 in a single package. +* [@pgsql/parser](https://www.npmjs.com/package/@pgsql/parser): Multi-version PostgreSQL parser with dynamic version selection at runtime, supporting PostgreSQL 15, 16, 17, and 18 in a single package. * [@pgsql/types](https://www.npmjs.com/package/@pgsql/types): Offers TypeScript type definitions for PostgreSQL AST nodes, facilitating type-safe construction, analysis, and manipulation of ASTs. * [@pgsql/enums](https://www.npmjs.com/package/@pgsql/enums): Provides TypeScript enum definitions for PostgreSQL constants, enabling type-safe usage of PostgreSQL enums and constants in your applications. * [@pgsql/utils](https://www.npmjs.com/package/@pgsql/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. diff --git a/versions/14/README.md b/versions/14/README.md index 02878d8..18715b2 100644 --- a/versions/14/README.md +++ b/versions/14/README.md @@ -54,10 +54,11 @@ const result = await parse('SELECT * FROM users WHERE active = true'); ## Versions -Our latest is built with `17-latest` branch from libpg_query +Our latest is built with the `18-latest` branch from libpg_query | PG Major Version | libpg_query | npm dist-tag |--------------------------|-------------|---------| +| 18 | 18.0.0 | [`pg18`](https://www.npmjs.com/package/libpg-query/v/pg18) | 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) @@ -248,7 +249,7 @@ Built on the excellent work of several contributors: * [pgsql-parser](https://www.npmjs.com/package/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://www.npmjs.com/package/pgsql-deparser): A streamlined tool designed for converting PostgreSQL ASTs back into SQL queries, focusing solely on deparser functionality to complement `pgsql-parser`. -* [@pgsql/parser](https://www.npmjs.com/package/@pgsql/parser): Multi-version PostgreSQL parser with dynamic version selection at runtime, supporting PostgreSQL 15, 16, and 17 in a single package. +* [@pgsql/parser](https://www.npmjs.com/package/@pgsql/parser): Multi-version PostgreSQL parser with dynamic version selection at runtime, supporting PostgreSQL 15, 16, 17, and 18 in a single package. * [@pgsql/types](https://www.npmjs.com/package/@pgsql/types): Offers TypeScript type definitions for PostgreSQL AST nodes, facilitating type-safe construction, analysis, and manipulation of ASTs. * [@pgsql/enums](https://www.npmjs.com/package/@pgsql/enums): Provides TypeScript enum definitions for PostgreSQL constants, enabling type-safe usage of PostgreSQL enums and constants in your applications. * [@pgsql/utils](https://www.npmjs.com/package/@pgsql/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. diff --git a/versions/15/README.md b/versions/15/README.md index 02878d8..18715b2 100644 --- a/versions/15/README.md +++ b/versions/15/README.md @@ -54,10 +54,11 @@ const result = await parse('SELECT * FROM users WHERE active = true'); ## Versions -Our latest is built with `17-latest` branch from libpg_query +Our latest is built with the `18-latest` branch from libpg_query | PG Major Version | libpg_query | npm dist-tag |--------------------------|-------------|---------| +| 18 | 18.0.0 | [`pg18`](https://www.npmjs.com/package/libpg-query/v/pg18) | 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) @@ -248,7 +249,7 @@ Built on the excellent work of several contributors: * [pgsql-parser](https://www.npmjs.com/package/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://www.npmjs.com/package/pgsql-deparser): A streamlined tool designed for converting PostgreSQL ASTs back into SQL queries, focusing solely on deparser functionality to complement `pgsql-parser`. -* [@pgsql/parser](https://www.npmjs.com/package/@pgsql/parser): Multi-version PostgreSQL parser with dynamic version selection at runtime, supporting PostgreSQL 15, 16, and 17 in a single package. +* [@pgsql/parser](https://www.npmjs.com/package/@pgsql/parser): Multi-version PostgreSQL parser with dynamic version selection at runtime, supporting PostgreSQL 15, 16, 17, and 18 in a single package. * [@pgsql/types](https://www.npmjs.com/package/@pgsql/types): Offers TypeScript type definitions for PostgreSQL AST nodes, facilitating type-safe construction, analysis, and manipulation of ASTs. * [@pgsql/enums](https://www.npmjs.com/package/@pgsql/enums): Provides TypeScript enum definitions for PostgreSQL constants, enabling type-safe usage of PostgreSQL enums and constants in your applications. * [@pgsql/utils](https://www.npmjs.com/package/@pgsql/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. diff --git a/versions/16/README.md b/versions/16/README.md index 02878d8..18715b2 100644 --- a/versions/16/README.md +++ b/versions/16/README.md @@ -54,10 +54,11 @@ const result = await parse('SELECT * FROM users WHERE active = true'); ## Versions -Our latest is built with `17-latest` branch from libpg_query +Our latest is built with the `18-latest` branch from libpg_query | PG Major Version | libpg_query | npm dist-tag |--------------------------|-------------|---------| +| 18 | 18.0.0 | [`pg18`](https://www.npmjs.com/package/libpg-query/v/pg18) | 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) @@ -248,7 +249,7 @@ Built on the excellent work of several contributors: * [pgsql-parser](https://www.npmjs.com/package/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://www.npmjs.com/package/pgsql-deparser): A streamlined tool designed for converting PostgreSQL ASTs back into SQL queries, focusing solely on deparser functionality to complement `pgsql-parser`. -* [@pgsql/parser](https://www.npmjs.com/package/@pgsql/parser): Multi-version PostgreSQL parser with dynamic version selection at runtime, supporting PostgreSQL 15, 16, and 17 in a single package. +* [@pgsql/parser](https://www.npmjs.com/package/@pgsql/parser): Multi-version PostgreSQL parser with dynamic version selection at runtime, supporting PostgreSQL 15, 16, 17, and 18 in a single package. * [@pgsql/types](https://www.npmjs.com/package/@pgsql/types): Offers TypeScript type definitions for PostgreSQL AST nodes, facilitating type-safe construction, analysis, and manipulation of ASTs. * [@pgsql/enums](https://www.npmjs.com/package/@pgsql/enums): Provides TypeScript enum definitions for PostgreSQL constants, enabling type-safe usage of PostgreSQL enums and constants in your applications. * [@pgsql/utils](https://www.npmjs.com/package/@pgsql/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. diff --git a/versions/17/README.md b/versions/17/README.md index 02878d8..18715b2 100644 --- a/versions/17/README.md +++ b/versions/17/README.md @@ -54,10 +54,11 @@ const result = await parse('SELECT * FROM users WHERE active = true'); ## Versions -Our latest is built with `17-latest` branch from libpg_query +Our latest is built with the `18-latest` branch from libpg_query | PG Major Version | libpg_query | npm dist-tag |--------------------------|-------------|---------| +| 18 | 18.0.0 | [`pg18`](https://www.npmjs.com/package/libpg-query/v/pg18) | 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) @@ -248,7 +249,7 @@ Built on the excellent work of several contributors: * [pgsql-parser](https://www.npmjs.com/package/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://www.npmjs.com/package/pgsql-deparser): A streamlined tool designed for converting PostgreSQL ASTs back into SQL queries, focusing solely on deparser functionality to complement `pgsql-parser`. -* [@pgsql/parser](https://www.npmjs.com/package/@pgsql/parser): Multi-version PostgreSQL parser with dynamic version selection at runtime, supporting PostgreSQL 15, 16, and 17 in a single package. +* [@pgsql/parser](https://www.npmjs.com/package/@pgsql/parser): Multi-version PostgreSQL parser with dynamic version selection at runtime, supporting PostgreSQL 15, 16, 17, and 18 in a single package. * [@pgsql/types](https://www.npmjs.com/package/@pgsql/types): Offers TypeScript type definitions for PostgreSQL AST nodes, facilitating type-safe construction, analysis, and manipulation of ASTs. * [@pgsql/enums](https://www.npmjs.com/package/@pgsql/enums): Provides TypeScript enum definitions for PostgreSQL constants, enabling type-safe usage of PostgreSQL enums and constants in your applications. * [@pgsql/utils](https://www.npmjs.com/package/@pgsql/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. diff --git a/versions/18/README.md b/versions/18/README.md index 646c476..45a1156 100644 --- a/versions/18/README.md +++ b/versions/18/README.md @@ -54,7 +54,7 @@ const result = await parse('SELECT * FROM users WHERE active = true'); ## Versions -Our latest is built with the `18.0.0` tag from libpg_query +Our latest is built with the `18-latest` branch from libpg_query | PG Major Version | libpg_query | npm dist-tag |--------------------------|-------------|---------| From d91bb8cb32166c678e43ce0e6818c950810d4cf9 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 22 May 2026 00:41:16 +0000 Subject: [PATCH 4/8] fix: add v18 to publish-types and publish-enums VERSIONS arrays --- scripts/publish-enums.js | 2 +- scripts/publish-types.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/publish-enums.js b/scripts/publish-enums.js index 21fa1d0..4cbd957 100755 --- a/scripts/publish-enums.js +++ b/scripts/publish-enums.js @@ -10,7 +10,7 @@ const rl = readline.createInterface({ output: process.stdout }); -const VERSIONS = ['17', '16', '15', '14', '13']; +const VERSIONS = ['18', '17', '16', '15', '14', '13']; function checkGitStatus() { try { diff --git a/scripts/publish-types.js b/scripts/publish-types.js index 3ca06b8..0a44474 100755 --- a/scripts/publish-types.js +++ b/scripts/publish-types.js @@ -10,7 +10,7 @@ const rl = readline.createInterface({ output: process.stdout }); -const VERSIONS = ['17', '16', '15', '14', '13']; +const VERSIONS = ['18', '17', '16', '15', '14', '13']; function checkGitStatus() { try { From e954e7d46a0950ac94911c81e70b402db72e882d Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Thu, 21 May 2026 17:54:14 -0700 Subject: [PATCH 5/8] release: bump @pgsql/types18 version --- types/18/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/18/package.json b/types/18/package.json index 509a427..c7e72f7 100644 --- a/types/18/package.json +++ b/types/18/package.json @@ -1,6 +1,6 @@ { "name": "@libpg-query/types18", - "version": "18.0.1", + "version": "18.0.2", "author": "Constructive ", "description": "PostgreSQL AST types from the real Postgres parser", "main": "index.js", From 0b62201eaf562a860fbc5939dc6eb3b4373de188 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Thu, 21 May 2026 17:56:27 -0700 Subject: [PATCH 6/8] v18 --- PUBLISH.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PUBLISH.md b/PUBLISH.md index 9de2a28..956384a 100644 --- a/PUBLISH.md +++ b/PUBLISH.md @@ -80,7 +80,7 @@ This command will: ```bash # Set the version (e.g. 17, 16, 15, etc.) -VERSION=17 +VERSION=18 cd types/${VERSION} pnpm version patch @@ -94,7 +94,7 @@ Promote to latest (optional) ```bash # Set the version (e.g. 17, 16, 15, etc.) -VERSION=17 +VERSION=18 # Promote pg${VERSION} tag to latest npm dist-tag add @pgsql/types@pg${VERSION} latest @@ -109,7 +109,7 @@ npm dist-tag add @pgsql/types@pg${VERSION} latest ```bash # Set the version (e.g. 17, 16, 15, etc.) -VERSION=17 +VERSION=18 cd enums/${VERSION} pnpm version patch @@ -123,7 +123,7 @@ Promote to latest (optional) ```bash # Set the version (e.g. 17, 16, 15, etc.) -VERSION=17 +VERSION=18 # Promote pg${VERSION} tag to latest npm dist-tag add @pgsql/enums@pg${VERSION} latest @@ -139,7 +139,7 @@ npm dist-tag add @pgsql/enums@pg${VERSION} latest ### Quick Publish ```bash # Set the version (e.g. 17, 16, 15, etc.) -VERSION=17 +VERSION=18 # Build and publish a specific version cd versions/${VERSION} From e13a43e15a341289e334c94d06912a5b207cb7ea Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Thu, 21 May 2026 18:50:13 -0700 Subject: [PATCH 7/8] fix: regenerate types/18 and enums/18 from PG 18 proto Previously types/18/src and enums/18/src were byte-identical to v17 (build:proto was never run against protos/18/pg_query.proto), so the published @pgsql/types@pg18 / @pgsql/enums@pg18 packages had the PG 17 AST shape. This regenerates from protos/18/pg_query.proto, picking up: - new node types: ReturningExpr, ReturningClause, ReturningOption, ATAlterConstraint, SummaryResult (plus nested Table/Function/ FilterColumn/Context under SummaryResult) - removed node: SinglePartitionSpec - new enums: CompareType, ReturningOptionKind, VarReturningType - removed enum: RowCompareType (subsumed by CompareType) - field additions on 19 messages, mostly RETURNING OLD/NEW machinery, application-time period constraints, virtual generated columns, NOT ENFORCED, and parser location metadata --- enums/18/src/index.ts | 913 ++++++++++++++++++++++-------------------- types/18/src/enums.ts | 15 +- types/18/src/types.ts | 119 +++++- 3 files changed, 580 insertions(+), 467 deletions(-) diff --git a/enums/18/src/index.ts b/enums/18/src/index.ts index 9a9e632..bda9fcb 100644 --- a/enums/18/src/index.ts +++ b/enums/18/src/index.ts @@ -87,6 +87,7 @@ export enum RTEKind { RTE_CTE = 6, RTE_NAMEDTUPLESTORE = 7, RTE_RESULT = 8, + RTE_GROUP = 9, } export enum WCOKind { WCO_VIEW_CHECK = 0, @@ -108,6 +109,10 @@ export enum CTEMaterialize { CTEMaterializeAlways = 1, CTEMaterializeNever = 2, } +export enum ReturningOptionKind { + RETURNING_OPTION_OLD = 0, + RETURNING_OPTION_NEW = 1, +} export enum JsonQuotes { JS_QUOTES_UNSPEC = 0, JS_QUOTES_KEEP = 1, @@ -193,65 +198,64 @@ export enum AlterTableType { AT_SetNotNull = 5, AT_SetExpression = 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, + AT_SetStatistics = 8, + AT_SetOptions = 9, + AT_ResetOptions = 10, + AT_SetStorage = 11, + AT_SetCompression = 12, + AT_DropColumn = 13, + AT_AddIndex = 14, + AT_ReAddIndex = 15, + AT_AddConstraint = 16, + AT_ReAddConstraint = 17, + AT_ReAddDomainConstraint = 18, + AT_AlterConstraint = 19, + AT_ValidateConstraint = 20, + AT_AddIndexConstraint = 21, + AT_DropConstraint = 22, + AT_ReAddComment = 23, + AT_AlterColumnType = 24, + AT_AlterColumnGenericOptions = 25, + AT_ChangeOwner = 26, + AT_ClusterOn = 27, + AT_DropCluster = 28, + AT_SetLogged = 29, + AT_SetUnLogged = 30, + AT_DropOids = 31, + AT_SetAccessMethod = 32, + AT_SetTableSpace = 33, + AT_SetRelOptions = 34, + AT_ResetRelOptions = 35, + AT_ReplaceRelOptions = 36, + AT_EnableTrig = 37, + AT_EnableAlwaysTrig = 38, + AT_EnableReplicaTrig = 39, + AT_DisableTrig = 40, + AT_EnableTrigAll = 41, + AT_DisableTrigAll = 42, + AT_EnableTrigUser = 43, + AT_DisableTrigUser = 44, + AT_EnableRule = 45, + AT_EnableAlwaysRule = 46, + AT_EnableReplicaRule = 47, + AT_DisableRule = 48, + AT_AddInherit = 49, + AT_DropInherit = 50, + AT_AddOf = 51, + AT_DropOf = 52, + AT_ReplicaIdentity = 53, + AT_EnableRowSecurity = 54, + AT_DisableRowSecurity = 55, + AT_ForceRowSecurity = 56, + AT_NoForceRowSecurity = 57, + AT_GenericOptions = 58, + AT_AttachPartition = 59, + AT_DetachPartition = 60, + AT_DetachPartitionFinalize = 61, + AT_AddIdentity = 62, + AT_SetIdentity = 63, + AT_DropIdentity = 64, + AT_ReAddStatistics = 65, } export enum GrantTargetType { ACL_TARGET_OBJECT = 0, @@ -281,6 +285,8 @@ export enum ConstrType { CONSTR_ATTR_NOT_DEFERRABLE = 11, CONSTR_ATTR_DEFERRED = 12, CONSTR_ATTR_IMMEDIATE = 13, + CONSTR_ATTR_ENFORCED = 14, + CONSTR_ATTR_NOT_ENFORCED = 15, } export enum ImportForeignSchemaType { FDW_IMPORT_SCHEMA_ALL = 0, @@ -379,6 +385,11 @@ export enum TableFuncType { TFT_XMLTABLE = 0, TFT_JSON_TABLE = 1, } +export enum VarReturningType { + VAR_RETURNING_DEFAULT = 0, + VAR_RETURNING_OLD = 1, + VAR_RETURNING_NEW = 2, +} export enum ParamKind { PARAM_EXTERN = 0, PARAM_EXEC = 1, @@ -412,14 +423,6 @@ export enum SubLinkType { ARRAY_SUBLINK = 6, CTE_SUBLINK = 7, } -export enum RowCompareType { - ROWCOMPARE_LT = 0, - ROWCOMPARE_LE = 1, - ROWCOMPARE_EQ = 2, - ROWCOMPARE_GE = 3, - ROWCOMPARE_GT = 4, - ROWCOMPARE_NE = 5, -} export enum MinMaxOp { IS_GREATEST = 0, IS_LEAST = 1, @@ -538,9 +541,10 @@ export enum JoinType { JOIN_RIGHT = 3, JOIN_SEMI = 4, JOIN_ANTI = 5, - JOIN_RIGHT_ANTI = 6, - JOIN_UNIQUE_OUTER = 7, - JOIN_UNIQUE_INNER = 8, + JOIN_RIGHT_SEMI = 6, + JOIN_RIGHT_ANTI = 7, + JOIN_UNIQUE_OUTER = 8, + JOIN_UNIQUE_INNER = 9, } export enum AggStrategy { AGG_PLAIN = 0, @@ -591,6 +595,17 @@ export enum LockTupleMode { LockTupleNoKeyExclusive = 2, LockTupleExclusive = 3, } +export enum CompareType { + COMPARE_INVALID = 0, + COMPARE_LT = 1, + COMPARE_LE = 2, + COMPARE_EQ = 3, + COMPARE_GE = 4, + COMPARE_GT = 5, + COMPARE_NE = 6, + COMPARE_OVERLAP = 7, + COMPARE_CONTAINED_BY = 8, +} export enum KeywordKind { NO_KEYWORD = 0, UNRESERVED_KEYWORD = 1, @@ -767,378 +782,388 @@ export enum Token { 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, + ENFORCED = 405, + ENUM_P = 406, + ERROR_P = 407, + ESCAPE = 408, + EVENT = 409, + EXCEPT = 410, + EXCLUDE = 411, + EXCLUDING = 412, + EXCLUSIVE = 413, + EXECUTE = 414, + EXISTS = 415, + EXPLAIN = 416, + EXPRESSION = 417, + EXTENSION = 418, + EXTERNAL = 419, + EXTRACT = 420, + FALSE_P = 421, + FAMILY = 422, + FETCH = 423, + FILTER = 424, + FINALIZE = 425, + FIRST_P = 426, + FLOAT_P = 427, + FOLLOWING = 428, + FOR = 429, + FORCE = 430, + FOREIGN = 431, + FORMAT = 432, + FORWARD = 433, + FREEZE = 434, + FROM = 435, + FULL = 436, + FUNCTION = 437, + FUNCTIONS = 438, + GENERATED = 439, + GLOBAL = 440, + GRANT = 441, + GRANTED = 442, + GREATEST = 443, + GROUP_P = 444, + GROUPING = 445, + GROUPS = 446, + HANDLER = 447, + HAVING = 448, + HEADER_P = 449, + HOLD = 450, + HOUR_P = 451, + IDENTITY_P = 452, + IF_P = 453, + ILIKE = 454, + IMMEDIATE = 455, + IMMUTABLE = 456, + IMPLICIT_P = 457, + IMPORT_P = 458, + IN_P = 459, + INCLUDE = 460, + INCLUDING = 461, + INCREMENT = 462, + INDENT = 463, + INDEX = 464, + INDEXES = 465, + INHERIT = 466, + INHERITS = 467, + INITIALLY = 468, + INLINE_P = 469, + INNER_P = 470, + INOUT = 471, + INPUT_P = 472, + INSENSITIVE = 473, + INSERT = 474, + INSTEAD = 475, + INT_P = 476, + INTEGER = 477, + INTERSECT = 478, + INTERVAL = 479, + INTO = 480, + INVOKER = 481, + IS = 482, + ISNULL = 483, + ISOLATION = 484, + JOIN = 485, + JSON = 486, + JSON_ARRAY = 487, + JSON_ARRAYAGG = 488, + JSON_EXISTS = 489, + JSON_OBJECT = 490, + JSON_OBJECTAGG = 491, + JSON_QUERY = 492, + JSON_SCALAR = 493, + JSON_SERIALIZE = 494, + JSON_TABLE = 495, + JSON_VALUE = 496, + KEEP = 497, + KEY = 498, + KEYS = 499, + LABEL = 500, + LANGUAGE = 501, + LARGE_P = 502, + LAST_P = 503, + LATERAL_P = 504, + LEADING = 505, + LEAKPROOF = 506, + LEAST = 507, + LEFT = 508, + LEVEL = 509, + LIKE = 510, + LIMIT = 511, + LISTEN = 512, + LOAD = 513, + LOCAL = 514, + LOCALTIME = 515, + LOCALTIMESTAMP = 516, + LOCATION = 517, + LOCK_P = 518, + LOCKED = 519, + LOGGED = 520, + MAPPING = 521, + MATCH = 522, + MATCHED = 523, + MATERIALIZED = 524, + MAXVALUE = 525, + MERGE = 526, + MERGE_ACTION = 527, + METHOD = 528, + MINUTE_P = 529, + MINVALUE = 530, + MODE = 531, + MONTH_P = 532, + MOVE = 533, + NAME_P = 534, + NAMES = 535, + NATIONAL = 536, + NATURAL = 537, + NCHAR = 538, + NESTED = 539, + NEW = 540, + NEXT = 541, + NFC = 542, + NFD = 543, + NFKC = 544, + NFKD = 545, + NO = 546, + NONE = 547, + NORMALIZE = 548, + NORMALIZED = 549, + NOT = 550, + NOTHING = 551, + NOTIFY = 552, + NOTNULL = 553, + NOWAIT = 554, + NULL_P = 555, + NULLIF = 556, + NULLS_P = 557, + NUMERIC = 558, + OBJECT_P = 559, + OBJECTS_P = 560, + OF = 561, + OFF = 562, + OFFSET = 563, + OIDS = 564, + OLD = 565, + OMIT = 566, + ON = 567, + ONLY = 568, + OPERATOR = 569, + OPTION = 570, + OPTIONS = 571, + OR = 572, + ORDER = 573, + ORDINALITY = 574, + OTHERS = 575, + OUT_P = 576, + OUTER_P = 577, + OVER = 578, + OVERLAPS = 579, + OVERLAY = 580, + OVERRIDING = 581, + OWNED = 582, + OWNER = 583, + PARALLEL = 584, + PARAMETER = 585, + PARSER = 586, + PARTIAL = 587, + PARTITION = 588, + PASSING = 589, + PASSWORD = 590, + PATH = 591, + PERIOD = 592, + PLACING = 593, + PLAN = 594, + PLANS = 595, + POLICY = 596, + POSITION = 597, + PRECEDING = 598, + PRECISION = 599, + PRESERVE = 600, + PREPARE = 601, + PREPARED = 602, + PRIMARY = 603, + PRIOR = 604, + PRIVILEGES = 605, + PROCEDURAL = 606, + PROCEDURE = 607, + PROCEDURES = 608, + PROGRAM = 609, + PUBLICATION = 610, + QUOTE = 611, + QUOTES = 612, + RANGE = 613, + READ = 614, + REAL = 615, + REASSIGN = 616, + RECURSIVE = 617, + REF_P = 618, + REFERENCES = 619, + REFERENCING = 620, + REFRESH = 621, + REINDEX = 622, + RELATIVE_P = 623, + RELEASE = 624, + RENAME = 625, + REPEATABLE = 626, + REPLACE = 627, + REPLICA = 628, + RESET = 629, + RESTART = 630, + RESTRICT = 631, + RETURN = 632, + RETURNING = 633, + RETURNS = 634, + REVOKE = 635, + RIGHT = 636, + ROLE = 637, + ROLLBACK = 638, + ROLLUP = 639, + ROUTINE = 640, + ROUTINES = 641, + ROW = 642, + ROWS = 643, + RULE = 644, + SAVEPOINT = 645, + SCALAR = 646, + SCHEMA = 647, + SCHEMAS = 648, + SCROLL = 649, + SEARCH = 650, + SECOND_P = 651, + SECURITY = 652, + SELECT = 653, + SEQUENCE = 654, + SEQUENCES = 655, + SERIALIZABLE = 656, + SERVER = 657, + SESSION = 658, + SESSION_USER = 659, + SET = 660, + SETS = 661, + SETOF = 662, + SHARE = 663, + SHOW = 664, + SIMILAR = 665, + SIMPLE = 666, + SKIP = 667, + SMALLINT = 668, + SNAPSHOT = 669, + SOME = 670, + SOURCE = 671, + SQL_P = 672, + STABLE = 673, + STANDALONE_P = 674, + START = 675, + STATEMENT = 676, + STATISTICS = 677, + STDIN = 678, + STDOUT = 679, + STORAGE = 680, + STORED = 681, + STRICT_P = 682, + STRING_P = 683, + STRIP_P = 684, + SUBSCRIPTION = 685, + SUBSTRING = 686, + SUPPORT = 687, + SYMMETRIC = 688, + SYSID = 689, + SYSTEM_P = 690, + SYSTEM_USER = 691, + TABLE = 692, + TABLES = 693, + TABLESAMPLE = 694, + TABLESPACE = 695, + TARGET = 696, + TEMP = 697, + TEMPLATE = 698, + TEMPORARY = 699, + TEXT_P = 700, + THEN = 701, + TIES = 702, + TIME = 703, + TIMESTAMP = 704, + TO = 705, + TRAILING = 706, + TRANSACTION = 707, + TRANSFORM = 708, + TREAT = 709, + TRIGGER = 710, + TRIM = 711, + TRUE_P = 712, + TRUNCATE = 713, + TRUSTED = 714, + TYPE_P = 715, + TYPES_P = 716, + UESCAPE = 717, + UNBOUNDED = 718, + UNCONDITIONAL = 719, + UNCOMMITTED = 720, + UNENCRYPTED = 721, + UNION = 722, + UNIQUE = 723, + UNKNOWN = 724, + UNLISTEN = 725, + UNLOGGED = 726, + UNTIL = 727, + UPDATE = 728, + USER = 729, + USING = 730, + VACUUM = 731, + VALID = 732, + VALIDATE = 733, + VALIDATOR = 734, + VALUE_P = 735, + VALUES = 736, + VARCHAR = 737, + VARIADIC = 738, + VARYING = 739, + VERBOSE = 740, + VERSION_P = 741, + VIEW = 742, + VIEWS = 743, + VIRTUAL = 744, + VOLATILE = 745, + WHEN = 746, + WHERE = 747, + WHITESPACE_P = 748, + WINDOW = 749, + WITH = 750, + WITHIN = 751, + WITHOUT = 752, + WORK = 753, + WRAPPER = 754, + WRITE = 755, + XML_P = 756, + XMLATTRIBUTES = 757, + XMLCONCAT = 758, + XMLELEMENT = 759, + XMLEXISTS = 760, + XMLFOREST = 761, + XMLNAMESPACES = 762, + XMLPARSE = 763, + XMLPI = 764, + XMLROOT = 765, + XMLSERIALIZE = 766, + XMLTABLE = 767, + YEAR_P = 768, + YES_P = 769, + ZONE = 770, + FORMAT_LA = 771, + NOT_LA = 772, + NULLS_LA = 773, + WITH_LA = 774, + WITHOUT_LA = 775, + MODE_TYPE_NAME = 776, + MODE_PLPGSQL_EXPR = 777, + MODE_PLPGSQL_ASSIGN1 = 778, + MODE_PLPGSQL_ASSIGN2 = 779, + MODE_PLPGSQL_ASSIGN3 = 780, + UMINUS = 781, +} +export enum Context { + None = 0, + Select = 1, + DML = 2, + DDL = 3, + Call = 4, } \ No newline at end of file diff --git a/types/18/src/enums.ts b/types/18/src/enums.ts index 0446df6..7e73bba 100644 --- a/types/18/src/enums.ts +++ b/types/18/src/enums.ts @@ -13,19 +13,20 @@ export type TableLikeOption = "CREATE_TABLE_LIKE_COMMENTS" | "CREATE_TABLE_LIKE_ 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 RTEKind = "RTE_RELATION" | "RTE_SUBQUERY" | "RTE_JOIN" | "RTE_FUNCTION" | "RTE_TABLEFUNC" | "RTE_VALUES" | "RTE_CTE" | "RTE_NAMEDTUPLESTORE" | "RTE_RESULT" | "RTE_GROUP"; 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 ReturningOptionKind = "RETURNING_OPTION_OLD" | "RETURNING_OPTION_NEW"; 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 AlterTableType = "AT_AddColumn" | "AT_AddColumnToView" | "AT_ColumnDefault" | "AT_CookedColumnDefault" | "AT_DropNotNull" | "AT_SetNotNull" | "AT_SetExpression" | "AT_DropExpression" | "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 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" | "CONSTR_ATTR_ENFORCED" | "CONSTR_ATTR_NOT_ENFORCED"; 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"; @@ -41,12 +42,12 @@ export type AlterSubscriptionType = "ALTER_SUBSCRIPTION_OPTIONS" | "ALTER_SUBSCR 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 VarReturningType = "VAR_RETURNING_DEFAULT" | "VAR_RETURNING_OLD" | "VAR_RETURNING_NEW"; 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"; @@ -62,7 +63,7 @@ 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 JoinType = "JOIN_INNER" | "JOIN_LEFT" | "JOIN_FULL" | "JOIN_RIGHT" | "JOIN_SEMI" | "JOIN_ANTI" | "JOIN_RIGHT_SEMI" | "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"; @@ -72,5 +73,7 @@ export type LimitOption = "LIMIT_OPTION_DEFAULT" | "LIMIT_OPTION_COUNT" | "LIMIT 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 CompareType = "COMPARE_INVALID" | "COMPARE_LT" | "COMPARE_LE" | "COMPARE_EQ" | "COMPARE_GE" | "COMPARE_GT" | "COMPARE_NE" | "COMPARE_OVERLAP" | "COMPARE_CONTAINED_BY"; 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 +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" | "ENFORCED" | "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" | "OBJECTS_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" | "PERIOD" | "PLACING" | "PLAN" | "PLANS" | "POLICY" | "POSITION" | "PRECEDING" | "PRECISION" | "PRESERVE" | "PREPARE" | "PREPARED" | "PRIMARY" | "PRIOR" | "PRIVILEGES" | "PROCEDURAL" | "PROCEDURE" | "PROCEDURES" | "PROGRAM" | "PUBLICATION" | "QUOTE" | "QUOTES" | "RANGE" | "READ" | "REAL" | "REASSIGN" | "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" | "VIRTUAL" | "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"; +export type Context = "None" | "Select" | "DML" | "DDL" | "Call"; \ No newline at end of file diff --git a/types/18/src/types.ts b/types/18/src/types.ts index 837af26..96e50f6 100644 --- a/types/18/src/types.ts +++ b/types/18/src/types.ts @@ -3,7 +3,7 @@ * 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"; +import { QuerySource, SortByDir, SortByNulls, SetQuantifier, A_Expr_Kind, RoleSpecType, TableLikeOption, DefElemAction, PartitionStrategy, PartitionRangeDatumKind, RTEKind, WCOKind, GroupingSetKind, CTEMaterialize, ReturningOptionKind, JsonQuotes, JsonTableColumnType, SetOperation, ObjectType, DropBehavior, AlterTableType, GrantTargetType, VariableSetKind, ConstrType, ImportForeignSchemaType, RoleStmtType, FetchDirection, FunctionParameterMode, TransactionStmtKind, ViewCheckOption, DiscardMode, ReindexObjectType, AlterTSConfigType, PublicationObjSpecType, AlterPublicationAction, AlterSubscriptionType, OverridingKind, OnCommitAction, TableFuncType, VarReturningType, ParamKind, CoercionContext, CoercionForm, BoolExprType, SubLinkType, 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, CompareType, KeywordKind, Token, Context } from "./enums"; export type Node = { ParseResult: ParseResult; } | { @@ -142,6 +142,8 @@ export type Node = { NextValueExpr: NextValueExpr; } | { InferenceElem: InferenceElem; +} | { + ReturningExpr: ReturningExpr; } | { TargetEntry: TargetEntry; } | { @@ -216,8 +218,6 @@ export type Node = { PartitionBoundSpec: PartitionBoundSpec; } | { PartitionRangeDatum: PartitionRangeDatum; -} | { - SinglePartitionSpec: SinglePartitionSpec; } | { PartitionCmd: PartitionCmd; } | { @@ -252,6 +252,10 @@ export type Node = { CommonTableExpr: CommonTableExpr; } | { MergeWhenClause: MergeWhenClause; +} | { + ReturningOption: ReturningOption; +} | { + ReturningClause: ReturningClause; } | { TriggerTransition: TriggerTransition; } | { @@ -308,10 +312,12 @@ export type Node = { CreateSchemaStmt: CreateSchemaStmt; } | { AlterTableStmt: AlterTableStmt; -} | { - ReplicaIdentityStmt: ReplicaIdentityStmt; } | { AlterTableCmd: AlterTableCmd; +} | { + ATAlterConstraint: ATAlterConstraint; +} | { + ReplicaIdentityStmt: ReplicaIdentityStmt; } | { AlterCollationStmt: AlterCollationStmt; } | { @@ -546,6 +552,14 @@ export type Node = { DropSubscriptionStmt: DropSubscriptionStmt; } | { ScanToken: ScanToken; +} | { + SummaryResult: SummaryResult; +} | { + Table: Table; +} | { + Function: Function; +} | { + FilterColumn: FilterColumn; }; export interface ParseResult { version?: number; @@ -627,7 +641,7 @@ export interface IntoClause { options?: Node[]; onCommit?: OnCommitAction; tableSpaceName?: string; - viewQuery?: Node; + viewQuery?: Query; skipData?: boolean; } export interface Var { @@ -639,6 +653,7 @@ export interface Var { varcollid?: number; varnullingrels?: bigint[]; varlevelsup?: number; + varreturningtype?: VarReturningType; location?: number; } export interface Param { @@ -895,6 +910,8 @@ export interface ArrayExpr { element_typeid?: number; elements?: Node[]; multidims?: boolean; + list_start?: number; + list_end?: number; location?: number; } export interface RowExpr { @@ -907,7 +924,7 @@ export interface RowExpr { } export interface RowCompareExpr { xpr?: Node; - rctype?: RowCompareType; + cmptype?: CompareType; opnos?: Node[]; opfamilies?: Node[]; inputcollids?: Node[]; @@ -1085,6 +1102,12 @@ export interface InferenceElem { infercollid?: number; inferopclass?: number; } +export interface ReturningExpr { + xpr?: Node; + retlevelsup?: number; + retold?: boolean; + retexpr?: Node; +} export interface TargetEntry { xpr?: Node; expr?: Node; @@ -1138,6 +1161,7 @@ export interface Query { hasModifyingCTE?: boolean; hasForUpdate?: boolean; hasRowSecurity?: boolean; + hasGroupRTE?: boolean; isReturn?: boolean; cteList?: Node[]; rtable?: Node[]; @@ -1149,6 +1173,8 @@ export interface Query { targetList?: Node[]; override?: OverridingKind; onConflict?: OnConflictExpr; + returningOldAlias?: string; + returningNewAlias?: string; returningList?: Node[]; groupClause?: Node[]; groupDistinct?: boolean; @@ -1190,6 +1216,8 @@ export interface A_Expr { name?: Node[]; lexpr?: Node; rexpr?: Node; + rexpr_list_start?: number; + rexpr_list_end?: number; location?: number; } export interface TypeCast { @@ -1232,6 +1260,8 @@ export interface A_Indirection { } export interface A_ArrayExpr { elements?: Node[]; + list_start?: number; + list_end?: number; location?: number; } export interface ResTarget { @@ -1382,7 +1412,6 @@ export interface PartitionRangeDatum { value?: Node; location?: number; } -export interface SinglePartitionSpec {} export interface PartitionCmd { name?: RangeVar; bound?: PartitionBoundSpec; @@ -1418,6 +1447,7 @@ export interface RangeTblEntry { colcollations?: Node[]; enrname?: string; enrtuples?: number; + groupexprs?: Node[]; lateral?: boolean; inFromCl?: boolean; securityQuals?: Node[]; @@ -1456,6 +1486,7 @@ export interface SortGroupClause { tleSortGroupRef?: number; eqop?: number; sortop?: number; + reverse_sort?: boolean; nulls_first?: boolean; hashable?: boolean; } @@ -1545,6 +1576,15 @@ export interface MergeWhenClause { targetList?: Node[]; values?: Node[]; } +export interface ReturningOption { + option?: ReturningOptionKind; + value?: string; + location?: number; +} +export interface ReturningClause { + options?: Node[]; + exprs?: Node[]; +} export interface TriggerTransition { name?: string; isNew?: boolean; @@ -1668,7 +1708,7 @@ export interface InsertStmt { cols?: Node[]; selectStmt?: Node; onConflictClause?: OnConflictClause; - returningList?: Node[]; + returningClause?: ReturningClause; withClause?: WithClause; override?: OverridingKind; } @@ -1676,7 +1716,7 @@ export interface DeleteStmt { relation?: RangeVar; usingClause?: Node[]; whereClause?: Node; - returningList?: Node[]; + returningClause?: ReturningClause; withClause?: WithClause; } export interface UpdateStmt { @@ -1684,7 +1724,7 @@ export interface UpdateStmt { targetList?: Node[]; whereClause?: Node; fromClause?: Node[]; - returningList?: Node[]; + returningClause?: ReturningClause; withClause?: WithClause; } export interface MergeStmt { @@ -1692,7 +1732,7 @@ export interface MergeStmt { sourceRelation?: Node; joinCondition?: Node; mergeWhenClauses?: Node[]; - returningList?: Node[]; + returningClause?: ReturningClause; withClause?: WithClause; } export interface SelectStmt { @@ -1749,10 +1789,6 @@ export interface AlterTableStmt { objtype?: ObjectType; missing_ok?: boolean; } -export interface ReplicaIdentityStmt { - identity_type?: string; - name?: string; -} export interface AlterTableCmd { subtype?: AlterTableType; name?: string; @@ -1763,6 +1799,20 @@ export interface AlterTableCmd { missing_ok?: boolean; recurse?: boolean; } +export interface ATAlterConstraint { + conname?: string; + alterEnforceability?: boolean; + is_enforced?: boolean; + alterDeferrability?: boolean; + deferrable?: boolean; + initdeferred?: boolean; + alterInheritability?: boolean; + noinherit?: boolean; +} +export interface ReplicaIdentityStmt { + identity_type?: string; + name?: string; +} export interface AlterCollationStmt { collname?: Node[]; } @@ -1821,7 +1871,9 @@ export interface VariableSetStmt { kind?: VariableSetKind; name?: string; args?: Node[]; + jumble_args?: boolean; is_local?: boolean; + location?: number; } export interface VariableShowStmt { name?: string; @@ -1834,6 +1886,7 @@ export interface CreateStmt { partspec?: PartitionSpec; ofTypename?: TypeName; constraints?: Node[]; + nnconstraints?: Node[]; options?: Node[]; oncommit?: OnCommitAction; tablespacename?: string; @@ -1845,15 +1898,17 @@ export interface Constraint { conname?: string; deferrable?: boolean; initdeferred?: boolean; + is_enforced?: boolean; skip_validation?: boolean; initially_valid?: boolean; is_no_inherit?: boolean; raw_expr?: Node; cooked_expr?: string; generated_when?: string; - inhcount?: number; + generated_kind?: string; nulls_not_distinct?: boolean; keys?: Node[]; + without_overlaps?: boolean; including?: Node[]; exclusions?: Node[]; options?: Node[]; @@ -1865,6 +1920,8 @@ export interface Constraint { pktable?: RangeVar; fk_attrs?: Node[]; pk_attrs?: Node[]; + fk_with_period?: boolean; + pk_with_period?: boolean; fk_matchtype?: string; fk_upd_action?: string; fk_del_action?: string; @@ -2148,6 +2205,7 @@ export interface IndexStmt { nulls_not_distinct?: boolean; primary?: boolean; isconstraint?: boolean; + iswithoutoverlaps?: boolean; deferrable?: boolean; initdeferred?: boolean; transformed?: boolean; @@ -2187,6 +2245,7 @@ export interface FunctionParameter { argType?: TypeName; mode?: FunctionParameterMode; defexpr?: Node; + location?: number; } export interface AlterFunctionStmt { objtype?: ObjectType; @@ -2482,4 +2541,30 @@ export interface ScanToken { end?: number; token?: Token; keywordKind?: KeywordKind; +} +export interface SummaryResult { + tables?: Table[]; + aliases?: string; + cteNames?: string[]; + functions?: Function[]; + filterColumns?: FilterColumn[]; + statementTypes?: string[]; + truncatedQuery?: string; +} +export interface Table { + name?: string; + schemaName?: string; + tableName?: string; + context?: Context; +} +export interface Function { + name?: string; + functionName?: string; + schemaName?: string; + context?: Context; +} +export interface FilterColumn { + schemaName?: string; + tableName?: string; + column?: string; } \ No newline at end of file From 4d5170d2734a8cdc77b2413456decf19e235204e Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Thu, 21 May 2026 18:51:44 -0700 Subject: [PATCH 8/8] chore: reset v18 package versions to 18.0.0 Nothing has shipped to npm yet for PG 18 (no 18.x on registry for @pgsql/types or @pgsql/enums), and the previous 18.0.1/18.0.2 bumps were paired with stale src/ generated from PG 17. Resetting so the first real PG 18 publish lands as a clean 18.0.0. - types/18: 18.0.2 -> 18.0.0 - enums/18: 18.0.1 -> 18.0.0 - versions/18: 18.0.1 -> 18.0.0 --- enums/18/package.json | 2 +- types/18/package.json | 2 +- versions/18/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/enums/18/package.json b/enums/18/package.json index e8257aa..3899de5 100644 --- a/enums/18/package.json +++ b/enums/18/package.json @@ -1,6 +1,6 @@ { "name": "@libpg-query/enums18", - "version": "18.0.1", + "version": "18.0.0", "author": "Constructive ", "description": "PostgreSQL AST enums from the real Postgres parser", "main": "index.js", diff --git a/types/18/package.json b/types/18/package.json index c7e72f7..a30bb40 100644 --- a/types/18/package.json +++ b/types/18/package.json @@ -1,6 +1,6 @@ { "name": "@libpg-query/types18", - "version": "18.0.2", + "version": "18.0.0", "author": "Constructive ", "description": "PostgreSQL AST types from the real Postgres parser", "main": "index.js", diff --git a/versions/18/package.json b/versions/18/package.json index bb1cd31..5ab31bf 100644 --- a/versions/18/package.json +++ b/versions/18/package.json @@ -1,6 +1,6 @@ { "name": "@libpg-query/v18", - "version": "18.0.1", + "version": "18.0.0", "description": "The real PostgreSQL query parser", "homepage": "https://github.com/constructive-io/libpg-query-node", "main": "./wasm/index.cjs",