Mon 21 Jul 22:43:21 CEST 2025
This commit is contained in:
parent
8f5adeafc5
commit
727df3335f
13
js/sql/test-sql.js
Normal file
13
js/sql/test-sql.js
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
/** JavaScript Sqlite3 Implementation with raw file system access
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
var Database = require('sqlite3.js');
|
||||||
|
|
||||||
|
var tableName = "newtable";
|
||||||
|
var db = Database('/tmp/test.db');
|
||||||
|
print(db.open())
|
||||||
|
print(db.exec('CREATE TABLE ?? (id INTEGER PRIMARY KEY, name TEXT NOT NULL);', tableName));
|
||||||
|
print(db.exec('INSERT INTO ?? VALUES (null, ?);', tableName, 'John'));
|
||||||
|
print(db.exec('INSERT INTO ?? VALUES (null, ?);', tableName, 'Jane'));
|
||||||
|
print(db.exec('SELECT * FROM ??;', tableName));
|
||||||
|
print(db.exec('SELECT SQLITE_VERSION();'));
|
Loading…
Reference in New Issue
Block a user