SQLite exec() limitation

I understand that the exec() function when using SQLite is limited to a single statement. This is an incredibly useful function for setting up a database from a schema, so I'm wondering how people typically get around this limitation.

Scanning the SQL for ; and splitting on them would work but introduces some limitations I don't know that I want to deal with. Likewise, I'd really like to bind some values.

so it might be limitation of SQLite , at least for the interface Qt is using.

Anyway, i also found
Q_DECLARE_OPAQUE_POINTER(sqlite3*)
Q_DECLARE_METATYPE(sqlite3*)
sqlite* sqlite_handle = database.driver()->handle().value<sqlite3*>();
which should give the native handle.
Disclaimer: not tried :)

『Please use the Topic Tools button to mark as Solved
Upvote the answer(s) that helped you to solve the issue』

@Tewha
Ok. if it works please update here so others know they can be dirty if needed. ;)
I also assume its ok since you only constructs the table so there not be any
housekeeping data altered that could confused Qt.

『Please use the Topic Tools button to mark as Solved
Upvote the answer(s) that helped you to solve the issue』

@Tewha
Does SQLite allow "stored procedures"? Assuming it does, are they allowed to hold CREATE TABLE statements? One possibility, depending on your design, is to factor all these multi-statements into a stored procedure and just call that from your Qt code as a single statement....