Closed ospfranco closed 5 months ago
I don't think prepared statements are any faster in libsql so this probably won't make any performance difference.
Interesting, still, I need to reset the statement otherwise I need to do a lot of memory copying every time to create new statements every time. Do you think it is easy to expose a reset function?
I think so. Let me have a look and get back to you.
Let me know @ospfranco if https://github.com/tursodatabase/libsql/pull/1419 would be enough?
I think so
On the original sqlite source you can re-use a statement by calling [sqlite3_reset](https://www.sqlite.org/c3ref/reset.html#:~:text=The%20sqlite3_reset()%20function%20is,()%20to%20reset%20the%20bindings.). This is useful as a performance optimization to speed up already planned queries that only need to re-execute.
Currently there is no way to reset a libsql statement, only free it.
I need the reset function to be able to restart a prepared statement.