sqllens 1.2.0 → 1.4.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.
Files changed (47) hide show
  1. package/THIRD-PARTY-NOTICES.md +31 -6
  2. package/dist/api.d.ts +2 -0
  3. package/dist/api.js +2 -0
  4. package/dist/bigquery/fn-docs.generated.d.ts +2 -0
  5. package/dist/bigquery/fn-docs.generated.js +1704 -0
  6. package/dist/completion/complete.js +13 -4
  7. package/dist/completion/jinja-slot.d.ts +6 -0
  8. package/dist/completion/jinja-slot.js +13 -3
  9. package/dist/databricks/fn-docs.generated.d.ts +2 -0
  10. package/dist/databricks/fn-docs.generated.js +3257 -0
  11. package/dist/duckdb/fn-docs.generated.d.ts +2 -0
  12. package/dist/duckdb/fn-docs.generated.js +2051 -0
  13. package/dist/duckdb/fold.js +6 -4
  14. package/dist/ident/fold.d.ts +5 -2
  15. package/dist/ident/fold.js +2 -0
  16. package/dist/index.d.ts +1 -1
  17. package/dist/index.js +1 -1
  18. package/dist/infer/types.js +4 -1
  19. package/dist/minijinja/apply-tags.js +19 -10
  20. package/dist/mysql/fn-docs.generated.d.ts +2 -0
  21. package/dist/mysql/fn-docs.generated.js +1204 -0
  22. package/dist/parse-diagnostics.js +33 -1
  23. package/dist/postgres/fn-docs.generated.d.ts +2 -0
  24. package/dist/postgres/fn-docs.generated.js +2818 -0
  25. package/dist/postgres/fold.js +9 -3
  26. package/dist/postgres/signatures.generated.js +585 -585
  27. package/dist/qualify/template-provider.d.ts +5 -2
  28. package/dist/qualify/template-provider.js +5 -2
  29. package/dist/redshift/fn-docs.generated.d.ts +2 -0
  30. package/dist/redshift/fn-docs.generated.js +1457 -0
  31. package/dist/redshift/fold.js +6 -4
  32. package/dist/sema/resolve.js +3 -1
  33. package/dist/signature/docs.d.ts +16 -0
  34. package/dist/signature/docs.js +47 -0
  35. package/dist/signature/render.d.ts +7 -0
  36. package/dist/signature/render.js +40 -0
  37. package/dist/signature/signature.js +5 -5
  38. package/dist/snowflake/fn-docs.generated.d.ts +2 -0
  39. package/dist/snowflake/fn-docs.generated.js +2461 -0
  40. package/dist/sqlite/fn-docs.generated.d.ts +2 -0
  41. package/dist/sqlite/fn-docs.generated.js +609 -0
  42. package/dist/sqlite/fold.js +5 -7
  43. package/dist/trino/fn-docs.generated.d.ts +2 -0
  44. package/dist/trino/fn-docs.generated.js +1932 -0
  45. package/dist/tsql/fn-docs.generated.d.ts +2 -0
  46. package/dist/tsql/fn-docs.generated.js +1017 -0
  47. package/package.json +1 -1
