d2sqlite3
d2sqlite3 copied to clipboard
Prepare many statements from a single string.
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!
It looks like a lot could be simplified and built purely on top of the existing Statement
primitive. Also you should squash the commits.