dolphindb 3.1.39 → 3.1.41
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 +7 -13
- package/browser.js +8 -15
- package/browser.js.map +1 -1
- package/common.d.ts +132 -110
- package/common.js +111 -111
- package/common.js.map +1 -1
- package/index.d.ts +8 -14
- package/index.js +8 -15
- package/index.js.map +1 -1
- package/package.json +6 -6
- package/test.js.map +1 -1
package/browser.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Dayjs } from 'dayjs';
|
|
2
2
|
import { Lock } from 'xshell/utils.browser.js';
|
|
3
3
|
import { type WebSocketConnectionError } from 'xshell/net.browser.js';
|
|
4
|
-
import { DdbChartType, DdbForm, DdbFunctionType, DdbType, DdbVoidType, type ConvertOptions, type DdbDecimal32Value, type DdbDecimal32VectorValue, type DdbDecimal64Value, type DdbDecimal64VectorValue, type DdbDurationValue, type DdbDurationVectorValue, type DdbFunctionDefValue, type DdbRpcType, type DdbScalarValue, type DdbSymbolExtendedValue, type DdbTableData, type DdbTensorValue, type IotVectorItemValue, type TensorData, type DdbExtObjValue, type ConvertableDdbTimeValue, type DdbLanguage } from './common.ts';
|
|
4
|
+
import { DdbChartType, DdbForm, DdbFunctionType, DdbType, DdbVoidType, SqlStandard, type ConvertOptions, type DdbDecimal32Value, type DdbDecimal32VectorValue, type DdbDecimal64Value, type DdbDecimal64VectorValue, type DdbDurationValue, type DdbDurationVectorValue, type DdbFunctionDefValue, type DdbRpcType, type DdbScalarValue, type DdbSymbolExtendedValue, type DdbTableData, type DdbTensorValue, type IotVectorItemValue, type TensorData, type DdbExtObjValue, type ConvertableDdbTimeValue, type DdbLanguage } from './common.ts';
|
|
5
5
|
export * from './common.ts';
|
|
6
6
|
export interface DdbDecimal128VectorValue {
|
|
7
7
|
scale: number;
|
|
@@ -138,7 +138,7 @@ export declare class DdbObj<TValue extends DdbValue = DdbValue> {
|
|
|
138
138
|
strides: number[];
|
|
139
139
|
}, limit?: number): TensorData;
|
|
140
140
|
toString(options?: InspectOptions): string;
|
|
141
|
-
inspect_type():
|
|
141
|
+
inspect_type(): any;
|
|
142
142
|
/** 自动转换 Convertable 为 DdbObj */
|
|
143
143
|
static to_ddbobj(value: Convertable): DdbObj;
|
|
144
144
|
/** 转换 js 数组为 DdbObj[] */
|
|
@@ -185,7 +185,7 @@ export interface InspectOptions {
|
|
|
185
185
|
export declare function format(type: DdbType, value: DdbValue, le: boolean, options?: InspectOptions): string;
|
|
186
186
|
/** 格式化向量、集合中的第 index 项为字符串,空值返回 'null' 字符串 formatted vector, the index-th item in the collection is a string, a null value returns a 'null' string */
|
|
187
187
|
export declare function formati(obj: DdbVectorObj, index: number, options?: InspectOptions): string;
|
|
188
|
-
export declare function convert(type: DdbType, value: DdbValue, le: boolean, { blob, char, timestamp }?: ConvertOptions): string | number | bigint | boolean | number[] |
|
|
188
|
+
export declare function convert(type: DdbType, value: DdbValue, le: boolean, { blob, char, timestamp }?: ConvertOptions): string | number | bigint | boolean | number[] | string[] | DdbFunctionDefValue | DdbDurationValue | DdbDecimal32Value | DdbDecimal64Value | DdbDecimal32VectorValue | DdbDecimal64VectorValue | DdbSymbolExtendedValue | DdbExtObjValue | DdbTensorValue | Uint8Array<ArrayBufferLike> | DdbDecimal128VectorValue | BigInt128Array | Int8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike> | BigInt64Array<ArrayBufferLike> | IotVectorItemValue | DdbArrayVectorValue | DdbDurationVectorValue | Uint8Array<ArrayBufferLike>[] | DdbObj<DdbValue>[] | DdbMatrixValue | DdbChartValue;
|
|
189
189
|
/** 转换一个向量到 js 原生数组 */
|
|
190
190
|
export declare function converts(type: DdbType, value: DdbVectorValue, rows: number, le: boolean, options?: ConvertOptions): any[] | Uint8Array;
|
|
191
191
|
/** 构造 void 类型,默认为 `DdbVoidType.undefined` */
|
|
@@ -362,19 +362,13 @@ export declare class DdbDatabaseError extends Error {
|
|
|
362
362
|
options: DdbRpcOptions;
|
|
363
363
|
constructor(message: string, url: string, type: DdbRpcType, options: DdbRpcOptions, id: number);
|
|
364
364
|
}
|
|
365
|
-
/** SQL Standrd 标准类型 */
|
|
366
|
-
export declare enum SqlStandard {
|
|
367
|
-
DolphinDB = 0,
|
|
368
|
-
Oracle = 1,
|
|
369
|
-
MySQL = 2
|
|
370
|
-
}
|
|
371
365
|
export interface DdbOptions {
|
|
372
366
|
autologin?: boolean;
|
|
373
367
|
ticket?: string;
|
|
374
368
|
username?: string;
|
|
375
369
|
password?: string;
|
|
376
370
|
python?: boolean;
|
|
377
|
-
|
|
371
|
+
q?: boolean;
|
|
378
372
|
sql?: SqlStandard;
|
|
379
373
|
streaming?: StreamingParams;
|
|
380
374
|
verbose?: boolean;
|
|
@@ -414,8 +408,8 @@ export declare class DDB {
|
|
|
414
408
|
password: string;
|
|
415
409
|
/** python session flag (2048) */
|
|
416
410
|
python: boolean;
|
|
417
|
-
/**
|
|
418
|
-
|
|
411
|
+
/** q session flag (4096) */
|
|
412
|
+
q: boolean;
|
|
419
413
|
/** 是否为 dolphindb 语言 */
|
|
420
414
|
dolphindb: boolean;
|
|
421
415
|
language: DdbLanguage;
|
|
@@ -458,7 +452,7 @@ export declare class DDB {
|
|
|
458
452
|
- username?: DolphinDB 登录用户名,默认 `'admin'` DolphinDB username, default `'admin'`
|
|
459
453
|
- password?: DolphinDB 登录密码,默认 `'123456'` DolphinDB password, default `'123456'`
|
|
460
454
|
- python?: 设置 python session flag,默认 `false` set python session flag, default `false`
|
|
461
|
-
-
|
|
455
|
+
- q?: 设置 q session flag,默认 `false` set q session flag, default `false`
|
|
462
456
|
- streaming?: 设置该选项后,该 WebSocket 连接只用于流数据 When this option is set, the WebSocket connection is only used for streaming data
|
|
463
457
|
- verbose?: 是否打印每个 rpc 的信息用于调试
|
|
464
458
|
- sql?: 设置当前会话执行的 sql 标准, 请使用 SqlStandard 枚举进行传参,默认 `DolphinDB`
|
package/browser.js
CHANGED
|
@@ -3,7 +3,7 @@ import { blue, cyan, green, gray, magenta } from 'xshell/chalk.browser.js';
|
|
|
3
3
|
import { concat, assert, Lock, genid, seq, zip_object, decode, check } from 'xshell/utils.browser.js';
|
|
4
4
|
import { connect_websocket } from 'xshell/net.browser.js';
|
|
5
5
|
import { t } from "./i18n/index.js";
|
|
6
|
-
import { ddb_tensor_bytes, DdbChartType, DdbDurationUnit, DdbForm, generate_array_type, DdbFunctionType, DdbType, DdbVoidType, dictables, function_definition_patterns, get_big_int_128, get_time_ddbobj, get_duration_unit, get_type_name, int1282str, ipaddr2str, is_decimal_null_value, is_decimal_type, time_formatters, number_nulls, nulls, set_big_int_128, uuid2str, get_times_ddbobj, funcdefs, get_number_formatter, urgent } from "./common.js";
|
|
6
|
+
import { ddb_tensor_bytes, DdbChartType, DdbDurationUnit, DdbForm, generate_array_type, DdbFunctionType, DdbType, DdbVoidType, dictables, function_definition_patterns, get_big_int_128, get_time_ddbobj, get_duration_unit, get_type_name, int1282str, ipaddr2str, is_decimal_null_value, is_decimal_type, time_formatters, number_nulls, nulls, set_big_int_128, SqlStandard, uuid2str, get_times_ddbobj, funcdefs, get_number_formatter, urgent } from "./common.js";
|
|
7
7
|
export * from "./common.js";
|
|
8
8
|
/** 可以表示所有 DolphinDB 数据库中的数据类型 Can represent data types in all DolphinDB databases */
|
|
9
9
|
export class DdbObj {
|
|
@@ -2402,13 +2402,6 @@ export class DdbDatabaseError extends Error {
|
|
|
2402
2402
|
this.id = id;
|
|
2403
2403
|
}
|
|
2404
2404
|
}
|
|
2405
|
-
/** SQL Standrd 标准类型 */
|
|
2406
|
-
export var SqlStandard;
|
|
2407
|
-
(function (SqlStandard) {
|
|
2408
|
-
SqlStandard[SqlStandard["DolphinDB"] = 0] = "DolphinDB";
|
|
2409
|
-
SqlStandard[SqlStandard["Oracle"] = 1] = "Oracle";
|
|
2410
|
-
SqlStandard[SqlStandard["MySQL"] = 2] = "MySQL";
|
|
2411
|
-
})(SqlStandard || (SqlStandard = {}));
|
|
2412
2405
|
export class DDB {
|
|
2413
2406
|
/** 当前的 session id (http 或 tcp) */
|
|
2414
2407
|
sid = '0';
|
|
@@ -2434,8 +2427,8 @@ export class DDB {
|
|
|
2434
2427
|
password = '123456';
|
|
2435
2428
|
/** python session flag (2048) */
|
|
2436
2429
|
python = false;
|
|
2437
|
-
/**
|
|
2438
|
-
|
|
2430
|
+
/** q session flag (4096) */
|
|
2431
|
+
q = false;
|
|
2439
2432
|
/** 是否为 dolphindb 语言 */
|
|
2440
2433
|
dolphindb = true;
|
|
2441
2434
|
language = 'dolphindb';
|
|
@@ -2481,7 +2474,7 @@ export class DDB {
|
|
|
2481
2474
|
- username?: DolphinDB 登录用户名,默认 `'admin'` DolphinDB username, default `'admin'`
|
|
2482
2475
|
- password?: DolphinDB 登录密码,默认 `'123456'` DolphinDB password, default `'123456'`
|
|
2483
2476
|
- python?: 设置 python session flag,默认 `false` set python session flag, default `false`
|
|
2484
|
-
-
|
|
2477
|
+
- q?: 设置 q session flag,默认 `false` set q session flag, default `false`
|
|
2485
2478
|
- streaming?: 设置该选项后,该 WebSocket 连接只用于流数据 When this option is set, the WebSocket connection is only used for streaming data
|
|
2486
2479
|
- verbose?: 是否打印每个 rpc 的信息用于调试
|
|
2487
2480
|
- sql?: 设置当前会话执行的 sql 标准, 请使用 SqlStandard 枚举进行传参,默认 `DolphinDB`
|
|
@@ -2512,9 +2505,9 @@ export class DDB {
|
|
|
2512
2505
|
this.dolphindb = false;
|
|
2513
2506
|
this.language = 'python';
|
|
2514
2507
|
}
|
|
2515
|
-
if (options.
|
|
2508
|
+
if (options.q !== undefined && (this.q = Boolean(options.q))) {
|
|
2516
2509
|
this.dolphindb = false;
|
|
2517
|
-
this.language = '
|
|
2510
|
+
this.language = 'q';
|
|
2518
2511
|
}
|
|
2519
2512
|
if (options.sql !== undefined)
|
|
2520
2513
|
this.sql = options.sql;
|
|
@@ -2617,8 +2610,8 @@ export class DDB {
|
|
|
2617
2610
|
// python session
|
|
2618
2611
|
if (this.python)
|
|
2619
2612
|
flag += 2048;
|
|
2620
|
-
//
|
|
2621
|
-
if (this.
|
|
2613
|
+
// q session
|
|
2614
|
+
if (this.q)
|
|
2622
2615
|
flag += 4096;
|
|
2623
2616
|
// sql standrd
|
|
2624
2617
|
flag += 2 ** 19 * this.sql;
|