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.
Files changed (42) 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/jinja-slot.js +6 -1
  7. package/dist/databricks/fn-docs.generated.d.ts +2 -0
  8. package/dist/databricks/fn-docs.generated.js +3257 -0
  9. package/dist/duckdb/fn-docs.generated.d.ts +2 -0
  10. package/dist/duckdb/fn-docs.generated.js +2051 -0
  11. package/dist/duckdb/fold.js +6 -4
  12. package/dist/ident/fold.d.ts +5 -2
  13. package/dist/ident/fold.js +2 -0
  14. package/dist/index.d.ts +1 -1
  15. package/dist/index.js +1 -1
  16. package/dist/infer/types.js +4 -1
  17. package/dist/mysql/fn-docs.generated.d.ts +2 -0
  18. package/dist/mysql/fn-docs.generated.js +1204 -0
  19. package/dist/parse-diagnostics.js +33 -1
  20. package/dist/postgres/fn-docs.generated.d.ts +2 -0
  21. package/dist/postgres/fn-docs.generated.js +2818 -0
  22. package/dist/postgres/fold.js +9 -3
  23. package/dist/postgres/signatures.generated.js +585 -585
  24. package/dist/redshift/fn-docs.generated.d.ts +2 -0
  25. package/dist/redshift/fn-docs.generated.js +1457 -0
  26. package/dist/redshift/fold.js +6 -4
  27. package/dist/sema/resolve.js +3 -1
  28. package/dist/signature/docs.d.ts +16 -0
  29. package/dist/signature/docs.js +47 -0
  30. package/dist/signature/render.d.ts +7 -0
  31. package/dist/signature/render.js +40 -0
  32. package/dist/signature/signature.js +5 -5
  33. package/dist/snowflake/fn-docs.generated.d.ts +2 -0
  34. package/dist/snowflake/fn-docs.generated.js +2461 -0
  35. package/dist/sqlite/fn-docs.generated.d.ts +2 -0
  36. package/dist/sqlite/fn-docs.generated.js +609 -0
  37. package/dist/sqlite/fold.js +5 -7
  38. package/dist/trino/fn-docs.generated.d.ts +2 -0
  39. package/dist/trino/fn-docs.generated.js +1932 -0
  40. package/dist/tsql/fn-docs.generated.d.ts +2 -0
  41. package/dist/tsql/fn-docs.generated.js +1017 -0
  42. package/package.json +1 -1
