@loaders.gl/sql 5.0.0-beta.1 → 5.0.0-beta.11
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/README.md +7 -3
- package/dist/arrow-table-source.d.ts +5 -5
- package/dist/arrow-table-source.d.ts.map +1 -1
- package/dist/arrow-table-source.js +10 -6
- package/dist/arrow-table-source.js.map +1 -1
- package/dist/duckdb-sql-source.d.ts +21 -26
- package/dist/duckdb-sql-source.d.ts.map +1 -1
- package/dist/duckdb-sql-source.js +24 -4
- package/dist/duckdb-sql-source.js.map +1 -1
- package/dist/duckdb-table-query.d.ts +9 -0
- package/dist/duckdb-table-query.d.ts.map +1 -0
- package/dist/duckdb-table-query.js +233 -0
- package/dist/duckdb-table-query.js.map +1 -0
- package/dist/index.cjs +1480 -1204
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/snowflake-sql-source.d.ts +6 -23
- package/dist/snowflake-sql-source.d.ts.map +1 -1
- package/dist/snowflake-sql-source.js +2 -2
- package/dist/snowflake-sql-source.js.map +1 -1
- package/dist/sql-source.d.ts +17 -4
- package/dist/sql-source.d.ts.map +1 -1
- package/dist/sql-source.js +33 -1
- package/dist/sql-source.js.map +1 -1
- package/dist/sql-types.d.ts +3 -2
- package/dist/sql-types.d.ts.map +1 -1
- package/package.json +5 -4
- package/src/arrow-table-source.ts +12 -11
- package/src/duckdb-sql-source.ts +40 -7
- package/src/duckdb-table-query.ts +271 -0
- package/src/index.ts +3 -0
- package/src/snowflake-sql-source.ts +1 -1
- package/src/sql-source.ts +43 -4
- package/src/sql-types.ts +3 -2
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import {RecordBatch, Struct, Table, makeData, vectorFromArray} from 'apache-arrow';
|
|
6
|
+
import {
|
|
7
|
+
createQueryMetadata,
|
|
8
|
+
executeTableScanBatches,
|
|
9
|
+
validateTableQueryLimit,
|
|
10
|
+
type TableQuerySource,
|
|
11
|
+
type TableQueryPushdownRequest,
|
|
12
|
+
type TableQueryReadOptions
|
|
13
|
+
} from '@loaders.gl/core/loader-utils';
|
|
14
|
+
import {filterArrowTable} from '@loaders.gl/core/query/arrow-execution';
|
|
15
|
+
import type {Field, Schema} from '@loaders.gl/core/schema';
|
|
16
|
+
import {convertSchemaToArrow, makeArrowMetadataBatch} from '@loaders.gl/core/schema-utils';
|
|
17
|
+
import type {DuckDBSQLDataSource} from './duckdb-sql-source';
|
|
18
|
+
import type {SQLTableInfo} from './sql-types';
|
|
19
|
+
import {getQualifiedTableName, quoteSqlIdentifier} from './sql-utils';
|
|
20
|
+
|
|
21
|
+
/** Maps supported DuckDB scalars to their exact Arrow storage types. */
|
|
22
|
+
const SCALAR_TYPES: Readonly<Record<string, Field['type']>> = {
|
|
23
|
+
TINYINT: 'int8',
|
|
24
|
+
SMALLINT: 'int16',
|
|
25
|
+
INTEGER: 'int32',
|
|
26
|
+
BIGINT: 'int64',
|
|
27
|
+
FLOAT: 'float32',
|
|
28
|
+
REAL: 'float32',
|
|
29
|
+
DOUBLE: 'float64',
|
|
30
|
+
BOOLEAN: 'bool',
|
|
31
|
+
VARCHAR: 'utf8'
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** Signed integer widths and corresponding DuckDB CAST targets. */
|
|
35
|
+
const INTEGER_TYPES = {int8: 'TINYINT', int16: 'SMALLINT', int32: 'INTEGER', int64: 'BIGINT'};
|
|
36
|
+
|
|
37
|
+
/** Returns the SQL type of a signed integer field when it is eligible for exact casts. */
|
|
38
|
+
function getIntegerType(type: Field['type']): string | undefined {
|
|
39
|
+
return typeof type === 'string' && Object.hasOwn(INTEGER_TYPES, type)
|
|
40
|
+
? INTEGER_TYPES[type as keyof typeof INTEGER_TYPES]
|
|
41
|
+
: undefined;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Reports whether all fields have exact Arrow storage representations. */
|
|
45
|
+
export function isDuckDBQuerySchema(schema: Schema): boolean {
|
|
46
|
+
return (
|
|
47
|
+
schema.fields.length > 0 &&
|
|
48
|
+
schema.fields.every(field => Object.hasOwn(SCALAR_TYPES, field.metadata?.sqlType || ''))
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Creates a reusable table handle with a schema snapshot and a lazy row reader. */
|
|
53
|
+
export function makeDuckDBTableQuerySource(
|
|
54
|
+
source: DuckDBSQLDataSource,
|
|
55
|
+
table: SQLTableInfo,
|
|
56
|
+
sourceSchema: Schema
|
|
57
|
+
): TableQuerySource {
|
|
58
|
+
if (!isDuckDBQuerySchema(sourceSchema))
|
|
59
|
+
throw new Error('Unsupported DuckDB table schema for the common query API');
|
|
60
|
+
const schema = {
|
|
61
|
+
...sourceSchema,
|
|
62
|
+
fields: sourceSchema.fields.map(field => {
|
|
63
|
+
const type = SCALAR_TYPES[field.metadata?.sqlType || ''];
|
|
64
|
+
if (!type) throw new Error(`Unsupported DuckDB query field type: ${field.metadata?.sqlType}`);
|
|
65
|
+
return {...field, type};
|
|
66
|
+
})
|
|
67
|
+
};
|
|
68
|
+
const tableName = `${getQualifiedTableName(table)} AS query_input`;
|
|
69
|
+
const ordered =
|
|
70
|
+
table.tableType === 'BASE TABLE' &&
|
|
71
|
+
!schema.fields.some(field => field.name.toLowerCase() === 'rowid');
|
|
72
|
+
const order = ordered ? ' ORDER BY query_input.rowid' : '';
|
|
73
|
+
const metadata = createQueryMetadata({
|
|
74
|
+
sourceType: 'duckdb-table',
|
|
75
|
+
queryType: 'table',
|
|
76
|
+
execution: {status: 'supported', method: 'read'},
|
|
77
|
+
schema,
|
|
78
|
+
queryCapabilities: {
|
|
79
|
+
table: {
|
|
80
|
+
projection: 'pushdown',
|
|
81
|
+
predicate: 'pushdown+residual',
|
|
82
|
+
cast: 'pushdown',
|
|
83
|
+
offset: ordered ? 'pushdown' : 'residual',
|
|
84
|
+
limit: ordered ? 'pushdown' : 'residual',
|
|
85
|
+
streaming: false,
|
|
86
|
+
cancellation: false
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
/** Reads typed rows without relying on inference for BIGINT, null-only, or empty columns. */
|
|
92
|
+
async function* readStatement(sql: string, outputSchema: Schema, signal?: AbortSignal) {
|
|
93
|
+
signal?.throwIfAborted();
|
|
94
|
+
const rows = await source.queryRows(sql, {signal});
|
|
95
|
+
signal?.throwIfAborted();
|
|
96
|
+
const arrowSchema = convertSchemaToArrow(outputSchema);
|
|
97
|
+
const vectors = arrowSchema.fields.map((field, index) =>
|
|
98
|
+
vectorFromArray(
|
|
99
|
+
rows.map(row => {
|
|
100
|
+
const value = row[field.name];
|
|
101
|
+
if (value == null) return null;
|
|
102
|
+
const type = outputSchema.fields[index].type;
|
|
103
|
+
if (type === 'int64') return BigInt(value as string | bigint);
|
|
104
|
+
if (type === 'float32' || type === 'float64') return Number(value);
|
|
105
|
+
return value;
|
|
106
|
+
}),
|
|
107
|
+
field.type
|
|
108
|
+
)
|
|
109
|
+
);
|
|
110
|
+
yield new RecordBatch(
|
|
111
|
+
arrowSchema,
|
|
112
|
+
makeData({
|
|
113
|
+
type: new Struct(arrowSchema.fields),
|
|
114
|
+
length: rows.length,
|
|
115
|
+
children: vectors.map(vector => vector.data[0])
|
|
116
|
+
})
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** Compiles the exact subset without evaluating data or changing the connection. */
|
|
121
|
+
function plan(
|
|
122
|
+
query: Omit<TableQueryPushdownRequest, 'where'> & {
|
|
123
|
+
where?: TableQueryPushdownRequest['where'] | TableQueryReadOptions['predicate'];
|
|
124
|
+
}
|
|
125
|
+
) {
|
|
126
|
+
validateTableQueryLimit(query.limit);
|
|
127
|
+
if (query.offset !== undefined && (!Number.isSafeInteger(query.offset) || query.offset < 0)) {
|
|
128
|
+
throw new Error('DuckDB query offset must be a non-negative safe integer.');
|
|
129
|
+
}
|
|
130
|
+
const selections = query.select ?? schema.fields.map(field => field.name);
|
|
131
|
+
const columns: string[] = [];
|
|
132
|
+
const fields: Field[] = [];
|
|
133
|
+
for (const [index, selection] of selections.entries()) {
|
|
134
|
+
const expression =
|
|
135
|
+
typeof selection !== 'string' && 'expression' in selection
|
|
136
|
+
? selection.expression
|
|
137
|
+
: undefined;
|
|
138
|
+
if (typeof selection !== 'string' && 'array' in selection) return null;
|
|
139
|
+
const cast =
|
|
140
|
+
expression?.type === 'CallExpression' &&
|
|
141
|
+
expression.callee.type === 'Identifier' &&
|
|
142
|
+
expression.callee.name === 'cast'
|
|
143
|
+
? expression.arguments
|
|
144
|
+
: undefined;
|
|
145
|
+
const column =
|
|
146
|
+
typeof selection === 'string'
|
|
147
|
+
? selection
|
|
148
|
+
: 'column' in selection
|
|
149
|
+
? selection.column
|
|
150
|
+
: cast?.[0]?.type === 'Identifier'
|
|
151
|
+
? cast[0].name
|
|
152
|
+
: undefined;
|
|
153
|
+
const field = schema.fields.find(candidate => candidate.name === column);
|
|
154
|
+
if (!field) return null;
|
|
155
|
+
let sql = quoteSqlIdentifier(field.name);
|
|
156
|
+
const name =
|
|
157
|
+
typeof selection === 'string'
|
|
158
|
+
? selection
|
|
159
|
+
: (selection.as ?? (expression ? `column${index + 1}` : field.name));
|
|
160
|
+
if (expression) {
|
|
161
|
+
if (cast?.length !== 2 || cast[1].type !== 'Literal') return null;
|
|
162
|
+
const target = getExactCast(field, cast[1].value);
|
|
163
|
+
if (!target) return null;
|
|
164
|
+
sql = `CAST(${sql} AS ${target.sqlType})`;
|
|
165
|
+
fields.push({name, type: target.type, nullable: field.nullable});
|
|
166
|
+
} else {
|
|
167
|
+
fields.push({...field, name});
|
|
168
|
+
}
|
|
169
|
+
columns.push(`${sql} AS ${quoteSqlIdentifier(name)}`);
|
|
170
|
+
}
|
|
171
|
+
// DuckDB identifiers are case-insensitive, including quoted aliases.
|
|
172
|
+
if (new Set(fields.map(field => field.name.toLowerCase())).size !== fields.length) return null;
|
|
173
|
+
const predicate = query.where && compilePredicate(query.where, schema);
|
|
174
|
+
if (query.where && !predicate) return null;
|
|
175
|
+
if (!ordered && (query.offset !== undefined || query.limit !== undefined)) return null;
|
|
176
|
+
const sql =
|
|
177
|
+
`SELECT ${columns.join(', ')} FROM ${tableName}` +
|
|
178
|
+
(predicate ? ` WHERE ${predicate}` : '') +
|
|
179
|
+
order +
|
|
180
|
+
(query.limit === undefined ? '' : ` LIMIT ${query.limit}`) +
|
|
181
|
+
(query.offset === undefined ? '' : ` OFFSET ${query.offset}`);
|
|
182
|
+
const outputSchema = {...schema, fields};
|
|
183
|
+
return {
|
|
184
|
+
schema: outputSchema,
|
|
185
|
+
/** Executes the planned SQL when the consumer starts reading. */
|
|
186
|
+
async *read(options?: {signal?: AbortSignal}) {
|
|
187
|
+
yield* readStatement(sql, outputSchema, options?.signal);
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
return {
|
|
193
|
+
/** Returns metadata without issuing another catalog query. */
|
|
194
|
+
async getQueryMetadata() {
|
|
195
|
+
return metadata;
|
|
196
|
+
},
|
|
197
|
+
/** Accepts only exact whole queries. */
|
|
198
|
+
async planQueryPushdown(query, options) {
|
|
199
|
+
options?.signal?.throwIfAborted();
|
|
200
|
+
return plan(query);
|
|
201
|
+
},
|
|
202
|
+
/** Checks the exact CAST subset using the same compiler as whole-query execution. */
|
|
203
|
+
supportsQueryProjectionPushdown(selection) {
|
|
204
|
+
return Boolean(plan({select: [selection]}));
|
|
205
|
+
},
|
|
206
|
+
/** Executes simple reads natively when possible and applies other operators in Arrow. */
|
|
207
|
+
async *read(options = {}) {
|
|
208
|
+
const {columns, predicate, limit, offset, signal} = options;
|
|
209
|
+
const accepted = plan({select: columns, where: predicate, limit, offset});
|
|
210
|
+
if (accepted && limit !== 0) {
|
|
211
|
+
yield* accepted.read({signal});
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
for await (const batch of executeTableScanBatches<Table>(
|
|
215
|
+
async function* (readSignal) {
|
|
216
|
+
for await (const batch of readStatement(
|
|
217
|
+
`SELECT * FROM ${tableName}${order}`,
|
|
218
|
+
schema,
|
|
219
|
+
readSignal
|
|
220
|
+
)) {
|
|
221
|
+
yield new Table(batch.schema, [batch]);
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
options,
|
|
225
|
+
{
|
|
226
|
+
filter: (batch, predicate, filterSignal) => {
|
|
227
|
+
if (!predicate) return batch;
|
|
228
|
+
return filterArrowTable(batch, predicate, {signal: filterSignal});
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
)) {
|
|
232
|
+
yield* batch.batches.length ? batch.batches : [makeArrowMetadataBatch(batch.schema)];
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/** Accepts signed integer identity and widening casts, which cannot round or overflow. */
|
|
239
|
+
function getExactCast(
|
|
240
|
+
field: Field,
|
|
241
|
+
target: unknown
|
|
242
|
+
): {type: Field['type']; sqlType: string} | null {
|
|
243
|
+
if (target === 'float64' && ['int8', 'int16', 'int32'].includes(String(field.type))) {
|
|
244
|
+
return {type: target, sqlType: 'DOUBLE'};
|
|
245
|
+
}
|
|
246
|
+
if (target !== 'int16' && target !== 'int32' && target !== 'int64') return null;
|
|
247
|
+
const sourceType = getIntegerType(field.type);
|
|
248
|
+
if (!sourceType || Number(String(field.type).slice(3)) > Number(target.slice(3))) return null;
|
|
249
|
+
return {type: target, sqlType: INTEGER_TYPES[target]};
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/** Compiles exact integer comparisons, including a single widening cast on the column. */
|
|
253
|
+
function compilePredicate(
|
|
254
|
+
predicate: NonNullable<TableQueryPushdownRequest['where'] | TableQueryReadOptions['predicate']>,
|
|
255
|
+
schema: Schema
|
|
256
|
+
): string | null {
|
|
257
|
+
if (!('op' in predicate) || !['=', '<>', '<', '<=', '>', '>='].includes(predicate.op))
|
|
258
|
+
return null;
|
|
259
|
+
const [property, value] = predicate.args;
|
|
260
|
+
if (!property || typeof property !== 'object' || !('property' in property)) return null;
|
|
261
|
+
const field = schema.fields.find(candidate => candidate.name === property.property);
|
|
262
|
+
if (!field || !getIntegerType(field.type)) return null;
|
|
263
|
+
if (typeof value !== 'bigint' && (typeof value !== 'number' || !Number.isSafeInteger(value)))
|
|
264
|
+
return null;
|
|
265
|
+
if (value < -(2n ** 63n) || value >= 2n ** 63n) return null;
|
|
266
|
+
const column = quoteSqlIdentifier(field.name);
|
|
267
|
+
if (!('casts' in property)) return `${column} ${predicate.op} ${value}`;
|
|
268
|
+
if (!Array.isArray(property.casts) || property.casts.length !== 1) return null;
|
|
269
|
+
const cast = getExactCast(field, property.casts[0]);
|
|
270
|
+
return cast ? `CAST(${column} AS ${cast.sqlType}) ${predicate.op} ${value}` : null;
|
|
271
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -62,7 +62,7 @@ export const SnowflakeSQLSource = {
|
|
|
62
62
|
},
|
|
63
63
|
defaultOptions: SQL_SOURCE_DEFAULT_OPTIONS,
|
|
64
64
|
testURL: (url: string): boolean => /^(sql\+snowflake|snowflake):\/\//i.test(url),
|
|
65
|
-
|
|
65
|
+
createDataSourceSync: (
|
|
66
66
|
data: string,
|
|
67
67
|
options: SQLSourceOptions,
|
|
68
68
|
coreApi?: CoreAPI
|
package/src/sql-source.ts
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {
|
|
5
|
+
import type {Table} from 'apache-arrow';
|
|
6
|
+
import type {Schema} from '@loaders.gl/core/schema';
|
|
6
7
|
import {DataSource} from '@loaders.gl/core/loader-utils';
|
|
7
|
-
import type {CoreAPI, RequiredOptions} from '@loaders.gl/core/loader-utils';
|
|
8
|
+
import type {CoreAPI, RequiredOptions, TableMetadata} from '@loaders.gl/core/loader-utils';
|
|
8
9
|
|
|
9
10
|
import type {
|
|
10
11
|
SQLAdapter,
|
|
@@ -108,6 +109,36 @@ export class SQLDataSource extends DataSource<string, SQLSourceOptions> {
|
|
|
108
109
|
return await adapter.listTables(options);
|
|
109
110
|
}
|
|
110
111
|
|
|
112
|
+
/** Lists stable native table identifiers without fetching any column schemas or data rows. */
|
|
113
|
+
async getTablesMetadata(options: {signal?: AbortSignal} = {}): Promise<readonly TableMetadata[]> {
|
|
114
|
+
options.signal?.throwIfAborted();
|
|
115
|
+
const tables = await this.listTables();
|
|
116
|
+
options.signal?.throwIfAborted();
|
|
117
|
+
return tables.map(table => ({name: getTableMetadataName(table), queryable: false}));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** Discovers one native table schema; ambiguous unqualified names are rejected. */
|
|
121
|
+
async getTableMetadata(
|
|
122
|
+
name: string,
|
|
123
|
+
options: {signal?: AbortSignal} = {}
|
|
124
|
+
): Promise<TableMetadata> {
|
|
125
|
+
const table = await this.resolveTable(name, options.signal);
|
|
126
|
+
const schema = await this.getTableSchema(table);
|
|
127
|
+
options.signal?.throwIfAborted();
|
|
128
|
+
return {name: getTableMetadataName(table), schema, queryable: false};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** Resolves a qualified or unique unqualified table name. */
|
|
132
|
+
protected async resolveTable(name: string, signal?: AbortSignal): Promise<SQLTableInfo> {
|
|
133
|
+
signal?.throwIfAborted();
|
|
134
|
+
const tables = await this.listTables();
|
|
135
|
+
signal?.throwIfAborted();
|
|
136
|
+
const exact = tables.filter(table => getTableMetadataName(table) === name);
|
|
137
|
+
const matches = exact.length ? exact : tables.filter(table => table.tableName === name);
|
|
138
|
+
if (matches.length !== 1) throw new Error(`Unknown or ambiguous SQL table: ${name}`);
|
|
139
|
+
return matches[0];
|
|
140
|
+
}
|
|
141
|
+
|
|
111
142
|
/** Returns the schema for a specific SQL table. */
|
|
112
143
|
async getTableSchema(options: {
|
|
113
144
|
catalogName?: string;
|
|
@@ -128,8 +159,8 @@ export class SQLDataSource extends DataSource<string, SQLSourceOptions> {
|
|
|
128
159
|
return await adapter.executeRows(compiledQuery.sql, compiledQuery.options);
|
|
129
160
|
}
|
|
130
161
|
|
|
131
|
-
/** Executes a SQL query and returns a
|
|
132
|
-
async queryArrow(query: SQLQuery, options: SQLQueryOptions = {}): Promise<
|
|
162
|
+
/** Executes a SQL query and returns a native Arrow table. */
|
|
163
|
+
async queryArrow(query: SQLQuery, options: SQLQueryOptions = {}): Promise<Table> {
|
|
133
164
|
const adapter = await this.getAdapter();
|
|
134
165
|
const compiledQuery = this.compileQuery(query, options);
|
|
135
166
|
if (adapter.executeArrow) {
|
|
@@ -226,3 +257,11 @@ function getSQLTableQueryDialect(sourceType: string): SQLTableQueryDialect {
|
|
|
226
257
|
if (sourceType === 'snowflake-sql') return 'snowflake';
|
|
227
258
|
throw new Error(`Portable table queries are not supported for SQL source type "${sourceType}".`);
|
|
228
259
|
}
|
|
260
|
+
|
|
261
|
+
/** Preserves native namespace components as one unambiguous provider-defined loaded name. */
|
|
262
|
+
function getTableMetadataName(table: SQLTableInfo): string {
|
|
263
|
+
return [table.catalogName, table.schemaName, table.tableName]
|
|
264
|
+
.filter((name): name is string => typeof name === 'string' && name.length > 0)
|
|
265
|
+
.map(name => `"${name.replaceAll('"', '""')}"`)
|
|
266
|
+
.join('.');
|
|
267
|
+
}
|
package/src/sql-types.ts
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {
|
|
5
|
+
import type {Table} from 'apache-arrow';
|
|
6
|
+
import type {Schema} from '@loaders.gl/core/schema';
|
|
6
7
|
import type {CoreAPI, DataSourceOptions} from '@loaders.gl/core/loader-utils';
|
|
7
8
|
import type {SQLTableQuery} from './compile-table-query';
|
|
8
9
|
|
|
@@ -90,7 +91,7 @@ export interface SQLAdapter {
|
|
|
90
91
|
executeRows(sql: string, options?: SQLQueryOptions): Promise<Record<string, unknown>[]>;
|
|
91
92
|
/** Uploads an Arrow IPC stream without passing Arrow runtime objects. */
|
|
92
93
|
insertArrowIPC?(bytes: Uint8Array, options: SQLArrowInsertOptions): Promise<void>;
|
|
93
|
-
executeArrow?(sql: string, options?: SQLQueryOptions): Promise<
|
|
94
|
+
executeArrow?(sql: string, options?: SQLQueryOptions): Promise<Table>;
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
/** Context passed to SQL adapter factories during source initialization. */
|