d2sqlite3 icon indicating copy to clipboard operation
d2sqlite3 copied to clipboard

Prepare many statements from a single string.

Open cyisfor opened this issue 4 years ago • 1 comments

sqlite3_prepare_v2 provides a tail parameter, and I figured out the trick with it a while ago. It sets tail to the point that it stops being able to parse, which is helpful for showing where your error is in your SQL statement, but it's also helpful for parsing multiple SQL statements. sqlite3_prepare only prepares the first, then "fails" at the beginning of the second statement right after the semicolon, which lets one prepare many statements from a single string. So that's what I did. Hope you like it!

cyisfor avatar Jul 01 '20 07:07 cyisfor

It looks like a lot could be simplified and built purely on top of the existing Statement primitive. Also you should squash the commits.

Geod24 avatar Jul 29 '20 09:07 Geod24