dolphindb 2.0.952 → 2.0.954
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 +11 -11
- package/browser.js +8 -3
- package/browser.js.map +1 -1
- package/index.d.ts +11 -11
- package/index.js +8 -3
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -476,6 +476,14 @@ export declare class DdbDatabaseError extends Error {
|
|
|
476
476
|
options: DdbRpcOptions;
|
|
477
477
|
constructor(message: string, ddb: DDB, type: DdbRpcType, options: DdbRpcOptions);
|
|
478
478
|
}
|
|
479
|
+
export interface DdbOptions {
|
|
480
|
+
autologin?: boolean;
|
|
481
|
+
username?: string;
|
|
482
|
+
password?: string;
|
|
483
|
+
python?: boolean;
|
|
484
|
+
streaming?: StreamingParams;
|
|
485
|
+
verbose?: boolean;
|
|
486
|
+
}
|
|
479
487
|
export declare class DDB {
|
|
480
488
|
/** 当前的 session id (http 或 tcp) */
|
|
481
489
|
sid: string;
|
|
@@ -526,7 +534,7 @@ export declare class DDB {
|
|
|
526
534
|
使用 WebSocket URL 初始化连接到 DolphinDB 的实例(不建立实际的网络连接)
|
|
527
535
|
Initialize an instance of DolphinDB Client using the WebSocket URL (without establishing an actual network connection)
|
|
528
536
|
- url: DolphinDB WebSocket URL. e.g.:`ws://127.0.0.1:8848`
|
|
529
|
-
- options?:
|
|
537
|
+
- options?: DdbOptions
|
|
530
538
|
- autologin?: 是否在建立连接后自动登录,默认 `true` Whether to log in automatically after establishing a connection, default `true`
|
|
531
539
|
- username?: DolphinDB 登录用户名,默认 `'admin'` DolphinDB username, default `'admin'`
|
|
532
540
|
- password?: DolphinDB 登录密码,默认 `'123456'` DolphinDB password, default `'123456'`
|
|
@@ -543,16 +551,8 @@ export declare class DDB {
|
|
|
543
551
|
username: 'admin',
|
|
544
552
|
password: '123456',
|
|
545
553
|
python: false
|
|
546
|
-
})
|
|
547
|
-
|
|
548
|
-
constructor(url: string, options?: {
|
|
549
|
-
autologin?: boolean;
|
|
550
|
-
username?: string;
|
|
551
|
-
password?: string;
|
|
552
|
-
python?: boolean;
|
|
553
|
-
streaming?: StreamingParams;
|
|
554
|
-
verbose?: boolean;
|
|
555
|
-
});
|
|
554
|
+
}) */
|
|
555
|
+
constructor(url: string, options?: DdbOptions);
|
|
556
556
|
private on_message;
|
|
557
557
|
private on_error;
|
|
558
558
|
/** 调用后会确保和数据库的连接是正常的 (this.connected === true && this.errored === false),否则抛出错误
|
package/index.js
CHANGED
|
@@ -421,6 +421,8 @@ class DdbObj {
|
|
|
421
421
|
case DdbType.symbol:
|
|
422
422
|
case DdbType.code:
|
|
423
423
|
case DdbType.handle:
|
|
424
|
+
// sqlDS 函数会返回包含 datasource 的 any vector
|
|
425
|
+
case DdbType.datasource:
|
|
424
426
|
case DdbType.functiondef:
|
|
425
427
|
// mysql 插件 connect 方法会返回 resource 类型的对象
|
|
426
428
|
case DdbType.resource: {
|
|
@@ -655,6 +657,7 @@ class DdbObj {
|
|
|
655
657
|
case DdbType.string:
|
|
656
658
|
case DdbType.symbol:
|
|
657
659
|
case DdbType.handle:
|
|
660
|
+
case DdbType.datasource:
|
|
658
661
|
case DdbType.code: {
|
|
659
662
|
let value = new Array(length);
|
|
660
663
|
let i_head = 0, i_tail = i_head;
|
|
@@ -860,6 +863,7 @@ class DdbObj {
|
|
|
860
863
|
case DdbType.symbol:
|
|
861
864
|
case DdbType.code:
|
|
862
865
|
case DdbType.handle:
|
|
866
|
+
case DdbType.datasource:
|
|
863
867
|
case DdbType.resource:
|
|
864
868
|
return [
|
|
865
869
|
DdbObj.enc.encode(value),
|
|
@@ -996,6 +1000,7 @@ class DdbObj {
|
|
|
996
1000
|
case DdbType.string:
|
|
997
1001
|
case DdbType.symbol:
|
|
998
1002
|
case DdbType.handle:
|
|
1003
|
+
case DdbType.datasource:
|
|
999
1004
|
case DdbType.code: {
|
|
1000
1005
|
let bufs = new Array(length * 2);
|
|
1001
1006
|
for (let i = 0; i < length; i++) {
|
|
@@ -1432,6 +1437,7 @@ export function format(type, value, le, options = {}) {
|
|
|
1432
1437
|
case DdbType.functiondef:
|
|
1433
1438
|
return inspect(value.name, options);
|
|
1434
1439
|
case DdbType.handle:
|
|
1440
|
+
case DdbType.datasource:
|
|
1435
1441
|
case DdbType.code:
|
|
1436
1442
|
case DdbType.resource:
|
|
1437
1443
|
return inspect(value, options);
|
|
@@ -2219,7 +2225,7 @@ class DDB {
|
|
|
2219
2225
|
使用 WebSocket URL 初始化连接到 DolphinDB 的实例(不建立实际的网络连接)
|
|
2220
2226
|
Initialize an instance of DolphinDB Client using the WebSocket URL (without establishing an actual network connection)
|
|
2221
2227
|
- url: DolphinDB WebSocket URL. e.g.:`ws://127.0.0.1:8848`
|
|
2222
|
-
- options?:
|
|
2228
|
+
- options?: DdbOptions
|
|
2223
2229
|
- autologin?: 是否在建立连接后自动登录,默认 `true` Whether to log in automatically after establishing a connection, default `true`
|
|
2224
2230
|
- username?: DolphinDB 登录用户名,默认 `'admin'` DolphinDB username, default `'admin'`
|
|
2225
2231
|
- password?: DolphinDB 登录密码,默认 `'123456'` DolphinDB password, default `'123456'`
|
|
@@ -2236,8 +2242,7 @@ class DDB {
|
|
|
2236
2242
|
username: 'admin',
|
|
2237
2243
|
password: '123456',
|
|
2238
2244
|
python: false
|
|
2239
|
-
})
|
|
2240
|
-
*/
|
|
2245
|
+
}) */
|
|
2241
2246
|
constructor(url, options = {}) {
|
|
2242
2247
|
this.url = url;
|
|
2243
2248
|
if (options.verbose !== undefined)
|