-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsnowflake.interface.ts
More file actions
89 lines (76 loc) · 1.7 KB
/
snowflake.interface.ts
File metadata and controls
89 lines (76 loc) · 1.7 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// Copyright The Linux Foundation and each contributor to LFX.
// SPDX-License-Identifier: MIT
import type { Column, DataType } from 'snowflake-sdk';
/**
* Result of a Snowflake query execution
* Uses SDK's Column type for metadata
*/
export interface SnowflakeQueryResult<T> {
rows: T[];
metadata: Column[];
statementHandle?: string;
}
/**
* Options for Snowflake query execution
* Extends SDK's StatementOption properties
*/
export interface SnowflakeQueryOptions {
/**
* Query execution timeout in milliseconds
*/
timeout?: number;
/**
* Array of data types to fetch as strings (for large numbers, etc.)
*/
fetchAsString?: DataType[];
}
/**
* Statistics for the Snowflake connection pool
*/
export interface SnowflakePoolStats {
/**
* Number of connections currently executing queries
*/
activeConnections: number;
/**
* Number of idle connections available in the pool
*/
idleConnections: number;
/**
* Number of requests waiting for a connection
*/
waitingRequests: number;
/**
* Total number of connections in the pool
*/
totalConnections: number;
}
/**
* Statistics for the lock manager (query deduplication)
*/
export interface LockStats {
/**
* Number of currently active locks
*/
activeLocks: number;
/**
* Total number of deduplication hits (queries reused)
*/
totalHits: number;
/**
* Total number of deduplication misses (new queries)
*/
totalMisses: number;
/**
* Deduplication effectiveness as a percentage
*/
deduplicationRate: number;
}
/**
* Internal lock entry structure for in-memory locking
*/
export interface LockEntry {
promise: Promise<any>;
timestamp: number;
waiters: number;
}