On 2018/05/30 3:33 PM, Simon Slavin wrote:
On 30 May 2018, at 2:30pm, Simon Slavin <slav...@bigfraud.org> wrote:
Does SQLite perform the whole _exec() in one transaction or each command in a
separate transaction ?
Subsidiary question:
Does SQLite parse the entire string of commands for a syntax error first,
triggering an error if anything is wrong before executing the first command ?
Or does it execute the first command, then parse the next part of the string
for a command ?
I'm obviously not a Dev, so this is what usage & testing on my part
suggests when I tried to figure out the same long ago:
- There is no implicit transaction.
- Every Item is parsed separately and in-turn.
It's much like the EXEC command follows this pseudo code:
while (inputStr != "") {
fetch next string section up to next ";" or end of input, whichever
comes first;
process this section as a new SQL command;
remove this section from inputStr;
};
Also, in case you are wondering, it seems there is not much penalty
either way - using your own list and preparing and executing each query
seems much the same speed-wise as feeding the entire list of SQL queries
to the EXEC command.
This obviously changes significantly the minute you start using
multi-iteratable queries with bindings. (Let's imagine multi-iterable
is a real word for a sec.) :)
Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users