UNPKG

@electric-sql/d2ts

Version:

D2TS is a TypeScript implementation of Differential Dataflow.

59 lines (58 loc) 2.96 kB
import { IStreamBuilder, KeyValue, PipedOperator } from '../../types.js'; import { DifferenceStreamReader, DifferenceStreamWriter, BinaryOperator } from '../../graph.js'; import { Antichain } from '../../order.js'; import { SQLiteDb } from '../database.js'; import { JoinType } from '../../operators/join.js'; export declare class JoinOperatorSQLite<K, V1, V2> extends BinaryOperator<[ K, unknown ]> { #private; constructor(id: number, inputA: DifferenceStreamReader<[K, V1]>, inputB: DifferenceStreamReader<[K, V2]>, output: DifferenceStreamWriter<[K, [V1, V2]]>, initialFrontier: Antichain, db: SQLiteDb); run(): void; } /** * Joins two input streams * Persists state to SQLite * * @param other - The other stream to join with * @param db - Optional SQLite database (can be injected via context) * @param type - The type of join to perform */ export declare function join<K, V1 extends T extends KeyValue<infer _KT, infer VT> ? VT : never, V2, T>(other: IStreamBuilder<KeyValue<K, V2>>, db?: SQLiteDb, type?: JoinType): PipedOperator<T, KeyValue<K, [V1 | null, V2 | null]>>; /** * Joins two input streams * Persists state to SQLite * * @param other - The other stream to join with * @param db - Optional SQLite database (can be injected via context) */ export declare function innerJoin<K, V1 extends T extends KeyValue<infer _KT, infer VT> ? VT : never, V2, T>(other: IStreamBuilder<KeyValue<K, V2>>, db?: SQLiteDb): PipedOperator<T, KeyValue<K, [V1, V2]>>; /** * Performs an anti-join * * @param other - The other stream to join with * @param db - Optional SQLite database (can be injected via context) */ export declare function antiJoin<K, V1 extends T extends KeyValue<infer _KT, infer VT> ? VT : never, V2, T>(other: IStreamBuilder<KeyValue<K, V2>>, db?: SQLiteDb): PipedOperator<T, KeyValue<K, [V1, null]>>; /** * Performs a left join * * @param other - The other stream to join with * @param db - Optional SQLite database (can be injected via context) */ export declare function leftJoin<K, V1 extends T extends KeyValue<infer _KT, infer VT> ? VT : never, V2, T>(other: IStreamBuilder<KeyValue<K, V2>>, db?: SQLiteDb): PipedOperator<T, KeyValue<K, [V1, V2 | null]>>; /** * Performs a right join * * @param other - The other stream to join with * @param db - Optional SQLite database (can be injected via context) */ export declare function rightJoin<K, V1 extends T extends KeyValue<infer _KT, infer VT> ? VT : never, V2, T>(other: IStreamBuilder<KeyValue<K, V2>>, db?: SQLiteDb): PipedOperator<T, KeyValue<K, [V1 | null, V2]>>; /** * Performs a full outer join * * @param other - The other stream to join with * @param db - Optional SQLite database (can be injected via context) */ export declare function fullJoin<K, V1 extends T extends KeyValue<infer _KT, infer VT> ? VT : never, V2, T>(other: IStreamBuilder<KeyValue<K, V2>>, db?: SQLiteDb): PipedOperator<T, KeyValue<K, [V1 | null, V2 | null]>>;