dolphindb 2.0.953 → 2.0.955

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/index.js CHANGED
@@ -169,7 +169,7 @@ class DdbObj {
169
169
  });
170
170
  const type = buf[0];
171
171
  const form = buf[1];
172
- if (buf.length <= 2) {
172
+ if (buf.length <= 2)
173
173
  return new this({
174
174
  le,
175
175
  form,
@@ -177,7 +177,6 @@ class DdbObj {
177
177
  length: 2,
178
178
  value: null,
179
179
  });
180
- }
181
180
  // set 里面 data 嵌套了一个 vector, 跳过 vector 的 type 和 form
182
181
  const i_data = form === DdbForm.set ? 4 : 2;
183
182
  const buf_data = buf.subarray(i_data);
@@ -421,6 +420,8 @@ class DdbObj {
421
420
  case DdbType.symbol:
422
421
  case DdbType.code:
423
422
  case DdbType.handle:
423
+ // sqlDS 函数会返回包含 datasource 的 any vector
424
+ case DdbType.datasource:
424
425
  case DdbType.functiondef:
425
426
  // mysql 插件 connect 方法会返回 resource 类型的对象
426
427
  case DdbType.resource: {
@@ -655,6 +656,7 @@ class DdbObj {
655
656
  case DdbType.string:
656
657
  case DdbType.symbol:
657
658
  case DdbType.handle:
659
+ case DdbType.datasource:
658
660
  case DdbType.code: {
659
661
  let value = new Array(length);
660
662
  let i_head = 0, i_tail = i_head;
@@ -860,6 +862,7 @@ class DdbObj {
860
862
  case DdbType.symbol:
861
863
  case DdbType.code:
862
864
  case DdbType.handle:
865
+ case DdbType.datasource:
863
866
  case DdbType.resource:
864
867
  return [
865
868
  DdbObj.enc.encode(value),
@@ -996,6 +999,7 @@ class DdbObj {
996
999
  case DdbType.string:
997
1000
  case DdbType.symbol:
998
1001
  case DdbType.handle:
1002
+ case DdbType.datasource:
999
1003
  case DdbType.code: {
1000
1004
  let bufs = new Array(length * 2);
1001
1005
  for (let i = 0; i < length; i++) {
@@ -1432,6 +1436,7 @@ export function format(type, value, le, options = {}) {
1432
1436
  case DdbType.functiondef:
1433
1437
  return inspect(value.name, options);
1434
1438
  case DdbType.handle:
1439
+ case DdbType.datasource:
1435
1440
  case DdbType.code:
1436
1441
  case DdbType.resource:
1437
1442
  return inspect(value, options);