GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — sqlite: add sqlite-type symbol for DatabaseSync · nodejs/node@e7084df

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • node_sqlite.cc
  • test/parallel
    • test-sqlite-database-sync.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node_sqlite.cc‎

Copy file name to clipboardExpand all lines: src/node_sqlite.cc
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2741,6 +2741,13 @@ static void Initialize(Local<Object> target,
27412741
db_tmpl,
27422742
FIXED_ONE_BYTE_STRING(isolate, "isTransaction"),
27432743
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+
27442751
SetConstructorFunction(context, target, "DatabaseSync", db_tmpl);
27452752
SetConstructorFunction(context,
27462753
target,
Collapse file

‎test/parallel/test-sqlite-database-sync.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-sqlite-database-sync.js
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,15 @@ suite('DatabaseSync() constructor', () => {
281281
{ changes: 1, lastInsertRowid: 1 },
282282
);
283283
});
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+
});
284293
});
285294

286295
suite('DatabaseSync.prototype.open()', () => {

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.