@@ -120,12 +120,16 @@ Forked from [antlr/grammars-v4](https://github.com/antlr/grammars-v4)
120
120
  Positive Technologies; (c) 2017 Ivan Khudyashev. Licensed under the MIT License
121
121
  (full text retained in the file headers).
122
122
 
123
- ## Doc-derived function-signature tables (distributed in this repository)
123
+ ## Doc-derived function-signature and function-docs tables (distributed in this repository)
124
124
 
125
- The generated per-dialect function-signature tables (produced by
125
+ The generated per-dialect function-signature tables and their per-name docs
126
+ companions (`signatures.generated.ts` / `fn-docs.generated.ts`, produced by
126
127
  `tools/harvest-signatures.mjs`, committed under `src/`) carry factual API-surface
127
- data (function names, parameter names, arity, optionality) extracted from each
128
- dialect's reference documentation. Sources and their licenses:
128
+ data (function names, parameter names, arity, optionality) and links to each
129
+ dialect's reference documentation. For the permissively licensed sources listed
130
+ below, the docs tables additionally reproduce one descriptive sentence per
131
+ function, extracted verbatim from the source and marked `origin: "vendor-docs"`.
132
+ Sources and their licenses:
129
133
 
130
134
  ### T-SQL signatures, from MicrosoftDocs/sql-docs (CC BY 4.0)
131
135
 
@@ -133,7 +137,9 @@ Derived from the Transact-SQL reference markdown in
133
137
  [MicrosoftDocs/sql-docs](https://github.com/MicrosoftDocs/sql-docs), (c) Microsoft
134
138
  Corporation, licensed [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
135
139
  Changes were made: the documented syntax notation was mechanically parsed and
136
- transformed into TypeScript signature tables; no documentation prose is reproduced.
140
+ transformed into TypeScript signature tables, and the docs table reproduces each
141
+ function page's first descriptive sentence (truncated to one sentence, whitespace
142
+ collapsed); no other documentation prose is reproduced.
137
143
 
138
144
  ### DuckDB signatures, from duckdb/duckdb-web (MIT)
139
145
 
@@ -160,6 +166,21 @@ Derived from the function reference markdown in
160
166
  [google/googlesql](https://github.com/google/googlesql) `docs/`, (c) Google LLC,
161
167
  Apache License 2.0.
162
168
 
169
+ ### Databricks descriptions, from Apache Spark's Built-in Functions reference (Apache License 2.0)
170
+
171
+ The databricks docs table's descriptions (origin `"spark-docs"`) are reproduced
172
+ from [Apache Spark](https://spark.apache.org)'s generated SQL Built-in Functions
173
+ reference (4.0.1), (c) The Apache Software Foundation, Apache License 2.0 —
174
+ Spark-authored prose describing the Spark SQL surface Databricks shares.
175
+ Databricks-only functions carry no Spark description.
176
+
177
+ ### SQLite signatures and descriptions, from the sqlite.org documentation (public domain)
178
+
179
+ Derived from the [sqlite.org](https://sqlite.org) function-reference pages (doc
180
+ bundle 3.53.3). SQLite's code and documentation are dedicated to the
181
+ [public domain](https://sqlite.org/copyright.html); the docs table reproduces one
182
+ descriptive sentence per function.
183
+
163
184
  ### Databricks and Snowflake signatures, from the vendors' public SQL references
164
185
 
165
186
  Derived from the Syntax sections of the public SQL language references at
@@ -168,7 +189,11 @@ Derived from the Syntax sections of the public SQL language references at
168
189
  publish no redistribution license; the tables reproduce only the factual call
169
190
  shape of each function (name, parameter names, arity, optionality), the same facts
170
191
  any SQL tool documents about a dialect's API surface, and no documentation prose.
171
- Credited here as sources with thanks.
192
+ The docs tables link each function to its page on these sites; no page text is
193
+ reproduced. The same applies to the Redshift
194
+ ([docs.aws.amazon.com](https://docs.aws.amazon.com), (c) Amazon Web Services) and
195
+ MySQL ([dev.mysql.com](https://dev.mysql.com/doc/), (c) Oracle Corporation)
196
+ references: links only, no prose. Credited here as sources with thanks.
172
197
 
173
198
  ## Runtime and build dependencies (not redistributed in source)
174
199
 
package/dist/api.d.ts CHANGED
@@ -120,6 +120,8 @@ export { complete, completeAt, type Completion } from "./completion/complete.js"
120
120
  export { jinjaSlotAt, type JinjaSlot } from "./completion/jinja-slot.js";
121
121
  export { signatureAt, type SignatureHelpInfo, type SignatureLabel } from "./signature/signature.js";
122
122
  export { SIGNATURES, lookupSignature, hasSignature, type FnSignature, type ParamSig } from "./signature/signatures.js";
123
+ export { renderSignature, type RenderSignatureOptions } from "./signature/render.js";
124
+ export { FN_DOCS, lookupFnDoc, type FnDoc } from "./signature/docs.js";
123
125
  export { referencesAt, type Occurrence, type Occurrences } from "./references/references.js";
124
126
  export { dialectSymbols, type DialectSymbols } from "./dialect-symbols.js";
125
127
  export { CallbackSchema, type SchemaProvider, type TableResolver } from "./qualify/schema-provider.js";
package/dist/api.js CHANGED
@@ -217,6 +217,8 @@ export { jinjaSlotAt } from "./completion/jinja-slot.js";
217
217
  // name-only fallback. A pure token scan; never throws.
218
218
  export { signatureAt } from "./signature/signature.js";
219
219
  export { SIGNATURES, lookupSignature, hasSignature } from "./signature/signatures.js";
220
+ export { renderSignature } from "./signature/render.js";
221
+ export { FN_DOCS, lookupFnDoc } from "./signature/docs.js";
220
222
  // References / occurrence engine — find the declaration + every occurrence of the symbol under a
221
223
  // cursor offset. The core primitive behind LSP references / documentHighlight / codeLens / rename.
222
224
  // Total: never throws; returns null off-symbol.
@@ -0,0 +1,2 @@
1
+ import type { FnDoc } from "../signature/docs.js";
2
+ export declare const BIGQUERY_FN_DOCS: Record<string, FnDoc>;