kentkwu opened a new issue, #4090:
URL: https://github.com/apache/arrow-adbc/issues/4090

   ### What feature or improvement would you like to see?
   
   The AdbcConnection TypeScript interface is intended to provide a high level 
ergonomic API on top of the core ADBC spec.
   
   Currently these expose `RecordBatchReader`, which requires manually 
consuming batches. Most TypeScript database clients (pg, Drizzle, 
better-sqlite3) return materialized data by default and treat streaming as an 
advanced opt-in and I propose we do the same.
   
   Proposed changes:
     - `query()` → `Table` (materialized by default)
     - `queryStream()` → RecordBatchReader (explicit streaming opt-in)
     - `getObjects()`, `getTableTypes()`, `getInfo()` → `Table`
   
   I propose keeping the default high level API to only expose fully 
materialized arrow-js `Table` objects. Users can always drop down to the 
statement-level API for more advanced use cases.
   
   ### Before
   ```ts
     const reader = await conn.query('SELECT * FROM games')
     const batches = []
     for await (const batch of reader) {
       batches.push(batch)
     }
     const table = new Table(batches)
   ```
   
   ### After
   ```ts
     // most common usage
     const table = await conn.query('SELECT * FROM games')
   
     // or, using queryStream for large result sets:
     const reader = await conn.queryStream('SELECT * FROM games')
     const batches = []
     for await (const batch of reader) {
       batches.push(batch)
     }
     const table = new Table(batches)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to