dbgate-types 6.5.5 → 6.6.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/dbinfo.d.ts +2 -0
- package/engines.d.ts +26 -2
- package/filter-type.d.ts +8 -1
- package/package.json +1 -1
- package/query.d.ts +89 -0
package/dbinfo.d.ts
CHANGED
|
@@ -108,6 +108,8 @@ export interface CollectionInfo extends DatabaseObjectInfo {
|
|
|
108
108
|
// unique combination of columns (should be contatenation of partitionKey and clusterKey)
|
|
109
109
|
uniqueKey?: ColumnReference[];
|
|
110
110
|
|
|
111
|
+
autoValueColumns?: ColumnReference[];
|
|
112
|
+
|
|
111
113
|
// partition key columns
|
|
112
114
|
partitionKey?: ColumnReference[];
|
|
113
115
|
|
package/engines.d.ts
CHANGED
|
@@ -23,6 +23,28 @@ export interface StreamOptions {
|
|
|
23
23
|
info?: (info) => void;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
export type CollectionOperationInfo =
|
|
27
|
+
| {
|
|
28
|
+
type: 'createCollection';
|
|
29
|
+
collection: {
|
|
30
|
+
name: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
| {
|
|
34
|
+
type: 'dropCollection';
|
|
35
|
+
collection: string;
|
|
36
|
+
}
|
|
37
|
+
| {
|
|
38
|
+
type: 'renameCollection';
|
|
39
|
+
collection: string;
|
|
40
|
+
newName: string;
|
|
41
|
+
}
|
|
42
|
+
| {
|
|
43
|
+
type: 'cloneCollection';
|
|
44
|
+
collection: string;
|
|
45
|
+
newName: string;
|
|
46
|
+
};
|
|
47
|
+
|
|
26
48
|
export interface RunScriptOptions {
|
|
27
49
|
useTransaction: boolean;
|
|
28
50
|
logScriptItems?: boolean;
|
|
@@ -120,6 +142,8 @@ export interface DataEditorTypesBehaviour {
|
|
|
120
142
|
parseHexAsBuffer?: boolean;
|
|
121
143
|
parseObjectIdAsDollar?: boolean;
|
|
122
144
|
parseDateAsDollar?: boolean;
|
|
145
|
+
parseGeopointAsDollar?: boolean;
|
|
146
|
+
parseFsDocumentRefAsDollar?: boolean;
|
|
123
147
|
|
|
124
148
|
explicitDataType?: boolean;
|
|
125
149
|
supportNumberType?: boolean;
|
|
@@ -217,7 +241,7 @@ export interface EngineDriver<TClient = any> extends FilterBehaviourProvider {
|
|
|
217
241
|
defaultSocketPath?: string;
|
|
218
242
|
authTypeLabel?: string;
|
|
219
243
|
importExportArgs?: any[];
|
|
220
|
-
connect({ server, port, user, password, database }): Promise<DatabaseHandle<TClient>>;
|
|
244
|
+
connect({ server, port, user, password, database, connectionDefinition }): Promise<DatabaseHandle<TClient>>;
|
|
221
245
|
close(dbhan: DatabaseHandle<TClient>): Promise<any>;
|
|
222
246
|
query(dbhan: DatabaseHandle<TClient>, sql: string, options?: QueryOptions): Promise<QueryResult>;
|
|
223
247
|
stream(dbhan: DatabaseHandle<TClient>, sql: string, options: StreamOptions);
|
|
@@ -264,7 +288,7 @@ export interface EngineDriver<TClient = any> extends FilterBehaviourProvider {
|
|
|
264
288
|
dropDatabase(dbhan: DatabaseHandle<TClient>, name: string): Promise;
|
|
265
289
|
getQuerySplitterOptions(usage: 'stream' | 'script' | 'editor' | 'import'): any;
|
|
266
290
|
script(dbhan: DatabaseHandle<TClient>, sql: string, options?: RunScriptOptions): Promise;
|
|
267
|
-
operation(dbhan: DatabaseHandle<TClient>, operation:
|
|
291
|
+
operation(dbhan: DatabaseHandle<TClient>, operation: CollectionOperationInfo, options?: RunScriptOptions): Promise;
|
|
268
292
|
getNewObjectTemplates(): NewObjectTemplate[];
|
|
269
293
|
// direct call of dbhan.client method, only some methods could be supported, on only some drivers
|
|
270
294
|
callMethod(dbhan: DatabaseHandle<TClient>, method, args);
|
package/filter-type.d.ts
CHANGED
|
@@ -9,11 +9,18 @@ export interface FilterBehaviour {
|
|
|
9
9
|
supportExistsTesting?: boolean;
|
|
10
10
|
supportBooleanValues?: boolean;
|
|
11
11
|
supportSqlCondition?: boolean;
|
|
12
|
-
|
|
12
|
+
supportEmptyArrayTesting?: boolean;
|
|
13
|
+
supportNotEmptyArrayTesting?: boolean;
|
|
14
|
+
supportBooleanOrNull?: boolean;
|
|
13
15
|
|
|
14
16
|
allowStringToken?: boolean;
|
|
15
17
|
allowNumberToken?: boolean;
|
|
16
18
|
allowHexString?: boolean;
|
|
17
19
|
allowNumberDualTesting?: boolean;
|
|
18
20
|
allowObjectIdTesting?: boolean;
|
|
21
|
+
|
|
22
|
+
passBooleans?: boolean;
|
|
23
|
+
passNumbers?: boolean;
|
|
24
|
+
|
|
25
|
+
disableOr?: boolean;
|
|
19
26
|
}
|
package/package.json
CHANGED
package/query.d.ts
CHANGED
|
@@ -15,3 +15,92 @@ export interface QueryResult {
|
|
|
15
15
|
columns?: QueryResultColumn[];
|
|
16
16
|
rowsAffected?: number;
|
|
17
17
|
}
|
|
18
|
+
|
|
19
|
+
export type LeftOperand = {
|
|
20
|
+
exprType: 'placeholder' | 'column';
|
|
21
|
+
columnName?: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type RightOperand = {
|
|
25
|
+
exprType: 'value';
|
|
26
|
+
value: any;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type BinaryCondition = {
|
|
30
|
+
conditionType: 'binary';
|
|
31
|
+
operator: '=' | '!=' | '<>' | '<' | '<=' | '>' | '>=';
|
|
32
|
+
left: LeftOperand;
|
|
33
|
+
right: RightOperand;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export type AndCondition = {
|
|
37
|
+
conditionType: 'and';
|
|
38
|
+
conditions: FilterCondition[];
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type OrCondition = {
|
|
42
|
+
conditionType: 'or';
|
|
43
|
+
conditions: FilterCondition[];
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export type NullCondition = {
|
|
47
|
+
conditionType: 'isNull' | 'isNotNull';
|
|
48
|
+
expr: LeftOperand;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export type NotCondition = {
|
|
52
|
+
conditionType: 'not';
|
|
53
|
+
condition: FilterCondition;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export type LikeCondition = {
|
|
57
|
+
conditionType: 'like';
|
|
58
|
+
left: LeftOperand;
|
|
59
|
+
right: RightOperand;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export type PredicateCondition = {
|
|
63
|
+
conditionType: 'specificPredicate';
|
|
64
|
+
predicate: 'exists' | 'notExists' | 'emptyArray' | 'notEmptyArray';
|
|
65
|
+
expr: LeftOperand;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export type InCondition = {
|
|
69
|
+
conditionType: 'in';
|
|
70
|
+
expr: LeftOperand;
|
|
71
|
+
values: any[];
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export type FilterCondition =
|
|
75
|
+
| BinaryCondition
|
|
76
|
+
| AndCondition
|
|
77
|
+
| OrCondition
|
|
78
|
+
| NullCondition
|
|
79
|
+
| NotCondition
|
|
80
|
+
| LikeCondition
|
|
81
|
+
| PredicateCondition
|
|
82
|
+
| InCondition;
|
|
83
|
+
|
|
84
|
+
export type SortItem = {
|
|
85
|
+
columnName: string;
|
|
86
|
+
direction?: 'ASC' | 'DESC';
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export type AggregateColumn = {
|
|
90
|
+
aggregateFunction: 'count' | 'sum' | 'avg' | 'min' | 'max';
|
|
91
|
+
columnArgument?: string;
|
|
92
|
+
alias: string;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export type CollectionAggregate = {
|
|
96
|
+
condition?: FilterCondition;
|
|
97
|
+
groupByColumns: string[];
|
|
98
|
+
aggregateColumns: AggregateColumn[];
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export type FullQueryOptions = {
|
|
102
|
+
condition?: FilterCondition;
|
|
103
|
+
sort?: SortItem[];
|
|
104
|
+
limit?: number;
|
|
105
|
+
skip?: number;
|
|
106
|
+
};
|