dolphindb 3.0.113 → 3.0.114

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 CHANGED
@@ -549,6 +549,11 @@ export declare function int1282str(buffer: Uint8Array, le?: boolean): string;
549
549
  export interface StreamingParams {
550
550
  table: string;
551
551
  action?: string;
552
+ /** offset 是订阅任务开始后的第一条消息所在的位置。消息是流数据表中的行。
553
+ 如果未指定,或设为-1,订阅将会从流数据表的当前行开始。
554
+ 如果 offset = -2,系统会获取持久化到磁盘上的 offset,并从该位置开始订阅。注意:须同时设置 persistOffset = true,offset = -2 才会生效;否则 offset 会变为 -1。
555
+ offset 与流数据表创建时的第一行对应。如果某些行因为内存限制被删除,在决定订阅开始的位置时,这些行仍然考虑在内。 */
556
+ offset?: number;
552
557
  filters?: {
553
558
  /** 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 */
554
559
  column?: DdbObj;
package/browser.js CHANGED
@@ -3330,10 +3330,10 @@ export class DDB {
3330
3330
  new DdbInt(0),
3331
3331
  this.streaming.table,
3332
3332
  (this.streaming.action ||= `api_js_${new Date().getTime()}`),
3333
- ...this.streaming?.filters?.column ? [
3334
- new DdbVoid(), // offset
3335
- this.streaming.filters.column // filter
3336
- ] : []
3333
+ (this.streaming.offset === undefined || this.streaming.offset === null)
3334
+ ? new DdbVoid()
3335
+ : new DdbInt(this.streaming.offset), // offset
3336
+ this.streaming.filters?.column || new DdbVoid(), // filter
3337
3337
  ], {
3338
3338
  skip_connection_check: true,
3339
3339
  // 先准备好收到 websocket message 的 callback