UNPKG

@electric-sql/d2ts

Version:

D2TS is a TypeScript implementation of Differential Dataflow.

22 lines (21 loc) 950 B
import { PipedOperator } from '../../types.js'; import { DifferenceStreamReader, DifferenceStreamWriter, UnaryOperator } from '../../graph.js'; import { Antichain } from '../../order.js'; import { SQLiteDb } from '../database.js'; /** * Operator that buffers collections at each version, persisting state to SQLite * Ensures that completed versions are sent to the output as a whole, and in order */ export declare class BufferOperatorSQLite<T> extends UnaryOperator<T> { #private; constructor(id: number, inputA: DifferenceStreamReader<T>, output: DifferenceStreamWriter<T>, initialFrontier: Antichain, db: SQLiteDb); run(): void; } /** * Buffers the elements in the stream * Ensures that completed versions are sent to the output as a whole, and in order * Persists state to SQLite * * @param db - Optional SQLite database (can be injected via context) */ export declare function buffer<T>(db?: SQLiteDb): PipedOperator<T, T>;