mirror of
https://github.com/lancedb/lancedb.git
synced 2026-11-26 20:44:00 +00:00
fix(nodejs): harden table delta reader lifecycle
Make delta readers lazy, single-use, and serialized. Capture schema before polling, cache it for empty and completed streams, and release the native iterator on completion, break, and error. Cover unused rejected readers and early-drop/alias behavior.
This commit is contained in:
@@ -12,9 +12,13 @@ A streaming table-delta reader.
|
||||
range is empty. The stream yields Arrow record batches without
|
||||
materializing the full result.
|
||||
|
||||
A reader owns one native cursor. It is single-use:
|
||||
`[Symbol.asyncIterator]()` returns the same iterator, concurrent pulls are
|
||||
serialized, and `return()` releases the native stream on early drop.
|
||||
|
||||
## Extends
|
||||
|
||||
- `AsyncIterable`<`RecordBatch`>
|
||||
- `AsyncIterable`<`RecordBatch`>.`AsyncIterator`<`RecordBatch`>
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -34,6 +38,46 @@ asyncIterator: AsyncIterator<RecordBatch<any>, any, undefined>
|
||||
|
||||
***
|
||||
|
||||
### next()
|
||||
|
||||
```ts
|
||||
next(...args): Promise<IteratorResult<RecordBatch<any>, any>>
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
* ...**args**: [] \| [`undefined`]
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`IteratorResult`<`RecordBatch`<`any`>, `any`>>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
`AsyncIterator.next`
|
||||
|
||||
***
|
||||
|
||||
### return()?
|
||||
|
||||
```ts
|
||||
optional return(value?): Promise<IteratorResult<RecordBatch<any>, any>>
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
* **value?**: `any`
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`IteratorResult`<`RecordBatch`<`any`>, `any`>>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
`AsyncIterator.return`
|
||||
|
||||
***
|
||||
|
||||
### schema()
|
||||
|
||||
```ts
|
||||
@@ -43,3 +87,23 @@ schema(): Promise<Schema<any>>
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Schema`<`any`>>
|
||||
|
||||
***
|
||||
|
||||
### throw()?
|
||||
|
||||
```ts
|
||||
optional throw(e?): Promise<IteratorResult<RecordBatch<any>, any>>
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
* **e?**: `any`
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`IteratorResult`<`RecordBatch`<`any`>, `any`>>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
`AsyncIterator.throw`
|
||||
|
||||
Reference in New Issue
Block a user