I got the use-case of loading a sql file that sets up tables and triggers and run it against an in-memory database. Essentially for unit testing.
In the current version it's not easily possible to load a sql file and execute it against a sqlite3 database as the call to sqlite3_prepare only prepares the first sql statement in the string.
My approach is to simply call exec with the remaining statements if there is stuff left in the string. It's not the most elegant way but works.
I got the use-case of loading a sql file that sets up tables and triggers and run it against an in-memory database. Essentially for unit testing.
In the current version it's not easily possible to load a sql file and execute it against a sqlite3 database as the call to sqlite3_prepare only prepares the first sql statement in the string.
My approach is to simply call exec with the remaining statements if there is stuff left in the string. It's not the most elegant way but works.