-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathtypes.ts
More file actions
36 lines (31 loc) · 934 Bytes
/
types.ts
File metadata and controls
36 lines (31 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/**
* Shared types for the native connection manager.
*/
export interface ConnectionConfig {
type: string
[key: string]: unknown
}
export interface ConnectorResult {
columns: string[]
rows: any[][]
row_count: number
truncated: boolean
}
export interface SchemaColumn {
name: string
data_type: string
nullable: boolean
}
export interface ExecuteOptions {
/** Skip the default LIMIT injection and post-truncation. Use when the caller
* needs the complete, untruncated result set (e.g. data-diff pipelines). */
noLimit?: boolean
}
export interface Connector {
connect(): Promise<void>
execute(sql: string, limit?: number, binds?: any[], options?: ExecuteOptions): Promise<ConnectorResult>
listSchemas(): Promise<string[]>
listTables(schema: string): Promise<Array<{ name: string; type: string }>>
describeTable(schema: string, table: string): Promise<SchemaColumn[]>
close(): Promise<void>
}