Commit Detail
Commit c9190db
SQLite: Add prepareMulti(), which prepares a statement that can be multiple statements. `prepare()` does not allow you to pass code that contains multiple statements (separated by semicolons). Extending it to allow this isn't straightforward, because later statements in the block might not be possible to parse if earlier statements haven't yet executed. For example, the first statement might create a table, and the next statement might insert into it. If you try to parse each statement before executing any of them, SQLite will throw an error on the second statement, because the table it's trying to insert into doesn't exist. To support a multi-statement prepare, we must change the contract such that the whole thing is parsed lazily, on the first actual execution. This is needed in order to support caching of prepared statements behind `exec()`, since `exec()` supports passing multiple statements at once.
Files changed
3 files changed~3 modified