tursodatabase / libsql

libSQL is a fork of SQLite that is both Open Source, and Open Contributions.
https://turso.tech/libsql
MIT License
9.54k stars 252 forks source link

libsql: Add Statement::run() API #1510

Closed penberg closed 3 months ago

penberg commented 3 months ago

The execute() method returns an error if the query returns rows, which makes it unsuitable for running any type of SQL queries. Similarly, the query() method only works on SQL statements that return rows. Therefore, the run() method is provided to execute any type of SQL statement.

This is needed, for example, for the libSQL JavaScript library that needs to preserve better-sqlite3 semantics.