Skip to content

Add batch() returning per-statement result sets#227

Open
penberg wants to merge 1 commit into
mainfrom
batch-results
Open

Add batch() returning per-statement result sets#227
penberg wants to merge 1 commit into
mainfrom
batch-results

Conversation

@penberg

@penberg penberg commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Implement the per-statement batch() interface from tursodatabase/turso#7343
in both the async (promise.js) and sync (compat.js) Database APIs.

batch(statements, mode?) executes statements sequentially and returns one
ResultSet per input statement, each with columns, columnTypes, rows (with
positional and named access), rowsAffected, lastInsertRowid, and toJSON().
When a transaction mode is provided and the connection is not already in a
transaction, the batch is wrapped in BEGIN/COMMIT and rolled back on failure.

Implement the per-statement batch() interface from tursodatabase/turso#7343
in both the async (promise.js) and sync (compat.js) Database APIs.

batch(statements, mode?) executes statements sequentially and returns one
ResultSet per input statement, each with columns, columnTypes, rows (with
positional and named access), rowsAffected, lastInsertRowid, and toJSON().
When a transaction mode is provided and the connection is not already in a
transaction, the batch is wrapped in BEGIN/COMMIT and rolled back on failure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant