dolphindb 2.0.1014 → 2.0.1016
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 +2 -0
- package/browser.js +8 -2
- package/browser.js.map +1 -1
- package/docs.en.json +9614 -526
- package/docs.zh.json +5541 -847
- package/index.d.ts +2 -0
- package/index.js +8 -2
- package/index.js.map +1 -1
- package/package.json +7 -7
- package/test.js +9 -2
- package/test.js.map +1 -1
package/index.d.ts
CHANGED
|
@@ -329,6 +329,8 @@ export interface StreamingMessage extends StreamingParams {
|
|
|
329
329
|
/** message id */
|
|
330
330
|
id: bigint;
|
|
331
331
|
colnames: string[];
|
|
332
|
+
/** 最新的 server 有可能先推一个 table schema 过来 */
|
|
333
|
+
schema?: DdbTableObj;
|
|
332
334
|
/** 订阅主题,即一个订阅的名称。 Subscription topic, which is the name of a subscription.
|
|
333
335
|
它是一个字符串,由订阅表所在节点的别名、流数据表名称和订阅任务名称(如果指定了 actionName)组合而成,使用 `/` 分隔
|
|
334
336
|
It is a string consisting of the alias of the node where the subscription table is located, the stream data table name, and the subscription task name (if actionName is specified), separated by `/` */
|
package/index.js
CHANGED
|
@@ -2034,7 +2034,7 @@ export function nanotimestamp2str(nanotimestamp, format = 'YYYY.MM.DD HH:mm:ss.S
|
|
|
2034
2034
|
assert(i_nanosecond_start !== -1, t('格式串必须包含纳秒的格式 (SSSSSSSSS)'));
|
|
2035
2035
|
const remainder = nanotimestamp % 1000000000n;
|
|
2036
2036
|
const borrow = remainder < 0n;
|
|
2037
|
-
const ms = Number(nanotimestamp / 1000000n);
|
|
2037
|
+
const ms = Number((nanotimestamp - remainder + (borrow ? -1000000000n : 0n)) / 1000000n);
|
|
2038
2038
|
return (dayjs(_datetime_formatter.format(new Date(ms))).format(format.slice(0, i_second_end)) +
|
|
2039
2039
|
format.slice(i_second_end, i_nanosecond_start) +
|
|
2040
2040
|
String(borrow ?
|
|
@@ -2657,14 +2657,19 @@ export class DDB {
|
|
|
2657
2657
|
rows: 0,
|
|
2658
2658
|
segments: [],
|
|
2659
2659
|
};
|
|
2660
|
+
let schema;
|
|
2660
2661
|
// 先准备好收到 websocket message 的 callback
|
|
2661
2662
|
this.on_message = buffer => {
|
|
2662
2663
|
try {
|
|
2663
2664
|
const dv = new DataView(buffer);
|
|
2664
2665
|
const buf = new Uint8Array(buffer);
|
|
2665
2666
|
const i_topic_end = buf.indexOf(0, 17);
|
|
2666
|
-
//
|
|
2667
|
+
// 首个 message 可能是 table schema, 后续消息是 column 片段组成的 any vector
|
|
2667
2668
|
const data = DdbObj.parse(buf.subarray(i_topic_end + 1), this.le);
|
|
2669
|
+
if (data.form === DdbForm.table) {
|
|
2670
|
+
schema = data;
|
|
2671
|
+
return;
|
|
2672
|
+
}
|
|
2668
2673
|
const { rows } = data.value[0];
|
|
2669
2674
|
win.rows += rows;
|
|
2670
2675
|
win.segments.push(data);
|
|
@@ -2685,6 +2690,7 @@ export class DDB {
|
|
|
2685
2690
|
rows,
|
|
2686
2691
|
topic: this.dec.decode(buf.subarray(17, i_topic_end)),
|
|
2687
2692
|
colnames,
|
|
2693
|
+
schema,
|
|
2688
2694
|
data,
|
|
2689
2695
|
window: win,
|
|
2690
2696
|
});
|