diff --git a/bindings/nodejs/index.d.ts b/bindings/nodejs/index.d.ts index e5cc68b5..1b43bc93 100644 --- a/bindings/nodejs/index.d.ts +++ b/bindings/nodejs/index.d.ts @@ -72,6 +72,11 @@ export declare class RowIterator { * Returns `None` if there are no more rows. */ next(): Promise + /** + * Return a Readable Stream for the query result. + * Should be used with `ObjectMode` set to `true`. + */ + stream(): import('stream').Readable } export declare class RowIteratorExt { schema(): Schema diff --git a/bindings/nodejs/src/lib.rs b/bindings/nodejs/src/lib.rs index a06b06de..6191216d 100644 --- a/bindings/nodejs/src/lib.rs +++ b/bindings/nodejs/src/lib.rs @@ -365,6 +365,13 @@ impl RowIterator { .map_err(format_napi_error) }) } + + /// Return a Readable Stream for the query result. + /// Should be used with `ObjectMode` set to `true`. + #[napi(ts_return_type = "import('stream').Readable")] + pub fn stream(&self) -> () { + unreachable!() + } } #[napi]