dolphindb 2.0.1027 → 2.0.1028
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 +6 -0
- package/browser.js +4 -1
- package/browser.js.map +1 -1
- package/index.d.ts +6 -0
- package/index.js +4 -1
- package/index.js.map +1 -1
- package/package.json +2 -2
package/browser.d.ts
CHANGED
|
@@ -330,6 +330,12 @@ export declare function int1282str(buffer: Uint8Array, le?: boolean): string;
|
|
|
330
330
|
export interface StreamingParams {
|
|
331
331
|
table: string;
|
|
332
332
|
action?: string;
|
|
333
|
+
filters?: {
|
|
334
|
+
/** https://docs.dolphindb.cn/zh/help/FunctionsandCommands/FunctionReferences/s/subscribeTable.html#:~:text=%E8%BF%9E%E6%8E%A5%E6%96%B0%E7%9A%84%20leader%E3%80%82-,filter%20%E5%8F%82%E6%95%B0%E9%9C%80%E8%A6%81%E9%85%8D%E5%90%88,-setStreamTableFilterColumn%20%E5%87%BD%E6%95%B0%E4%B8%80%E8%B5%B7 */
|
|
335
|
+
column?: DdbObj;
|
|
336
|
+
/** 过滤条件的 DolphinDB 表达式 https://dolphindb1.atlassian.net/wiki/spaces/dev/pages/760840447/WebSocketConsole */
|
|
337
|
+
expression?: string;
|
|
338
|
+
};
|
|
333
339
|
handler(message: StreamingMessage): any;
|
|
334
340
|
}
|
|
335
341
|
export interface StreamingMessage extends StreamingParams {
|
package/browser.js
CHANGED
|
@@ -2291,8 +2291,11 @@ export class DDB {
|
|
|
2291
2291
|
reject(this.error /* 一定有,不需要再 || new DdbConnectionError(this) */);
|
|
2292
2292
|
};
|
|
2293
2293
|
try {
|
|
2294
|
+
let url = new URL(this.url);
|
|
2295
|
+
if (this.streaming?.filters?.expression)
|
|
2296
|
+
url.searchParams.set('filter', this.streaming.filters.expression.trim());
|
|
2294
2297
|
// 连接建立之前应该不会有别的调用占用 this.lwebsocket
|
|
2295
|
-
this.lwebsocket.resource = await connect_websocket(
|
|
2298
|
+
this.lwebsocket.resource = await connect_websocket(url, {
|
|
2296
2299
|
protocols: this.streaming ? ['streaming'] : this.python ? ['python'] : undefined,
|
|
2297
2300
|
on_message: (buffer, websocket) => {
|
|
2298
2301
|
this.on_message(new Uint8Array(buffer), websocket);
|