From 9d91aa8521cf0a85daf0510fe12818c39ec3981b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?javier=20ram=C3=ADrez?= Date: Mon, 6 Apr 2026 12:53:14 +0200 Subject: [PATCH 1/6] Add new keywords 'ordinality' and 'unnest' to keywords This is to support unnest, which has been merged already into questdb master (we should add this for the 9.3.5 release) --- src/keywords.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/keywords.ts b/src/keywords.ts index effa997..b8b3424 100644 --- a/src/keywords.ts +++ b/src/keywords.ts @@ -114,6 +114,7 @@ export default [ "option", "or", "order", + "ordinality", "others", "outer", "overridable", @@ -178,6 +179,7 @@ export default [ "unbounded", "union", "unlock", + "unnest", "unpivot", "update", "user", From 986c59286c784344ecb329fad58add63ae4a5140 Mon Sep 17 00:00:00 2001 From: javier Date: Fri, 10 Apr 2026 12:05:56 +0200 Subject: [PATCH 2/6] syncing with sql-parser --- src/functions.ts | 42 +++++++++++++++++------------------ src/keywords.ts | 58 +++++++++++++++++++++++++++++++++--------------- 2 files changed, 60 insertions(+), 40 deletions(-) diff --git a/src/functions.ts b/src/functions.ts index 635d3e5..32feb97 100644 --- a/src/functions.ts +++ b/src/functions.ts @@ -1,42 +1,40 @@ -export default [ - "<<", - "<<=", - ">>", - ">>=", - "_query_trace", - "VARCHAR", +export const functions: string[] = [ "abs", "acos", "all_permissions", "all_tables", + "and", + "approx_count_distinct", + "approx_median", + "approx_percentile", + "arg_max", + "arg_min", + "array_agg", "array_avg", + "array_build", "array_count", "array_cum_sum", "array_max", "array_min", "array_position", + "array_reverse", + "array_sort", "array_stddev", "array_stddev_pop", "array_stddev_samp", "array_sum", - "and", - "approx_median", - "approx_count_distinct", - "approx_percentile", - "arg_max", - "arg_min", "asin", "atan", "atan2", "avg", "base64", "batch", + "between", "bit_and", "bit_or", "bit_xor", "bool_and", "bool_or", - "between", "build", "case", "cast", @@ -48,14 +46,14 @@ export default [ "corr", "cos", "cot", - "covar_pop", - "covar_samp", "count", "count_distinct", + "covar_pop", + "covar_samp", + "current_catalog", "current_database", "current_schema", "current_schemas", - "current_catalog", "current_setting", "current_user", "date_trunc", @@ -100,11 +98,11 @@ export default [ "import_files", "in", "information_schema._pg_expandarray", + "insertion_point", "interval_end", "interval_start", - "insertion_point", - "isOrdered", "is_leap_year", + "isOrdered", "isnull", "json_extract", "keywords", @@ -248,12 +246,12 @@ export default [ "server_conf", "server_version", "session_user", - "shift", "sha1", "sha256", + "shift", "show", - "simulate_crash", "sign", + "simulate_crash", "sin", "size_pretty", "split_part", @@ -310,6 +308,7 @@ export default [ "variance", "version", "views", + "vwap", "wal_tables", "wal_transactions", "week_of_year", @@ -322,7 +321,6 @@ export default [ "within_radius", "wmid", "writer_pool", - "vwap", "year", "yesterday", ] diff --git a/src/keywords.ts b/src/keywords.ts index b8b3424..cb71c8c 100644 --- a/src/keywords.ts +++ b/src/keywords.ts @@ -1,4 +1,4 @@ -export default [ +export const keywords: string[] = [ "abort", "account", "accounts", @@ -18,38 +18,43 @@ export default [ "base", "batch", "between", + "bloom_filter", + "brotli", "by", "bypass", "cache", "calendar", + "cancel", "capacity", "cascade", "case", "cast", - "cancel", "checkpoint", "column", "columns", "compile", "compression_codec", "compression_level", + "commitLag", "convert", "copy", "create", "cross", "cumulative", "current", - "dedup", "data_page_size", "database", "declare", - "deferred", - "detach", - "details", + "dedup", "default", + "deferred", "delay", "delete", "delimiter", + "delta_binary_packed", + "delta_length_byte_array", + "detach", + "details", "disable", "distinct", "drop", @@ -67,20 +72,22 @@ export default [ "external", "fill", "first", + "following", "for", - "format", "foreign", - "following", + "format", "from", "full", "grant", "group", "groups", + "gzip", "header", "horizon", - "http", + "http", "if", "ignore", + "ilike", "in", "include", "index", @@ -88,20 +95,26 @@ export default [ "insert", "intersect", "into", + "is", "isolation", "join", + "keep", "key", "keys", "latest", + "lateral", "left", "length", "level", + "like", "limit", "list", "lock", "lt", + "lz4_raw", + "maps", "materialized", - "natural", + "maxUncommittedRows", "no", "nocache", "not", @@ -117,25 +130,30 @@ export default [ "ordinality", "others", "outer", - "overridable", "over", + "overridable", "owned", "param", "parameters", "parquet_version", + "partition_by", "partition", "partitions", "password", "period", "permissions", "pivot", + "plain", "preceding", "prevailing", "primary", "public", + "query", "range", + "raw_array_encoding", "references", "refresh", + "release", "reindex", "remove", "rename", @@ -145,22 +163,23 @@ export default [ "resume", "revoke", "right", - "range", - "row_group_size", + "rle_dictionary", "row", + "row_group_size", "rows", "sample", "select", - "set", "service", + "set", "show", "skip", + "snappy", "snapshot", "splice", "squash", "start", - "statistics_enabled", "step", + "statistics_enabled", "suspend", "system", "table", @@ -168,23 +187,24 @@ export default [ "then", "time", "to", - "tolerance", "token", - "transient", + "tolerance", "transaction", + "transient", "truncate", "ttl", "txn", "type", "unbounded", + "uncompressed", "union", "unlock", "unnest", "unpivot", "update", + "upsert", "user", "users", - "upsert", "vacuum", "values", "verification", @@ -195,6 +215,8 @@ export default [ "where", "window", "with", + "within", "writer", "zone", + "zstd", ] From 46856c7b394993c1a4ee46642aa9eebcbeb3c40c Mon Sep 17 00:00:00 2001 From: javier Date: Fri, 10 Apr 2026 12:08:57 +0200 Subject: [PATCH 3/6] export default --- src/functions.ts | 2 +- src/keywords.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/functions.ts b/src/functions.ts index 32feb97..84a5656 100644 --- a/src/functions.ts +++ b/src/functions.ts @@ -1,4 +1,4 @@ -export const functions: string[] = [ +export default [ "abs", "acos", "all_permissions", diff --git a/src/keywords.ts b/src/keywords.ts index cb71c8c..a3bc79e 100644 --- a/src/keywords.ts +++ b/src/keywords.ts @@ -1,4 +1,4 @@ -export const keywords: string[] = [ +export default [ "abort", "account", "accounts", From e29d14f617e4a150dd2bd2c154bacbb3edea95c3 Mon Sep 17 00:00:00 2001 From: javier Date: Fri, 10 Apr 2026 16:06:33 +0200 Subject: [PATCH 4/6] Move compression/encoding constants from keywords to constants Relocate brotli, delta_binary_packed, delta_length_byte_array, gzip, lz4_raw, plain, rle_dictionary, snappy, uncompressed, and zstd from keywords.ts to constants.ts where they belong. --- src/constants.ts | 4 ++++ src/keywords.ts | 10 ---------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/constants.ts b/src/constants.ts index 8078794..bfdfa42 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -6,6 +6,8 @@ export default [ "day", "days", "decade", + "delta_binary_packed", + "delta_length_byte_array", "desc", "dow", "doy", @@ -42,11 +44,13 @@ export default [ "none", "null", "parquet", + "plain", "pgwire", "prepare", "prev", "quarter", "rest", + "rle_dictionary", "second", "seconds", "skip_column", diff --git a/src/keywords.ts b/src/keywords.ts index a3bc79e..358bd12 100644 --- a/src/keywords.ts +++ b/src/keywords.ts @@ -19,7 +19,6 @@ export default [ "batch", "between", "bloom_filter", - "brotli", "by", "bypass", "cache", @@ -51,8 +50,6 @@ export default [ "delay", "delete", "delimiter", - "delta_binary_packed", - "delta_length_byte_array", "detach", "details", "disable", @@ -81,7 +78,6 @@ export default [ "grant", "group", "groups", - "gzip", "header", "horizon", "http", @@ -111,7 +107,6 @@ export default [ "list", "lock", "lt", - "lz4_raw", "maps", "materialized", "maxUncommittedRows", @@ -143,7 +138,6 @@ export default [ "period", "permissions", "pivot", - "plain", "preceding", "prevailing", "primary", @@ -163,7 +157,6 @@ export default [ "resume", "revoke", "right", - "rle_dictionary", "row", "row_group_size", "rows", @@ -173,7 +166,6 @@ export default [ "set", "show", "skip", - "snappy", "snapshot", "splice", "squash", @@ -196,7 +188,6 @@ export default [ "txn", "type", "unbounded", - "uncompressed", "union", "unlock", "unnest", @@ -218,5 +209,4 @@ export default [ "within", "writer", "zone", - "zstd", ] From 739ce50984e977c85a90dedf3b42fa64e145b651 Mon Sep 17 00:00:00 2001 From: javier Date: Fri, 10 Apr 2026 16:12:19 +0200 Subject: [PATCH 5/6] Restore entries removed from master in functions and keywords Add back <<, <<=, >>, >>=, VARCHAR to functions.ts and asc, complete, desc, ilp, immediate, jwk, manual, nan, natural, none, null, pgwire, prepare, rest to keywords.ts. This PR should only add, never remove. --- src/functions.ts | 7 ++++++- src/keywords.ts | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/functions.ts b/src/functions.ts index 84a5656..2960da2 100644 --- a/src/functions.ts +++ b/src/functions.ts @@ -1,4 +1,9 @@ -export default [ +export default [ + "<<", + "<<=", + ">>", + ">>=", + "VARCHAR", "abs", "acos", "all_permissions", diff --git a/src/keywords.ts b/src/keywords.ts index 358bd12..3d9a126 100644 --- a/src/keywords.ts +++ b/src/keywords.ts @@ -10,6 +10,7 @@ export default [ "and", "any", "as", + "asc", "asof", "assume", "attach", @@ -31,6 +32,7 @@ export default [ "checkpoint", "column", "columns", + "complete", "compile", "compression_codec", "compression_level", @@ -50,6 +52,7 @@ export default [ "delay", "delete", "delimiter", + "desc", "detach", "details", "disable", @@ -84,6 +87,8 @@ export default [ "if", "ignore", "ilike", + "ilp", + "immediate", "in", "include", "index", @@ -94,6 +99,7 @@ export default [ "is", "isolation", "join", + "jwk", "keep", "key", "keys", @@ -107,12 +113,17 @@ export default [ "list", "lock", "lt", + "manual", "maps", "materialized", "maxUncommittedRows", + "nan", + "natural", "no", "nocache", + "none", "not", + "null", "nulls", "o3MaxLag", "observation", @@ -137,8 +148,10 @@ export default [ "password", "period", "permissions", + "pgwire", "pivot", "preceding", + "prepare", "prevailing", "primary", "public", @@ -154,6 +167,7 @@ export default [ "repair", "replace", "respect", + "rest", "resume", "revoke", "right", From ff2639564a32e1cd9bdba99972a80fae8bd32f9a Mon Sep 17 00:00:00 2001 From: javier Date: Fri, 10 Apr 2026 16:18:45 +0200 Subject: [PATCH 6/6] Add back _query_trace to functions --- src/functions.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/functions.ts b/src/functions.ts index 2960da2..c9a3f0e 100644 --- a/src/functions.ts +++ b/src/functions.ts @@ -3,6 +3,7 @@ export default [ "<<=", ">>", ">>=", + "_query_trace", "VARCHAR", "abs", "acos",