From 3f967fc3edf0d610133be4f0ddebef12f9abecd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilherme=20Ara=C3=BAjo?= Date: Wed, 1 Jul 2026 11:18:34 -0300 Subject: [PATCH] sqlite: add StatementSync.prototype[Symbol.dispose]() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- doc/api/sqlite.md | 9 +++++ src/node_sqlite.cc | 20 ++++++++-- src/node_sqlite.h | 2 + test/parallel/test-sqlite-statement-sync.js | 43 +++++++++++++++++++++ 4 files changed, 70 insertions(+), 4 deletions(-) diff --git a/doc/api/sqlite.md b/doc/api/sqlite.md index 850358ff43aa86..e4830b9835dd0d 100644 --- a/doc/api/sqlite.md +++ b/doc/api/sqlite.md @@ -1202,6 +1202,15 @@ added: v22.5.0 The source SQL text of the prepared statement. This property is a wrapper around [`sqlite3_sql()`][]. +### `statement[Symbol.dispose]()` + + + +Finalizes the prepared statement. If the prepared statement is already +finalized, then this is a no-op. + ## Class: `SQLTagStore`