dolphindb 2.0.979 → 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/README.md CHANGED
@@ -76,6 +76,10 @@ let ddbsecure = new DDB('wss://dolphindb.com', {
76
76
  // set python session flag, default `false`
77
77
  python: false,
78
78
 
79
+ // set sql standrd flag, use the SqlStandard enum to pass arguments, default `DolphinDB`
80
+ // sql: SqlStandard.MySQL,
81
+ // sql: SqlStandard.Oracle,
82
+
79
83
  // After setting this option, the database connection is only used for streaming data. For details, see `5. Streaming Data`
80
84
  streaming: undefined
81
85
  })
package/README.zh.md CHANGED
@@ -73,6 +73,10 @@ let ddb = new DDB('ws://127.0.0.1:8848', {
73
73
  // 设置 python session flag,默认 `false`
74
74
  python: false,
75
75
 
76
+ // 设置当前会话执行的 sql 标准, 请使用 SqlStandard 枚举进行传参,默认 `DolphinDB`
77
+ // sql: SqlStandard.MySQL,
78
+ // sql: SqlStandard.Oracle,
79
+
76
80
  // 设置该选项后,该数据库连接只用于流数据,详细用法见后文 `5. 流数据`
77
81
  streaming: undefined
78
82
  })
package/browser.d.ts CHANGED
@@ -384,11 +384,18 @@ export declare class DdbDatabaseError extends Error {
384
384
  options: DdbRpcOptions;
385
385
  constructor(message: string, ddb: DDB, type: DdbRpcType, options: DdbRpcOptions);
386
386
  }
387
+ /** SQL Standrd 标准类型 */
388
+ export declare enum SqlStandard {
389
+ DolphinDB = 0,
390
+ Oracle = 1,
391
+ MySQL = 2
392
+ }
387
393
  export interface DdbOptions {
388
394
  autologin?: boolean;
389
395
  username?: string;
390
396
  password?: string;
391
397
  python?: boolean;
398
+ sql?: SqlStandard;
392
399
  streaming?: StreamingParams;
393
400
  verbose?: boolean;
394
401
  }
@@ -416,6 +423,8 @@ export declare class DDB {
416
423
  password: string;
417
424
  /** python session flag (2048) */
418
425
  python: boolean;
426
+ /** 表示本次会话执行的 SQL 标准 */
427
+ sql: SqlStandard;
419
428
  /** 是否为流数据连接,非流数据这个字段恒为 null Whether it is a streaming data connection, this field is always null for non-streaming data */
420
429
  streaming: StreamingData;
421
430
  /** 是否打印每个 rpc 的信息用于调试 */
@@ -450,6 +459,7 @@ export declare class DDB {
450
459
  - python?: 设置 python session flag,默认 `false` set python session flag, default `false`
451
460
  - streaming?: 设置该选项后,该 WebSocket 连接只用于流数据 When this option is set, the WebSocket connection is only used for streaming data
452
461
  - verbose?: 是否打印每个 rpc 的信息用于调试
462
+ - sql?: 设置当前会话执行的 sql 标准, 请使用 SqlStandard 枚举进行传参,默认 `DolphinDB`
453
463
 
454
464
  @example
455
465
  let ddb = new DDB('ws://127.0.0.1:8848')
package/browser.js CHANGED
@@ -2109,6 +2109,13 @@ export class DdbDatabaseError extends Error {
2109
2109
  this.options = options;
2110
2110
  }
2111
2111
  }
2112
+ /** SQL Standrd 标准类型 */
2113
+ export var SqlStandard;
2114
+ (function (SqlStandard) {
2115
+ SqlStandard[SqlStandard["DolphinDB"] = 0] = "DolphinDB";
2116
+ SqlStandard[SqlStandard["Oracle"] = 1] = "Oracle";
2117
+ SqlStandard[SqlStandard["MySQL"] = 2] = "MySQL";
2118
+ })(SqlStandard || (SqlStandard = {}));
2112
2119
  export class DDB {
2113
2120
  /** 当前的 session id (http 或 tcp) */
2114
2121
  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 的信息用于调试 */
@@ -2172,6 +2181,7 @@ export class DDB {
2172
2181
  - python?: 设置 python session flag,默认 `false` set python session flag, default `false`
2173
2182
  - streaming?: 设置该选项后,该 WebSocket 连接只用于流数据 When this option is set, the WebSocket connection is only used for streaming data
2174
2183
  - verbose?: 是否打印每个 rpc 的信息用于调试
2184
+ - sql?: 设置当前会话执行的 sql 标准, 请使用 SqlStandard 枚举进行传参,默认 `DolphinDB`
2175
2185
 
2176
2186
  @example
2177
2187
  let ddb = new DDB('ws://127.0.0.1:8848')
@@ -2195,6 +2205,8 @@ export class DDB {
2195
2205
  this.password = options.password;
2196
2206
  if (options.python !== undefined)
2197
2207
  this.python = options.python;
2208
+ if (options.sql !== undefined)
2209
+ this.sql = options.sql;
2198
2210
  if (options.streaming !== undefined)
2199
2211
  this.streaming = options.streaming;
2200
2212
  }
@@ -2283,6 +2295,8 @@ export class DDB {
2283
2295
  // python session
2284
2296
  if (this.python)
2285
2297
  flag += 2048;
2298
+ // sql standrd
2299
+ flag += 2 ** 19 * this.sql;
2286
2300
  const options = [
2287
2301
  flag,
2288
2302
  cancellable ? 1 : 0,