From 7c61b08aedfbb90c209a2181e0a85a2afd276c5e 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 PR-URL: https://github.com/nodejs/node/pull/64232 Reviewed-By: René --- doc/api/sqlite.md | 9 +++++ src/node_sqlite.cc | 16 ++++++-- src/node_sqlite.h | 2 + test/parallel/test-sqlite-statement-sync.js | 43 +++++++++++++++++++++ 4 files changed, 66 insertions(+), 4 deletions(-) diff --git a/doc/api/sqlite.md b/doc/api/sqlite.md index 483212a8b4e..25e828c5e38 100644 --- a/doc/api/sqlite.md +++ b/doc/api/sqlite.md @@ -1194,6 +1194,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`