diff --git a/cpp/DBHostObject.cpp b/cpp/DBHostObject.cpp index 2e29a95..b6feeb9 100644 --- a/cpp/DBHostObject.cpp +++ b/cpp/DBHostObject.cpp @@ -32,8 +32,8 @@ void DBHostObject::flush_pending_reactive_queries( std::shared_ptr> metadata = std::make_shared>(); - auto status = opsqlite_execute_prepared_statement(db, query->stmt, - &results, metadata); + auto status = opsqlite_execute_prepared_statement(db, query->stmt, &results, + metadata); if (status.type == SQLiteError) { invoker->invokeAsync( @@ -892,8 +892,14 @@ void DBHostObject::set(jsi::Runtime &rt, const jsi::PropNameID &name, throw std::runtime_error("You cannot write to this object!"); } -void DBHostObject::invalidate() { invalidated = true; } +void DBHostObject::invalidate() { + invalidated = true; + opsqlite_close(db); +} -DBHostObject::~DBHostObject() { invalidated = true; } +DBHostObject::~DBHostObject() { + invalidated = true; + opsqlite_close(db); +} } // namespace opsqlite diff --git a/example/src/App.tsx b/example/src/App.tsx index b29e57b..c78c1b8 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -39,13 +39,13 @@ export default function App() { useEffect(() => { runTests( queriesTests, - // dbSetupTests, - // blobTests, + dbSetupTests, + blobTests, // registerHooksTests, - // preparedStatementsTests, - // constantsTests, + preparedStatementsTests, + constantsTests, // reactiveTests, - // tokenizerTests, + tokenizerTests, ) .then(results => { setServerResults(results as any);