sqlite: add StatementSync.prototype.close() and [Symbol.dispose]()#64232
sqlite: add StatementSync.prototype.close() and [Symbol.dispose]()#64232araujogui wants to merge 4 commits into
Conversation
This extends explicit resource management support to prepared statements, allowing a StatementSync to be deterministically finalized via a `using` declaration, mirroring the existing DatabaseSync and Session dispose methods. Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
|
Review requested:
|
|
We are currently finalizing statements when the wrapper is deconstructed after GC. This PR only makes sense if we are going to change this to an explicit "user should finalize statements themselves" model, in which case we should also expose a named |
I think we can support both approaches. I don't see any issue with that. We can either let the GC finalize statements as they are today, or let users finalize them explicitly with a |
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
Honestly, I'm not a fan at all of relying on GC timing. It's too unpredictable and can expose GC timing details (which can be problematic on its own). We originally had |
|
That's the case I had in mind. I don't have a problem with the approach, we just need to be very clear to consumers that the contract is changing. |
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
cb5696c to
9ed6fae
Compare
No description provided.