SqlStream.ts
SqlStream.ts overview
Section titled “SqlStream.ts overview”Low-level helpers for adapting push-based SQL row sources into Effect streams.
SQL drivers often expose large query results through cursors, event emitters,
or driver-specific streams that push rows as they arrive. This module
provides the small interop layer used by SQL integrations to turn those
producers into Stream values for Statement.stream and
Connection.executeStream, so callers can process large result sets
incrementally instead of materializing every row in memory.
Since v4.0.0
Exports Grouped by Category
Section titled “Exports Grouped by Category”constructors
Section titled “constructors”asyncPauseResume
Section titled “asyncPauseResume”Creates a stream from a callback-style producer with pause and resume callbacks that are triggered when the internal queue applies backpressure.
Signature
declare const asyncPauseResume: <A, E = never, R = never>( register: (emit: { readonly single: (item: A) => void readonly array: (arr: ReadonlyArray<A>) => void readonly fail: (error: E) => void readonly end: () => void }) => Effect.Effect<{ onPause(): void; onResume(): void }, E, R | Scope.Scope>, bufferSize?: number) => Stream.Stream<A, E, R>Since v4.0.0