-
-
Notifications
You must be signed in to change notification settings - Fork 402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/clarification: Statement#finalize #356
Comments
Yes, there's no Also, if a database object is cleaned up by the garbage collector, it is automatically closed. |
Thank you for the amazing work you are doing. |
@JoshuaWise Hi I spent a long time looking up how to finalize my statements. I ended up deep down here in a closed issue from 2020 to find the answer (which makes sense). But boy would it have been helpful to have this called out in your docs on Statement, and saved me a lot of time. |
A pull request to improve documentation would be welcome, @kjackson1998 ! |
np. #1310 |
At first I wanted to ask for a
finalize
method on the Statement class.https://sqlite.org/c3ref/finalize.html
But looking at the code I think this is already handled automatically? https://github.com/JoshuaWise/better-sqlite3/blob/18b957249b2891698231493f42e99a20ace5def9/src/objects/statement.lzz#L41-L45
I'm not familiar with the native side of Node at all. Do I interpret that correctly that the destructor handles that and is called when the garbage collector cleans up? So if I assign a new statement to an existing variable (and no other references exist), the old statement will automatically be finalized in SQLite? If this is correct then you can close the issue!
The text was updated successfully, but these errors were encountered: