New test for sqlite sessions
This commit is contained in:
parent
1c9af289cd
commit
ecbe2863fa
4 changed files with 137 additions and 0 deletions
16
Smoke/nodejs-sqlite/sqlite.js
Normal file
16
Smoke/nodejs-sqlite/sqlite.js
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
const { DatabaseSync } = require('node:sqlite');
|
||||
const database = new DatabaseSync(':memory:');
|
||||
|
||||
database.exec(`
|
||||
CREATE TABLE data(
|
||||
key INTEGER PRIMARY KEY,
|
||||
value TEXT
|
||||
) STRICT
|
||||
`);
|
||||
const insert = database.prepare('INSERT INTO data (key, value) VALUES (?, ?)');
|
||||
|
||||
insert.run(1, 'hello');
|
||||
insert.run(2, 'world');
|
||||
const query = database.prepare('SELECT * FROM data ORDER BY key');
|
||||
|
||||
console.log(query.all());
|
||||
Loading…
Add table
Add a link
Reference in a new issue