alasql 4.21.0 → 4.22.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.
@@ -1,7 +1,7 @@
1
- //! AlaSQL v4.21.0 build: develop-38bf3c39 | © 2014-2025 Andrey Gershun & Mathias Wulff | License: MIT
1
+ //! AlaSQL v4.22.0 build: develop-8a890816 | © 2014-2025 Andrey Gershun & Mathias Wulff | License: MIT
2
2
  /*
3
3
  @module alasql
4
- @version 4.21.0
4
+ @version 4.22.0
5
5
 
6
6
  AlaSQL - JavaScript SQL database
7
7
  © 2014-2025 Andrey Gershun & Mathias Wulff
package/dist/alasql.d.ts CHANGED
@@ -8,6 +8,11 @@ declare module 'alasql' {
8
8
  (err: Error | null, data?: T): void;
9
9
  }
10
10
 
11
+ // Callback of a compiled statement: data first, then the error (data is null when err is set)
12
+ export interface AlaSQLStatementCallback<T = unknown> {
13
+ (data: T | null, err?: Error): void;
14
+ }
15
+
11
16
  export interface AlaSQLOptions {
12
17
  errorlog: boolean;
13
18
  valueof: boolean;
@@ -39,8 +44,10 @@ declare module 'alasql' {
39
44
  <T = unknown>(params?: any, cb?: AlaSQLCallback<T>, scope?: unknown): T;
40
45
  }
41
46
 
42
- // returned by alasql.compile(): a compiled statement with a promise helper
43
- export interface AlaSQLCompiledStatement extends AlaSQLStatement {
47
+ // returned by alasql.compile(): a compiled statement with a promise helper. Only this one takes
48
+ // the data-first callback, so the older Statement.compile() types stay as they were in 4.x
49
+ export interface AlaSQLCompiledStatement {
50
+ <T = unknown>(params?: any, cb?: AlaSQLStatementCallback<T>, scope?: unknown): T;
44
51
  promise<T = unknown>(params?: any): Promise<T>;
45
52
  }
46
53
 
@@ -57,12 +64,19 @@ declare module 'alasql' {
57
64
  export interface Op extends AlaSQLExpression {
58
65
  left: ExpressionNode;
59
66
  op: string;
60
- // `->` with a bare property name (`a->b`, `tx.a.b`) puts the name as a string
61
- right?: ExpressionNode | string;
67
+ right?: ExpressionNode;
62
68
  right1?: ExpressionNode;
63
69
  right2?: ExpressionNode;
64
70
  }
65
71
 
72
+ // Not in the ExpressionNode union, so code that walks the tree compiles as it did before 4.21.0
73
+ export interface ArrowOp extends AlaSQLExpression {
74
+ left: ExpressionNode;
75
+ op: '->';
76
+ // a bare property name (`a->b`, `tx.a.b`) puts the name as a string
77
+ right: ExpressionNode | string;
78
+ }
79
+
66
80
  export interface Column extends AlaSQLExpression {
67
81
  columnid: string;
68
82
  tableid?: string;