tursodatabase / libsql-client-ts

TypeScript/JavaScript client API for libSQL
https://docs.turso.tech/sdk/ts/quickstart
MIT License
226 stars 32 forks source link

Add `executeMultiple()` #43

Closed honzasp closed 1 year ago

honzasp commented 1 year ago

Add a new executeMultiple() method to Client and Transaction. This method accepts a string with SQL statements separated by semicolons, and does not support parameters and does not return any rows.

Client.executeMultiple() opens a new database connection and executes the statements on them. It does not open a transaction, but the SQL script can contain transaction-control statements such as BEGIN and COMMIT. If a statement fails, further statements are not executed.

Transaction.executeMultiple() executes the statements in the database connection that belongs to the transaction. If a statement fails, further statements are not executed, but the transaction is not rolled back.