diff options
author | 2022-08-12 17:47:01 +0800 | |
---|---|---|
committer | 2022-08-12 02:47:01 -0700 | |
commit | bcc4580cdceece582a776fc9fb3de1cc78c2b2aa (patch) | |
tree | 0097df6a7e7e9a998fbcb8697e486efa0240cec0 /src/bun.js/bindings/sqlite/JSSQLStatement.h | |
parent | dba3aaedab5bb85e3ab13371e9d8484945c049f8 (diff) | |
download | bun-bcc4580cdceece582a776fc9fb3de1cc78c2b2aa.tar.gz bun-bcc4580cdceece582a776fc9fb3de1cc78c2b2aa.tar.zst bun-bcc4580cdceece582a776fc9fb3de1cc78c2b2aa.zip |
invalidate column name caches when the schema of table may change (#1056)
Diffstat (limited to 'src/bun.js/bindings/sqlite/JSSQLStatement.h')
-rw-r--r-- | src/bun.js/bindings/sqlite/JSSQLStatement.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/bun.js/bindings/sqlite/JSSQLStatement.h b/src/bun.js/bindings/sqlite/JSSQLStatement.h index 6bf830ee2..3dbb7eff0 100644 --- a/src/bun.js/bindings/sqlite/JSSQLStatement.h +++ b/src/bun.js/bindings/sqlite/JSSQLStatement.h @@ -47,6 +47,13 @@ namespace WebCore { +class VersionSqlite3 { +public: + explicit VersionSqlite3(sqlite3* db) : db(db), version(0) {} + sqlite3* db; + std::atomic<uint64_t> version; +}; + class JSSQLStatementConstructor final : public JSC::JSFunction { public: using Base = JSC::JSFunction; @@ -71,7 +78,8 @@ public: return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); } - Vector<sqlite3*> databases; + Vector<VersionSqlite3*> databases; + Vector<std::atomic<uint64_t>> schema_versions; private: JSSQLStatementConstructor(JSC::VM& vm, NativeExecutable* native, JSGlobalObject* globalObject, JSC::Structure* structure) |