@@ -0,0 +1,2 @@
1
+ import type { FnDoc } from "../signature/docs.js";
2
+ export declare const SQLITE_FN_DOCS: Record<string, FnDoc>;
@@ -0,0 +1,609 @@
1
+ export const SQLITE_FN_DOCS = {
2
+ abs: {
3
+ docUrl: "https://sqlite.org/lang_corefunc.html#abs",
4
+ description: "The abs(X) function returns the absolute value of the numeric argument X.",
5
+ origin: "vendor-docs",
6
+ },
7
+ acos: {
8
+ docUrl: "https://sqlite.org/lang_mathfunc.html#acos",
9
+ description: "Return the arccosine of X.",
10
+ origin: "vendor-docs",
11
+ },
12
+ acosh: {
13
+ docUrl: "https://sqlite.org/lang_mathfunc.html#acosh",
14
+ description: "Return the hyperbolic arccosine of X.",
15
+ origin: "vendor-docs",
16
+ },
17
+ asin: {
18
+ docUrl: "https://sqlite.org/lang_mathfunc.html#asin",
19
+ description: "Return the arcsine of X.",
20
+ origin: "vendor-docs",
21
+ },
22
+ asinh: {
23
+ docUrl: "https://sqlite.org/lang_mathfunc.html#asinh",
24
+ description: "Return the hyperbolic arcsine of X.",
25
+ origin: "vendor-docs",
26
+ },
27
+ atan: {
28
+ docUrl: "https://sqlite.org/lang_mathfunc.html#atan",
29
+ description: "Return the arctangent of X.",
30
+ origin: "vendor-docs",
31
+ },
32
+ atan2: {
33
+ docUrl: "https://sqlite.org/lang_mathfunc.html#atan2",
34
+ description: "Return the arctangent of Y/X.",
35
+ origin: "vendor-docs",
36
+ },
37
+ atanh: {
38
+ docUrl: "https://sqlite.org/lang_mathfunc.html#atanh",
39
+ description: "Return the hyperbolic arctangent of X.",
40
+ origin: "vendor-docs",
41
+ },
42
+ avg: {
43
+ docUrl: "https://sqlite.org/lang_aggfunc.html#avg",
44
+ description: "The avg() function returns the average value of all non-NULL X within a group.",
45
+ origin: "vendor-docs",
46
+ },
47
+ ceil: {
48
+ docUrl: "https://sqlite.org/lang_mathfunc.html#ceil",
49
+ description: "Return the first representable integer value greater than or equal to X.",
50
+ origin: "vendor-docs",
51
+ },
52
+ ceiling: {
53
+ docUrl: "https://sqlite.org/lang_mathfunc.html#ceil",
54
+ description: "Return the first representable integer value greater than or equal to X.",
55
+ origin: "vendor-docs",
56
+ },
57
+ changes: {
58
+ docUrl: "https://sqlite.org/lang_corefunc.html#changes",
59
+ description: "The changes() function returns the number of database rows that were changed or inserted or deleted by the most recently completed INSERT, DELETE, or UPDATE statement, exclusive of statements in lower-level triggers.",
60
+ origin: "vendor-docs",
61
+ },
62
+ coalesce: {
63
+ docUrl: "https://sqlite.org/lang_corefunc.html#coalesce",
64
+ description: "The coalesce() function returns a copy of its first non-NULL argument, or NULL if all arguments are NULL.",
65
+ origin: "vendor-docs",
66
+ },
67
+ concat: {
68
+ docUrl: "https://sqlite.org/lang_corefunc.html#concat",
69
+ description: "The concat(...) function returns a string which is the concatenation of the string representation of all of its non-NULL arguments.",
70
+ origin: "vendor-docs",
71
+ },
72
+ concat_ws: {
73
+ docUrl: "https://sqlite.org/lang_corefunc.html#concat_ws",
74
+ description: "The concat_ws(SEP,...) function returns a string that is the concatenation of all non-null arguments beyond the first argument, using the text value of the first argument as a separator.",
75
+ origin: "vendor-docs",
76
+ },
77
+ cos: {
78
+ docUrl: "https://sqlite.org/lang_mathfunc.html#cos",
79
+ description: "Return the cosine of X.",
80
+ origin: "vendor-docs",
81
+ },
82
+ cosh: {
83
+ docUrl: "https://sqlite.org/lang_mathfunc.html#cosh",
84
+ description: "Return the hyperbolic cosine of X.",
85
+ origin: "vendor-docs",
86
+ },
87
+ count: {
88
+ docUrl: "https://sqlite.org/lang_aggfunc.html#count",
89
+ description: "The count(X) function returns a count of the number of times that X is not NULL in a group.",
90
+ origin: "vendor-docs",
91
+ },
92
+ cume_dist: {
93
+ docUrl: "https://sqlite.org/windowfunctions.html",
94
+ description: "The cumulative distribution.",
95
+ origin: "vendor-docs",
96
+ },
97
+ date: {
98
+ docUrl: "https://sqlite.org/lang_datefunc.html",
99
+ description: "The date() function returns the date as text in this format: YYYY-MM-DD.",
100
+ origin: "vendor-docs",
101
+ },
102
+ datetime: {
103
+ docUrl: "https://sqlite.org/lang_datefunc.html",
104
+ description: "The datetime() function returns the date and time formatted as YYYY-MM-DD HH:MM:SS or as YYYY-MM-DD HH:MM:SS.",
105
+ origin: "vendor-docs",
106
+ },
107
+ degrees: {
108
+ docUrl: "https://sqlite.org/lang_mathfunc.html#degrees",
109
+ description: "Convert value X from radians into degrees.",
110
+ origin: "vendor-docs",
111
+ },
112
+ dense_rank: {
113
+ docUrl: "https://sqlite.org/windowfunctions.html",
114
+ description: "The number of the current row's peer group within its partition - the rank of the current row without gaps.",
115
+ origin: "vendor-docs",
116
+ },
117
+ exp: {
118
+ docUrl: "https://sqlite.org/lang_mathfunc.html#exp",
119
+ description: "Compute e (Euler's number, approximately 2.71828182845905) raised to the power X.",
120
+ origin: "vendor-docs",
121
+ },
122
+ first_value: {
123
+ docUrl: "https://sqlite.org/windowfunctions.html",
124
+ description: "This built-in window function calculates the window frame for each row in the same way as an aggregate window function.",
125
+ origin: "vendor-docs",
126
+ },
127
+ floor: {
128
+ docUrl: "https://sqlite.org/lang_mathfunc.html#floor",
129
+ description: "Return the first representable integer value less than or equal to X.",
130
+ origin: "vendor-docs",
131
+ },
132
+ format: {
133
+ docUrl: "https://sqlite.org/lang_corefunc.html#format",
134
+ description: "The format(FORMAT,...) SQL function works like the sqlite3_mprintf() C-language function and the printf() function from the standard C library.",
135
+ origin: "vendor-docs",
136
+ },
137
+ glob: {
138
+ docUrl: "https://sqlite.org/lang_corefunc.html#glob",
139
+ description: 'The glob(X,Y) function is equivalent to the expression " Y GLOB X ".',
140
+ origin: "vendor-docs",
141
+ },
142
+ group_concat: {
143
+ docUrl: "https://sqlite.org/lang_aggfunc.html#group_concat",
144
+ description: "The group_concat() function returns a string which is the concatenation of all non-NULL values of X.",
145
+ origin: "vendor-docs",
146
+ },
147
+ hex: {
148
+ docUrl: "https://sqlite.org/lang_corefunc.html#hex",
149
+ description: "The hex() function interprets its argument as a BLOB and returns a string which is the upper-case hexadecimal rendering of the content of that blob.",
150
+ origin: "vendor-docs",
151
+ },
152
+ if: {
153
+ docUrl: "https://sqlite.org/lang_corefunc.html#iif",
154
+ description: "The iif(B1,V1,...,BN,VN) function takes arguments in pairs.",
155
+ origin: "vendor-docs",
156
+ },
157
+ ifnull: {
158
+ docUrl: "https://sqlite.org/lang_corefunc.html#ifnull",
159
+ description: "The ifnull() function returns a copy of its first non-NULL argument, or NULL if both arguments are NULL.",
160
+ origin: "vendor-docs",
161
+ },
162
+ iif: {
163
+ docUrl: "https://sqlite.org/lang_corefunc.html#iif",
164
+ description: "The iif(B1,V1,...,BN,VN) function takes arguments in pairs.",
165
+ origin: "vendor-docs",
166
+ },
167
+ instr: {
168
+ docUrl: "https://sqlite.org/lang_corefunc.html#instr",
169
+ description: "The instr(X,Y) function finds the first occurrence of string Y within string X and returns the number of prior characters plus 1, or 0 if Y is nowhere found within X.",
170
+ origin: "vendor-docs",
171
+ },
172
+ json: {
173
+ docUrl: "https://sqlite.org/json1.html#the_json_function",
174
+ description: "The json(X) function verifies that its argument X is a valid JSON string or JSONB blob and returns a minified version of that JSON string with all unnecessary whitespace removed.",
175
+ origin: "vendor-docs",
176
+ },
177
+ json_array_length: {
178
+ docUrl: "https://sqlite.org/json1.html#the_json_array_length_function",
179
+ description: "The json_array_length(X) function returns the number of elements in the JSON array X, or 0 if X is some kind of JSON value other than an array.",
180
+ origin: "vendor-docs",
181
+ },
182
+ json_each: {
183
+ docUrl: "https://sqlite.org/json1.html#table_valued_functions_for_parsing_json_json_each_jsonb_each_json_tree_and_jsonb_tree_",
184
+ description: "The json_each(X), jsonb_each(X), json_tree(X), and jsonb_tree(X) table-valued functions all walk the JSON value provided as their first argument and return one row for each element.",
185
+ origin: "vendor-docs",
186
+ },
187
+ json_error_position: {
188
+ docUrl: "https://sqlite.org/json1.html#the_json_error_position_function",
189
+ description: "The json_error_position(X) function returns 0 if the input X is a well-formed JSON or JSON5 string.",
190
+ origin: "vendor-docs",
191
+ },
192
+ json_extract: {
193
+ docUrl: "https://sqlite.org/json1.html#the_json_extract_function",
194
+ description: "The json_extract(X,P1,P2,...) extracts and returns one or more values from the well-formed JSON at X.",
195
+ origin: "vendor-docs",
196
+ },
197
+ json_group_array: { docUrl: "https://sqlite.org/json1.html", origin: "vendor-docs" },
198
+ json_group_object: { docUrl: "https://sqlite.org/json1.html", origin: "vendor-docs" },
199
+ json_patch: {
200
+ docUrl: "https://sqlite.org/json1.html#the_json_patch_function",
201
+ description: "The json_patch(T,P) SQL function runs the RFC-7396 MergePatch algorithm to apply patch P against input T.",
202
+ origin: "vendor-docs",
203
+ },
204
+ json_quote: {
205
+ docUrl: "https://sqlite.org/json1.html#the_json_quote_function",
206
+ description: "The json_quote(X) function converts the SQL value X (a number or a string) into its corresponding JSON representation.",
207
+ origin: "vendor-docs",
208
+ },
209
+ json_remove: {
210
+ docUrl: "https://sqlite.org/json1.html#the_json_remove_function",
211
+ description: "The json_remove(X,P,...) function takes a single JSON value as its first argument followed by zero or more path arguments.",
212
+ origin: "vendor-docs",
213
+ },
214
+ json_tree: {
215
+ docUrl: "https://sqlite.org/json1.html#table_valued_functions_for_parsing_json_json_each_jsonb_each_json_tree_and_jsonb_tree_",
216
+ description: "The json_each(X), jsonb_each(X), json_tree(X), and jsonb_tree(X) table-valued functions all walk the JSON value provided as their first argument and return one row for each element.",
217
+ origin: "vendor-docs",
218
+ },
219
+ json_type: {
220
+ docUrl: "https://sqlite.org/json1.html#the_json_type_function",
221
+ description: 'The json_type(X) function returns the "type" of the outermost element of X.',
222
+ origin: "vendor-docs",
223
+ },
224
+ json_valid: {
225
+ docUrl: "https://sqlite.org/json1.html#the_json_valid_function",
226
+ description: "The json_valid(X,Y) function returns 1 if the argument X is well-formed JSON, or returns 0 if X is not well-formed.",
227
+ origin: "vendor-docs",
228
+ },
229
+ jsonb: {
230
+ docUrl: "https://sqlite.org/json1.html#the_jsonb_function",
231
+ description: "The jsonb(X) function returns the binary JSONB representation of the JSON provided as argument X.",
232
+ origin: "vendor-docs",
233
+ },
234
+ jsonb_each: {
235
+ docUrl: "https://sqlite.org/json1.html#table_valued_functions_for_parsing_json_json_each_jsonb_each_json_tree_and_jsonb_tree_",
236
+ description: "The json_each(X), jsonb_each(X), json_tree(X), and jsonb_tree(X) table-valued functions all walk the JSON value provided as their first argument and return one row for each element.",
237
+ origin: "vendor-docs",
238
+ },
239
+ jsonb_tree: {
240
+ docUrl: "https://sqlite.org/json1.html#table_valued_functions_for_parsing_json_json_each_jsonb_each_json_tree_and_jsonb_tree_",
241
+ description: "The json_each(X), jsonb_each(X), json_tree(X), and jsonb_tree(X) table-valued functions all walk the JSON value provided as their first argument and return one row for each element.",
242
+ origin: "vendor-docs",
243
+ },
244
+ julianday: {
245
+ docUrl: "https://sqlite.org/lang_datefunc.html",
246
+ description: "The julianday() function returns the Julian day - the fractional number of days since noon in Greenwich on November 24, 4714 B.",
247
+ origin: "vendor-docs",
248
+ },
249
+ lag: {
250
+ docUrl: "https://sqlite.org/windowfunctions.html",
251
+ description: "The first form of the lag() function returns the result of evaluating expression expr against the previous row in the partition.",
252
+ origin: "vendor-docs",
253
+ },
254
+ last_insert_rowid: {
255
+ docUrl: "https://sqlite.org/lang_corefunc.html#last_insert_rowid",
256
+ description: "The last_insert_rowid() function returns the ROWID of the last row insert from the database connection which invoked the function.",
257
+ origin: "vendor-docs",
258
+ },
259
+ last_value: {
260
+ docUrl: "https://sqlite.org/windowfunctions.html",
261
+ description: "This built-in window function calculates the window frame for each row in the same way as an aggregate window function.",
262
+ origin: "vendor-docs",
263
+ },
264
+ lead: {
265
+ docUrl: "https://sqlite.org/windowfunctions.html",
266
+ description: "The first form of the lead() function returns the result of evaluating expression expr against the next row in the partition.",
267
+ origin: "vendor-docs",
268
+ },
269
+ length: {
270
+ docUrl: "https://sqlite.org/lang_corefunc.html#length",
271
+ description: "For a string value X, the length(X) function returns the number of Unicode code points (not bytes) in input string X prior to the first U+0000 character.",
272
+ origin: "vendor-docs",
273
+ },
274
+ like: {
275
+ docUrl: "https://sqlite.org/lang_corefunc.html#like",
276
+ description: 'The like() function is used to implement the " Y LIKE X [ESCAPE Z] " expression.',
277
+ origin: "vendor-docs",
278
+ },
279
+ likelihood: {
280
+ docUrl: "https://sqlite.org/lang_corefunc.html#likelihood",
281
+ description: "The likelihood(X,Y) function returns argument X unchanged.",
282
+ origin: "vendor-docs",
283
+ },
284
+ likely: {
285
+ docUrl: "https://sqlite.org/lang_corefunc.html#likely",
286
+ description: "The likely(X) function returns the argument X unchanged.",
287
+ origin: "vendor-docs",
288
+ },
289
+ ln: {
290
+ docUrl: "https://sqlite.org/lang_mathfunc.html#ln",
291
+ description: "Return the natural logarithm of X.",
292
+ origin: "vendor-docs",
293
+ },
294
+ load_extension: {
295
+ docUrl: "https://sqlite.org/lang_corefunc.html#load_extension",
296
+ description: "The load_extension(X,Y) function loads SQLite extensions out of the shared library file named X using the entry point Y.",
297
+ origin: "vendor-docs",
298
+ },
299
+ log: {
300
+ docUrl: "https://sqlite.org/lang_mathfunc.html#log",
301
+ description: "Return the base-10 logarithm for X.",
302
+ origin: "vendor-docs",
303
+ },
304
+ log10: {
305
+ docUrl: "https://sqlite.org/lang_mathfunc.html#log",
306
+ description: "Return the base-10 logarithm for X.",
307
+ origin: "vendor-docs",
308
+ },
309
+ log2: {
310
+ docUrl: "https://sqlite.org/lang_mathfunc.html#log2",
311
+ description: "Return the logarithm base-2 for the number X.",
312
+ origin: "vendor-docs",
313
+ },
314
+ lower: {
315
+ docUrl: "https://sqlite.org/lang_corefunc.html#lower",
316
+ description: "The lower(X) function returns a copy of string X with all ASCII characters converted to lower case.",
317
+ origin: "vendor-docs",
318
+ },
319
+ ltrim: {
320
+ docUrl: "https://sqlite.org/lang_corefunc.html#ltrim",
321
+ description: "The ltrim(X,Y) function returns a string formed by removing any and all characters that appear in Y from the left side of X.",
322
+ origin: "vendor-docs",
323
+ },
324
+ max: {
325
+ docUrl: "https://sqlite.org/lang_corefunc.html#max_scalar",
326
+ description: "The multi-argument max() function returns the argument with the maximum value, or return NULL if any argument is NULL.",
327
+ origin: "vendor-docs",
328
+ },
329
+ median: {
330
+ docUrl: "https://sqlite.org/lang_aggfunc.html#median",
331
+ description: "The median() function returns the median value of all non-NULL X within a group.",
332
+ origin: "vendor-docs",
333
+ },
334
+ min: {
335
+ docUrl: "https://sqlite.org/lang_corefunc.html#min_scalar",
336
+ description: "The multi-argument min() function returns the argument with the minimum value.",
337
+ origin: "vendor-docs",
338
+ },
339
+ mod: {
340
+ docUrl: "https://sqlite.org/lang_mathfunc.html#mod",
341
+ description: "Return the remainder after dividing X by Y.",
342
+ origin: "vendor-docs",
343
+ },
344
+ nth_value: {
345
+ docUrl: "https://sqlite.org/windowfunctions.html",
346
+ description: "This built-in window function calculates the window frame for each row in the same way as an aggregate window function.",
347
+ origin: "vendor-docs",
348
+ },
349
+ ntile: {
350
+ docUrl: "https://sqlite.org/windowfunctions.html",
351
+ description: "Argument N is handled as an integer.",
352
+ origin: "vendor-docs",
353
+ },
354
+ nullif: {
355
+ docUrl: "https://sqlite.org/lang_corefunc.html#nullif",
356
+ description: "The nullif(X,Y) function returns its first argument if the arguments are different and NULL if the arguments are the same.",
357
+ origin: "vendor-docs",
358
+ },
359
+ octet_length: {
360
+ docUrl: "https://sqlite.org/lang_corefunc.html#octet_length",
361
+ description: "The octet_length(X) function returns the number of bytes in the encoding of text string X.",
362
+ origin: "vendor-docs",
363
+ },
364
+ percent_rank: {
365
+ docUrl: "https://sqlite.org/windowfunctions.html",
366
+ description: "Despite the name, this function always returns a value between 0.0 and 1.0 equal to ( rank - 1)/( partition-rows - 1), where rank is the value returned by built-in window function rank() and partition-rows is the total number of rows in the partition.",
367
+ origin: "vendor-docs",
368
+ },
369
+ percentile: {
370
+ docUrl: "https://sqlite.org/lang_aggfunc.html#percentile",
371
+ description: "The percentile(Y,P) aggregate function computes an answer X which is a value that is greater than or equal to P percent of the non-NULL inputs and which is less than or equal to 100-P percent of the inputs.",
372
+ origin: "vendor-docs",
373
+ },
374
+ percentile_cont: {
375
+ docUrl: "https://sqlite.org/lang_aggfunc.html#percentile_cont",
376
+ description: "The percentile(Y,P) aggregate function computes an answer X which is a value that is greater than or equal to fraction P of the non-NULL inputs and which is less than or equal to fraction 1.0-P of the inputs.",
377
+ origin: "vendor-docs",
378
+ },
379
+ percentile_disc: {
380
+ docUrl: "https://sqlite.org/lang_aggfunc.html#percentile_disc",
381
+ description: "The percentile_disc(Y,P) function works like percentile_cont(Y,P) except that instead of doing a weighted average of the closest available inputs, it always returns a value that is one of the input values - the smaller of the two possible choices.",
382
+ origin: "vendor-docs",
383
+ },
384
+ pi: {
385
+ docUrl: "https://sqlite.org/lang_mathfunc.html#pi",
386
+ description: "Return an approximation for &pi;.",
387
+ origin: "vendor-docs",
388
+ },
389
+ pow: {
390
+ docUrl: "https://sqlite.org/lang_mathfunc.html#pow",
391
+ description: "Compute X raised to the power Y.",
392
+ origin: "vendor-docs",
393
+ },
394
+ power: {
395
+ docUrl: "https://sqlite.org/lang_mathfunc.html#pow",
396
+ description: "Compute X raised to the power Y.",
397
+ origin: "vendor-docs",
398
+ },
399
+ printf: {
400
+ docUrl: "https://sqlite.org/lang_corefunc.html#printf",
401
+ description: "The printf() SQL function is an alias for the format() SQL function.",
402
+ origin: "vendor-docs",
403
+ },
404
+ quote: {
405
+ docUrl: "https://sqlite.org/lang_corefunc.html#quote",
406
+ description: "The quote(X) function returns the text of an SQL literal which is the value of its argument suitable for inclusion into an SQL statement.",
407
+ origin: "vendor-docs",
408
+ },
409
+ radians: {
410
+ docUrl: "https://sqlite.org/lang_mathfunc.html#radians",
411
+ description: "Convert X from degrees into radians.",
412
+ origin: "vendor-docs",
413
+ },
414
+ random: {
415
+ docUrl: "https://sqlite.org/lang_corefunc.html#random",
416
+ description: "The random() function returns a pseudo-random integer between -9223372036854775807 and +9223372036854775807.",
417
+ origin: "vendor-docs",
418
+ },
419
+ randomblob: {
420
+ docUrl: "https://sqlite.org/lang_corefunc.html#randomblob",
421
+ description: "The randomblob(N) function return an N-byte blob containing pseudo-random bytes.",
422
+ origin: "vendor-docs",
423
+ },
424
+ rank: {
425
+ docUrl: "https://sqlite.org/windowfunctions.html",
426
+ description: "The row_number() of the first peer in each group - the rank of the current row with gaps.",
427
+ origin: "vendor-docs",
428
+ },
429
+ replace: {
430
+ docUrl: "https://sqlite.org/lang_corefunc.html#replace",
431
+ description: "The replace(X,Y,Z) function returns a string formed by substituting string Z for every occurrence of string Y in string X.",
432
+ origin: "vendor-docs",
433
+ },
434
+ round: {
435
+ docUrl: "https://sqlite.org/lang_corefunc.html#round",
436
+ description: "The round(X,Y) function returns a floating-point value X rounded to Y digits to the right of the decimal point.",
437
+ origin: "vendor-docs",
438
+ },
439
+ row_number: {
440
+ docUrl: "https://sqlite.org/windowfunctions.html",
441
+ description: "The number of the row within the current partition.",
442
+ origin: "vendor-docs",
443
+ },
444
+ rtrim: {
445
+ docUrl: "https://sqlite.org/lang_corefunc.html#rtrim",
446
+ description: "The rtrim(X,Y) function returns a string formed by removing any and all characters that appear in Y from the right side of X.",
447
+ origin: "vendor-docs",
448
+ },
449
+ sign: {
450
+ docUrl: "https://sqlite.org/lang_corefunc.html#sign",
451
+ description: "The sign(X) function returns -1, 0, or +1 if the argument X is a numeric value that is negative, zero, or positive, respectively.",
452
+ origin: "vendor-docs",
453
+ },
454
+ sin: {
455
+ docUrl: "https://sqlite.org/lang_mathfunc.html#sin",
456
+ description: "Return the sine of X.",
457
+ origin: "vendor-docs",
458
+ },
459
+ sinh: {
460
+ docUrl: "https://sqlite.org/lang_mathfunc.html#sinh",
461
+ description: "Return the hyperbolic sine of X.",
462
+ origin: "vendor-docs",
463
+ },
464
+ soundex: {
465
+ docUrl: "https://sqlite.org/lang_corefunc.html#soundex",
466
+ description: "The soundex(X) function returns a string that is the soundex encoding of the string X.",
467
+ origin: "vendor-docs",
468
+ },
469
+ sqlite_compileoption_get: {
470
+ docUrl: "https://sqlite.org/lang_corefunc.html#sqlite_compileoption_get",
471
+ description: "The sqlite_compileoption_get() SQL function is a wrapper around the sqlite3_compileoption_get() C/C++ function.",
472
+ origin: "vendor-docs",
473
+ },
474
+ sqlite_compileoption_used: {
475
+ docUrl: "https://sqlite.org/lang_corefunc.html#sqlite_compileoption_used",
476
+ description: "The sqlite_compileoption_used() SQL function is a wrapper around the sqlite3_compileoption_used() C/C++ function.",
477
+ origin: "vendor-docs",
478
+ },
479
+ sqlite_offset: {
480
+ docUrl: "https://sqlite.org/lang_corefunc.html#sqlite_offset",
481
+ description: "The sqlite_offset(X) function returns the byte offset in the database file for the beginning of the record from which value would be read.",
482
+ origin: "vendor-docs",
483
+ },
484
+ sqlite_source_id: {
485
+ docUrl: "https://sqlite.org/lang_corefunc.html#sqlite_source_id",
486
+ description: "The sqlite_source_id() function returns a string that identifies the specific version of the source code that was used to build the SQLite library.",
487
+ origin: "vendor-docs",
488
+ },
489
+ sqlite_version: {
490
+ docUrl: "https://sqlite.org/lang_corefunc.html#sqlite_version",
491
+ description: "The sqlite_version() function returns the version string for the SQLite library that is running.",
492
+ origin: "vendor-docs",
493
+ },
494
+ sqrt: {
495
+ docUrl: "https://sqlite.org/lang_mathfunc.html#sqrt",
496
+ description: "Return the square root of X.",
497
+ origin: "vendor-docs",
498
+ },
499
+ strftime: {
500
+ docUrl: "https://sqlite.org/lang_datefunc.html",
501
+ description: "The strftime() function returns the date formatted according to the format string specified as the first argument.",
502
+ origin: "vendor-docs",
503
+ },
504
+ string_agg: {
505
+ docUrl: "https://sqlite.org/lang_aggfunc.html#group_concat",
506
+ description: "The group_concat() function returns a string which is the concatenation of all non-NULL values of X.",
507
+ origin: "vendor-docs",
508
+ },
509
+ substr: {
510
+ docUrl: "https://sqlite.org/lang_corefunc.html#substr",
511
+ description: "The substr(X,Y,Z) function returns a substring of input string X that begins with the Y-th character and which is Z characters long.",
512
+ origin: "vendor-docs",
513
+ },
514
+ substring: {
515
+ docUrl: "https://sqlite.org/lang_corefunc.html#substr",
516
+ description: "The substr(X,Y,Z) function returns a substring of input string X that begins with the Y-th character and which is Z characters long.",
517
+ origin: "vendor-docs",
518
+ },
519
+ sum: {
520
+ docUrl: "https://sqlite.org/lang_aggfunc.html#sumunc",
521
+ description: "The sum() and total() aggregate functions return the sum of all non-NULL values in the group.",
522
+ origin: "vendor-docs",
523
+ },
524
+ tan: {
525
+ docUrl: "https://sqlite.org/lang_mathfunc.html#tan",
526
+ description: "Return the tangent of X.",
527
+ origin: "vendor-docs",
528
+ },
529
+ tanh: {
530
+ docUrl: "https://sqlite.org/lang_mathfunc.html#tanh",
531
+ description: "Return the hyperbolic tangent of X.",
532
+ origin: "vendor-docs",
533
+ },
534
+ time: {
535
+ docUrl: "https://sqlite.org/lang_datefunc.html",
536
+ description: "The time() function returns the time as text in formatted as HH:MM:SS or as HH:MM:SS.",
537
+ origin: "vendor-docs",
538
+ },
539
+ timediff: {
540
+ docUrl: "https://sqlite.org/lang_datefunc.html",
541
+ description: "The timediff(A,B) function returns a string that describes the amount of time that must be added to B in order to reach time A.",
542
+ origin: "vendor-docs",
543
+ },
544
+ total: {
545
+ docUrl: "https://sqlite.org/lang_aggfunc.html#sumunc",
546
+ description: "The sum() and total() aggregate functions return the sum of all non-NULL values in the group.",
547
+ origin: "vendor-docs",
548
+ },
549
+ total_changes: {
550
+ docUrl: "https://sqlite.org/lang_corefunc.html#total_changes",
551
+ description: "The total_changes() function returns the number of row changes caused by INSERT, UPDATE or DELETE statements since the current database connection was opened.",
552
+ origin: "vendor-docs",
553
+ },
554
+ trim: {
555
+ docUrl: "https://sqlite.org/lang_corefunc.html#trim",
556
+ description: "The trim(X,Y) function returns a string formed by removing any and all characters that appear in Y from both ends of X.",
557
+ origin: "vendor-docs",
558
+ },
559
+ trunc: {
560
+ docUrl: "https://sqlite.org/lang_mathfunc.html#trunc",
561
+ description: "Return the representable integer in between X and 0 (inclusive) that is furthest away from zero.",
562
+ origin: "vendor-docs",
563
+ },
564
+ typeof: {
565
+ docUrl: "https://sqlite.org/lang_corefunc.html#typeof",
566
+ description: 'The typeof(X) function returns a string that indicates the datatype of the expression X: "null", "integer", "real", "text", or "blob".',
567
+ origin: "vendor-docs",
568
+ },
569
+ unhex: {
570
+ docUrl: "https://sqlite.org/lang_corefunc.html#unhex",
571
+ description: "The unhex(X,Y) function returns a BLOB value which is the decoding of the hexadecimal string X.",
572
+ origin: "vendor-docs",
573
+ },
574
+ unicode: {
575
+ docUrl: "https://sqlite.org/lang_corefunc.html#unicode",
576
+ description: "The unicode(X) function returns the numeric unicode code point corresponding to the first character of the string X.",
577
+ origin: "vendor-docs",
578
+ },
579
+ unistr: {
580
+ docUrl: "https://sqlite.org/lang_corefunc.html#unistr",
581
+ description: "The unistr(X) function interprets backslash escapes in input string X and returns a new string with those escapes converted into the actual Unicode codepoints that they represent.",
582
+ origin: "vendor-docs",
583
+ },
584
+ unistr_quote: {
585
+ docUrl: "https://sqlite.org/lang_corefunc.html#unistr_quote",
586
+ description: "The unistr_quote(X) function returns the text of an SQL literal or constant expression that encodes the value of its argument X and is suitable for inclusion into an SQL statement.",
587
+ origin: "vendor-docs",
588
+ },
589
+ unixepoch: {
590
+ docUrl: "https://sqlite.org/lang_datefunc.html",
591
+ description: "The unixepoch() function returns a unix timestamp - the number of seconds since 1970-01-01 00:00:00 UTC.",
592
+ origin: "vendor-docs",
593
+ },
594
+ unlikely: {
595
+ docUrl: "https://sqlite.org/lang_corefunc.html#unlikely",
596
+ description: "The unlikely(X) function returns the argument X unchanged.",
597
+ origin: "vendor-docs",
598
+ },
599
+ upper: {
600
+ docUrl: "https://sqlite.org/lang_corefunc.html#upper",
601
+ description: "The upper(X) function returns a copy of input string X in which all lower-case ASCII characters are converted to their upper-case equivalent.",
602
+ origin: "vendor-docs",
603
+ },
604
+ zeroblob: {
605
+ docUrl: "https://sqlite.org/lang_corefunc.html#zeroblob",
606
+ description: "The zeroblob(N) function returns a BLOB consisting of N bytes of 0x00.",
607
+ origin: "vendor-docs",
608
+ },
609
+ };
@@ -10,11 +10,9 @@
10
10
  // (sqlite3StrICmp) is ASCII case-insensitive regardless of how the name was spelled — the
