squirreling 0.10.2 → 0.11.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/src/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { AsyncDataSource, AsyncRow, ExecuteContext, ExecuteSqlOptions, ExprNode, ParseSqlOptions, PlanSqlOptions, QueryPlan, SelectStatement, SqlPrimitive, Token } from './types.js'
1
+ import type { AsyncDataSource, AsyncRow, SetOperationStatement, ExecuteContext, ExecuteSqlOptions, ExprNode, ParseSqlOptions, PlanSqlOptions, QueryPlan, SelectStatement, SqlPrimitive, Statement, Token } from './types.js'
2
2
  export type {
3
3
  AsyncCells,
4
4
  AsyncDataSource,
@@ -12,9 +12,12 @@ export type {
12
12
  ScanOptions,
13
13
  ScanResults,
14
14
  SelectStatement,
15
+ SetOperationStatement,
15
16
  SqlPrimitive,
17
+ Statement,
16
18
  Token,
17
19
  UserDefinedFunction,
20
+ WithStatement,
18
21
  } from './types.js'
19
22
 
20
23
  /**
@@ -45,9 +48,9 @@ export function executePlan(options: { plan: QueryPlan, context: ExecuteContext
45
48
  * @param options
46
49
  * @param options.query - SQL query string to parse
47
50
  * @param options.functions - user-defined functions available in the SQL context
48
- * @returns parsed SQL select statement
51
+ * @returns parsed SQL statement
49
52
  */
50
- export function parseSql(options: ParseSqlOptions): SelectStatement
53
+ export function parseSql(options: ParseSqlOptions): Statement
51
54
 
52
55
  /**
53
56
  * Builds a query plan from a SQL query string or AST
@@ -63,10 +66,10 @@ export function planSql(options: PlanSqlOptions): QueryPlan
63
66
  /**
64
67
  * Tokenizes a SQL query string into an array of tokens
65
68
  *
66
- * @param sql - SQL query string to tokenize
69
+ * @param query - SQL query string to tokenize
67
70
  * @returns array of tokens
68
71
  */
69
- export function tokenizeSql(sql: string): Token[]
72
+ export function tokenizeSql(query: string): Token[]
70
73
 
71
74
  /**
72
75
  * Collects all results from an async generator into an array
@@ -76,6 +79,8 @@ export function tokenizeSql(sql: string): Token[]
76
79
  */
77
80
  export function collect<T>(asyncGen: AsyncGenerator<AsyncRow>): Promise<Record<string, SqlPrimitive>[]>
78
81
 
82
+ export function asyncRow(row: Record<string, SqlPrimitive>, columns: string[]): AsyncRow
83
+
79
84
  export function cachedDataSource(source: AsyncDataSource): AsyncDataSource
80
85
 
81
86
  /**
package/src/index.js CHANGED
@@ -3,5 +3,5 @@ export { parseSql } from './parse/parse.js'
3
3
  export { planSql } from './plan/plan.js'
4
4
  export { tokenizeSql } from './parse/tokenize.js'
5
5
  export { collect } from './execute/utils.js'
6
- export { cachedDataSource } from './backend/dataSource.js'
6
+ export { asyncRow, cachedDataSource } from './backend/dataSource.js'
7
7
  export { derivedAlias } from './expression/alias.js'