sqllens 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD-PARTY-NOTICES.md +31 -6
- package/dist/api.d.ts +2 -0
- package/dist/api.js +2 -0
- package/dist/bigquery/fn-docs.generated.d.ts +2 -0
- package/dist/bigquery/fn-docs.generated.js +1704 -0
- package/dist/completion/jinja-slot.js +6 -1
- package/dist/databricks/fn-docs.generated.d.ts +2 -0
- package/dist/databricks/fn-docs.generated.js +3257 -0
- package/dist/duckdb/fn-docs.generated.d.ts +2 -0
- package/dist/duckdb/fn-docs.generated.js +2051 -0
- package/dist/duckdb/fold.js +6 -4
- package/dist/ident/fold.d.ts +5 -2
- package/dist/ident/fold.js +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/infer/types.js +4 -1
- package/dist/mysql/fn-docs.generated.d.ts +2 -0
- package/dist/mysql/fn-docs.generated.js +1204 -0
- package/dist/parse-diagnostics.js +33 -1
- package/dist/postgres/fn-docs.generated.d.ts +2 -0
- package/dist/postgres/fn-docs.generated.js +2818 -0
- package/dist/postgres/fold.js +9 -3
- package/dist/postgres/signatures.generated.js +585 -585
- package/dist/redshift/fn-docs.generated.d.ts +2 -0
- package/dist/redshift/fn-docs.generated.js +1457 -0
- package/dist/redshift/fold.js +6 -4
- package/dist/sema/resolve.js +3 -1
- package/dist/signature/docs.d.ts +16 -0
- package/dist/signature/docs.js +47 -0
- package/dist/signature/render.d.ts +7 -0
- package/dist/signature/render.js +40 -0
- package/dist/signature/signature.js +5 -5
- package/dist/snowflake/fn-docs.generated.d.ts +2 -0
- package/dist/snowflake/fn-docs.generated.js +2461 -0
- package/dist/sqlite/fn-docs.generated.d.ts +2 -0
- package/dist/sqlite/fn-docs.generated.js +609 -0
- package/dist/sqlite/fold.js +5 -7
- package/dist/trino/fn-docs.generated.d.ts +2 -0
- package/dist/trino/fn-docs.generated.js +1932 -0
- package/dist/tsql/fn-docs.generated.d.ts +2 -0
- package/dist/tsql/fn-docs.generated.js +1017 -0
- package/package.json +1 -1
package/dist/postgres/fold.js
CHANGED
|
@@ -5,13 +5,19 @@
|
|
|
5
5
|
// postgresql.org/docs/18/sql-syntax-lexical.html §4.1.1 — verified live: "unquoted names are
|
|
6
6
|
// always folded to lower case"; "Quoting an identifier also makes it case-sensitive" — example
|
|
7
7
|
// "the identifiers FOO, foo, and "foo" are considered the same by PostgreSQL, but "Foo" and
|
|
8
|
-
// "FOO" are different."
|
|
9
|
-
//
|
|
8
|
+
// "FOO" are different." The manual is silent on the fold's character scope; the engine source
|
|
9
|
+
// is the authority there (#22): the default downcase path folds ASCII only (pg_downcase_ident →
|
|
10
|
+
// strlower_c → pg_ascii_tolower; pre-refactor downcase_identifier locale-folded high-bit bytes
|
|
11
|
+
// only in single-byte server encodings), so in a UTF-8 database, the universal default, `Ä` and
|
|
12
|
+
// `ä` are distinct unquoted identifiers. Hence ascii-lower for unquoted. A non-C locale provider
|
|
13
|
+
// or single-byte encoding could fold more, but that is server state invisible to the SQL text
|
|
14
|
+
// (same documented boundary as mysql's lower_case_table_names). Doubled-quote escape: "To include
|
|
15
|
+
// a double quote, write two double quotes."
|
|
10
16
|
import { displayWith, foldWith } from "../ident/fold.js";
|
|
11
17
|
const DOUBLE_QUOTE = ['"', '"'];
|
|
12
18
|
export const POSTGRES_FOLD_RULE = {
|
|
13
19
|
delimiters: [DOUBLE_QUOTE],
|
|
14
|
-
unquoted: "lower",
|
|
20
|
+
unquoted: "ascii-lower",
|
|
15
21
|
quoted: "preserve",
|
|
16
22
|
};
|
|
17
23
|
/** Fold an identifier to its PostgreSQL identity key. */
|