dolphindb 2.0.1000 → 2.0.1001
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/browser.d.ts +10 -0
- package/browser.js +14 -0
- package/browser.js.map +1 -1
- package/index.d.ts +10 -0
- package/index.js +14 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -375,11 +375,18 @@ export declare class DdbDatabaseError extends Error {
|
|
|
375
375
|
options: DdbRpcOptions;
|
|
376
376
|
constructor(message: string, ddb: DDB, type: DdbRpcType, options: DdbRpcOptions);
|
|
377
377
|
}
|
|
378
|
+
/** SQL Standrd 标准类型 */
|
|
379
|
+
export declare enum SqlStandard {
|
|
380
|
+
DolphinDB = 0,
|
|
381
|
+
Oracle = 1,
|
|
382
|
+
MySQL = 2
|
|
383
|
+
}
|
|
378
384
|
export interface DdbOptions {
|
|
379
385
|
autologin?: boolean;
|
|
380
386
|
username?: string;
|
|
381
387
|
password?: string;
|
|
382
388
|
python?: boolean;
|
|
389
|
+
sql?: SqlStandard;
|
|
383
390
|
streaming?: StreamingParams;
|
|
384
391
|
verbose?: boolean;
|
|
385
392
|
}
|
|
@@ -407,6 +414,8 @@ export declare class DDB {
|
|
|
407
414
|
password: string;
|
|
408
415
|
/** python session flag (2048) */
|
|
409
416
|
python: boolean;
|
|
417
|
+
/** 表示本次会话执行的 SQL 标准 */
|
|
418
|
+
sql: SqlStandard;
|
|
410
419
|
/** 是否为流数据连接,非流数据这个字段恒为 null Whether it is a streaming data connection, this field is always null for non-streaming data */
|
|
411
420
|
streaming: StreamingData;
|
|
412
421
|
/** 是否打印每个 rpc 的信息用于调试 */
|
|
@@ -440,6 +449,7 @@ export declare class DDB {
|
|
|
440
449
|
- python?: 设置 python session flag,默认 `false` set python session flag, default `false`
|
|
441
450
|
- streaming?: 设置该选项后,该 WebSocket 连接只用于流数据 When this option is set, the WebSocket connection is only used for streaming data
|
|
442
451
|
- verbose?: 是否打印每个 rpc 的信息用于调试
|
|
452
|
+
- sql?: 设置当前会话执行的 sql 标准, 请使用 SqlStandard 枚举进行传参,默认 `DolphinDB`
|
|
443
453
|
|
|
444
454
|
@example
|
|
445
455
|
let ddb = new DDB('ws://127.0.0.1:8848')
|
package/index.js
CHANGED
|
@@ -2104,6 +2104,13 @@ export class DdbDatabaseError extends Error {
|
|
|
2104
2104
|
this.options = options;
|
|
2105
2105
|
}
|
|
2106
2106
|
}
|
|
2107
|
+
/** SQL Standrd 标准类型 */
|
|
2108
|
+
export var SqlStandard;
|
|
2109
|
+
(function (SqlStandard) {
|
|
2110
|
+
SqlStandard[SqlStandard["DolphinDB"] = 0] = "DolphinDB";
|
|
2111
|
+
SqlStandard[SqlStandard["Oracle"] = 1] = "Oracle";
|
|
2112
|
+
SqlStandard[SqlStandard["MySQL"] = 2] = "MySQL";
|
|
2113
|
+
})(SqlStandard || (SqlStandard = {}));
|
|
2107
2114
|
export class DDB {
|
|
2108
2115
|
/** 当前的 session id (http 或 tcp) */
|
|
2109
2116
|
sid = '0';
|
|
@@ -2133,6 +2140,8 @@ export class DDB {
|
|
|
2133
2140
|
password = '123456';
|
|
2134
2141
|
/** python session flag (2048) */
|
|
2135
2142
|
python = false;
|
|
2143
|
+
/** 表示本次会话执行的 SQL 标准 */
|
|
2144
|
+
sql = SqlStandard.DolphinDB;
|
|
2136
2145
|
/** 是否为流数据连接,非流数据这个字段恒为 null Whether it is a streaming data connection, this field is always null for non-streaming data */
|
|
2137
2146
|
streaming = null;
|
|
2138
2147
|
/** 是否打印每个 rpc 的信息用于调试 */
|
|
@@ -2171,6 +2180,7 @@ export class DDB {
|
|
|
2171
2180
|
- python?: 设置 python session flag,默认 `false` set python session flag, default `false`
|
|
2172
2181
|
- streaming?: 设置该选项后,该 WebSocket 连接只用于流数据 When this option is set, the WebSocket connection is only used for streaming data
|
|
2173
2182
|
- verbose?: 是否打印每个 rpc 的信息用于调试
|
|
2183
|
+
- sql?: 设置当前会话执行的 sql 标准, 请使用 SqlStandard 枚举进行传参,默认 `DolphinDB`
|
|
2174
2184
|
|
|
2175
2185
|
@example
|
|
2176
2186
|
let ddb = new DDB('ws://127.0.0.1:8848')
|
|
@@ -2194,6 +2204,8 @@ export class DDB {
|
|
|
2194
2204
|
this.password = options.password;
|
|
2195
2205
|
if (options.python !== undefined)
|
|
2196
2206
|
this.python = options.python;
|
|
2207
|
+
if (options.sql !== undefined)
|
|
2208
|
+
this.sql = options.sql;
|
|
2197
2209
|
if (options.streaming !== undefined)
|
|
2198
2210
|
this.streaming = options.streaming;
|
|
2199
2211
|
}
|
|
@@ -2282,6 +2294,8 @@ export class DDB {
|
|
|
2282
2294
|
// python session
|
|
2283
2295
|
if (this.python)
|
|
2284
2296
|
flag += 2048;
|
|
2297
|
+
// sql standrd
|
|
2298
|
+
flag += 2 ** 19 * this.sql;
|
|
2285
2299
|
const options = [
|
|
2286
2300
|
flag,
|
|
2287
2301
|
cancellable ? 1 : 0,
|