11
11
  // documented quirk this module's brief calls out: unlike Postgres/Snowflake, quoting an
12
12
  // identifier does NOT make it case-sensitive in SQLite. So both unquoted AND quoted fold to
13
- // lower here (same shape as redshift/duckdb/trino). SQLite's own documented fold is
14
- // ASCII-only (it does not case-fold non-ASCII), but this module's shared applyCase uses JS
15
- // toLowerCase() — a Unicode-wide fold — so a rare non-ASCII identifier pair (Ä vs ä) that
16
- // SQLite would keep distinct conflates here: a known shared-engine limitation, consistent
17
- // across every dialect in this table. Bracket delimiters have no escape mechanism (the
13
+ // lower here (same shape as redshift/duckdb). SQLite's fold is ASCII-only (sqlite3StrICmp
14
+ // case-folds A-Z and nothing else), so the rule uses the engine's ascii-lower mode: `Ä` and
15
+ // `ä` stay distinct identifiers while `A`/`a` conflate (#22). Bracket delimiters have no escape mechanism (the
18
16
  // lexer's `[`...`]` body is `~']'*` — no doubling), so a doubled `]]` inside `[...]` is not
19
17
  // unescaped, same as this module's tsql bracket handling.
20
18
  import { displayWith, foldWith } from "../ident/fold.js";
@@ -22,8 +20,8 @@ const DOUBLE_QUOTE = ['"', '"'];
22
20
  const BACKTICK = ["`", "`"];
23
21
  export const SQLITE_FOLD_RULE = {
24
22
  delimiters: [DOUBLE_QUOTE, BACKTICK, ["[", "]"]],
25
- unquoted: "lower",
26
- quoted: "lower",
23
+ unquoted: "ascii-lower",
24
+ quoted: "ascii-lower",
27
25
  };
28
26
  /** Fold an identifier to its SQLite identity key. */
29
27
  export function fold(raw, kind = "other") {
@@ -0,0 +1,2 @@
1
+ import type { FnDoc } from "../signature/docs.js";
2
+ export declare const TRINO_FN_DOCS: Record<string, FnDoc>;