From 5652da642da4417030feff441699fae2500ba0b3 Mon Sep 17 00:00:00 2001 From: Colin Ihrig Date: Wed, 19 Mar 2025 13:01:16 -0400 Subject: [PATCH] sqlite: add DatabaseSync.prototype.isOpen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds a getter to indicate whether or not the database is currently open. Fixes: https://github.com/nodejs/node/issues/57521 PR-URL: https://github.com/nodejs/node/pull/57522 Reviewed-By: Ulises Gascón Reviewed-By: Edy Silva Reviewed-By: Chemi Atlow Reviewed-By: Tobias Nießen Reviewed-By: Michaël Zasso --- doc/api/sqlite.md | 8 ++++++++ src/node_sqlite.cc | 10 ++++++++++ src/node_sqlite.h | 1 + test/parallel/test-sqlite-database-sync.js | 9 +++++++++ 4 files changed, 28 insertions(+) diff --git a/doc/api/sqlite.md b/doc/api/sqlite.md index b07927a90f6..e6524095093 100644 --- a/doc/api/sqlite.md +++ b/doc/api/sqlite.md @@ -192,6 +192,14 @@ added: v23.5.0 This method is used to create SQLite user-defined functions. This method is a wrapper around [`sqlite3_create_function_v2()`][]. +### `database.isOpen` + + + +* {boolean} Whether the database is currently open or not. + ### `database.open()`