dyedgreen / deno-sqlite

Deno SQLite module
https://deno.land/x/sqlite
MIT License
409 stars 36 forks source link

Add helper for running multiple statements #182

Closed wirelyre closed 2 years ago

wirelyre commented 2 years ago

Hello!

I wanted something like Python's executescript so I looked into porting it.

It turns out that SQLite already has a convenience method for this, sqlite3_exec.

If this had been in the interface, I would have saved quite a bit of time debugging. So I hope this will be merged eventually!

Things left to do

Python's implementation looks like this. I think it's complicated because of threading. It also runs COMMIT first, but I don't think this library has an auto-commit feature.

I didn't commit the WASM myself because my computer didn't make an identical build on master and I didn't want to do it wrong.

wirelyre commented 2 years ago

Great review! :-)

wirelyre commented 2 years ago

Sorry, I tried to rename the branch but GitHub didn't like it.

dyedgreen commented 2 years ago

Awesome work, thank you so much! 😊

I'll merge it once ci passes

wirelyre commented 2 years ago

Thanks!