We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e964c43 commit e7084dfCopy full SHA for e7084df
2 files changed
src/node_sqlite.cc
@@ -2741,6 +2741,13 @@ static void Initialize(Local<Object> target,
2741
db_tmpl,
2742
FIXED_ONE_BYTE_STRING(isolate, "isTransaction"),
2743
DatabaseSync::IsTransactionGetter);
2744
+ Local<String> sqlite_type_key = FIXED_ONE_BYTE_STRING(isolate, "sqlite-type");
2745
+ Local<v8::Symbol> sqlite_type_symbol =
2746
+ v8::Symbol::For(isolate, sqlite_type_key);
2747
+ Local<String> database_sync_string =
2748
+ FIXED_ONE_BYTE_STRING(isolate, "node:sqlite");
2749
+ db_tmpl->InstanceTemplate()->Set(sqlite_type_symbol, database_sync_string);
2750
+
2751
SetConstructorFunction(context, target, "DatabaseSync", db_tmpl);
2752
SetConstructorFunction(context,
2753
target,
test/parallel/test-sqlite-database-sync.js
@@ -281,6 +281,15 @@ suite('DatabaseSync() constructor', () => {
281
{ changes: 1, lastInsertRowid: 1 },
282
);
283
});
284
285
+ test('has sqlite-type symbol property', (t) => {
286
+ const dbPath = nextDb();
287
+ const db = new DatabaseSync(dbPath);
288
+ t.after(() => { db.close(); });
289
290
+ const sqliteTypeSymbol = Symbol.for('sqlite-type');
291
+ t.assert.strictEqual(db[sqliteTypeSymbol], 'node:sqlite');
292
+ });
293
294
295
suite('DatabaseSync.prototype.open()', () => {
0 commit comments