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 CHANGED
@@ -485,6 +485,14 @@ export declare class DdbDatabaseError extends Error {
485
485
  options: DdbRpcOptions;
486
486
  constructor(message: string, ddb: DDB, type: DdbRpcType, options: DdbRpcOptions);
487
487
  }
488
+ export interface DdbOptions {
489
+ autologin?: boolean;
490
+ username?: string;
491
+ password?: string;
492
+ python?: boolean;
493
+ streaming?: StreamingParams;
494
+ verbose?: boolean;
495
+ }
488
496
  export declare class DDB {
489
497
  /** 当前的 session id (http 或 tcp) */
490
498
  sid: string;
@@ -536,7 +544,7 @@ export declare class DDB {
536
544
  Initialize an instance of DolphinDB Client using the WebSocket URL (without establishing an actual network connection)
537
545
  - url?: DolphinDB WebSocket URL,如:`ws://127.0.0.1:8848`, 默认为当前页面 URL
538
546
  DolphinDB WebSocket URL. e.g.:`ws://127.0.0.1:8848`, Defaults to the current page URL
539
- - options?:
547
+ - options?: DdbOptions
540
548
  - autologin?: 是否在建立连接后自动登录,默认 `true` Whether to log in automatically after establishing a connection, default `true`
541
549
  - username?: DolphinDB 登录用户名,默认 `'admin'` DolphinDB username, default `'admin'`
542
550
  - password?: DolphinDB 登录密码,默认 `'123456'` DolphinDB password, default `'123456'`
@@ -553,16 +561,8 @@ export declare class DDB {
553
561
  username: 'admin',
554
562
  password: '123456',
555
563
  python: false
556
- })
557
- */
558
- constructor(url?: string, options?: {
559
- autologin?: boolean;
560
- username?: string;
561
- password?: string;
562
- python?: boolean;
563
- streaming?: StreamingParams;
564
- verbose?: boolean;
565
- });
564
+ }) */
565
+ constructor(url: string, options?: DdbOptions);
566
566
  private on_message;
567
567
  private on_error;
568
568
  /** 调用后会确保和数据库的连接是正常的 (this.connected === true && this.errored === false),否则抛出错误
package/browser.js CHANGED
@@ -423,6 +423,8 @@ class DdbObj {
423
423
  case DdbType.symbol:
424
424
  case DdbType.code:
425
425
  case DdbType.handle:
426
+ // sqlDS 函数会返回包含 datasource 的 any vector
427
+ case DdbType.datasource:
426
428
  case DdbType.functiondef:
427
429
  // mysql 插件 connect 方法会返回 resource 类型的对象
428
430
  case DdbType.resource: {
@@ -657,6 +659,7 @@ class DdbObj {
657
659
  case DdbType.string:
658
660
  case DdbType.symbol:
659
661
  case DdbType.handle:
662
+ case DdbType.datasource:
660
663
  case DdbType.code: {
661
664
  let value = new Array(length);
662
665
  let i_head = 0, i_tail = i_head;
@@ -862,6 +865,7 @@ class DdbObj {
862
865
  case DdbType.symbol:
863
866
  case DdbType.code:
864
867
  case DdbType.handle:
868
+ case DdbType.datasource:
865
869
  case DdbType.resource:
866
870
  return [
867
871
  DdbObj.enc.encode(value),
@@ -998,6 +1002,7 @@ class DdbObj {
998
1002
  case DdbType.string:
999
1003
  case DdbType.symbol:
1000
1004
  case DdbType.handle:
1005
+ case DdbType.datasource:
1001
1006
  case DdbType.code: {
1002
1007
  let bufs = new Array(length * 2);
1003
1008
  for (let i = 0; i < length; i++) {
@@ -1446,6 +1451,7 @@ export function format(type, value, le, options = {}) {
1446
1451
  }
1447
1452
  case DdbType.handle:
1448
1453
  case DdbType.code:
1454
+ case DdbType.datasource:
1449
1455
  case DdbType.resource: {
1450
1456
  const str = value.quote('single');
1451
1457
  return colors ? cyan(str) : str;
@@ -2229,7 +2235,7 @@ class DDB {
2229
2235
  Initialize an instance of DolphinDB Client using the WebSocket URL (without establishing an actual network connection)
2230
2236
  - url?: DolphinDB WebSocket URL,如:`ws://127.0.0.1:8848`, 默认为当前页面 URL
2231
2237
  DolphinDB WebSocket URL. e.g.:`ws://127.0.0.1:8848`, Defaults to the current page URL
2232
- - options?:
2238
+ - options?: DdbOptions
2233
2239
  - autologin?: 是否在建立连接后自动登录,默认 `true` Whether to log in automatically after establishing a connection, default `true`
2234
2240
  - username?: DolphinDB 登录用户名,默认 `'admin'` DolphinDB username, default `'admin'`
2235
2241
  - password?: DolphinDB 登录密码,默认 `'123456'` DolphinDB password, default `'123456'`
@@ -2246,8 +2252,7 @@ class DDB {
2246
2252
  username: 'admin',
2247
2253
  password: '123456',
2248
2254
  python: false
2249
- })
2250
- */
2255
+ }) */
2251
2256
  constructor(url, options = {}) {
2252
2257
  this.url = url;
2253
2258
  if (options.verbose !== undefined)