@junsiklee/vscode-sqlite3
v5.1.7-vscode.23
Published
Vscode Extension, Asynchronous, non-blocking SQLite3 bindings
Downloads
11
Readme
⚙️ @junsiklee/vscode-sqlite3
Installing
You can use npm
or yarn
to install @junsiklee/vscode-sqlite3
:
- (recommended) Latest published package:
npm install @junsiklee/vscode-sqlite3
# or
yarn add @junsiklee/vscode-sqlite3
Add a string to the .vscodeignore file inside the vscode extension project
!node_modules/@junsiklee/vscode-sqlite3/**/**/**
Example code
const sqlite3 = require('@junsiklee/vscode-sqlite3').verbose();
const db = new sqlite3.Database(':memory:');
db.serialize(() => {
db.run('CREATE TABLE lorem (info TEXT)');
const stmt = db.prepare('INSERT INTO lorem VALUES (?)');
for (let i = 0; i < 10; i++) {
stmt.run('Ipsum ' + i);
}
stmt.finalize();
db.each('SELECT rowid AS id, info FROM lorem', (err: any, row: any) => {
console.log(row.id + ': ' + row.info);
});
});
db.close();