sqlite-manager-async
v1.0.2
Published
Example:
Downloads
4
Readme
Example:
const fs=require('fs-extra);
const SqliteManager = require('sqlite-manager-async');
async function main(){
const dbPath = path.resolve(__dirname, '../.database');
fs.ensureDirSync(dbPath);
const db = new SqliteManager(path.resolve(dbPath, 'data.db'));
await db.run(`
CREATE TABLE IF NOT EXISTS posts(
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
status NVARCHAR(20),
title NVARCHAR(255) NOT NULL)`);
const res = await db.all(`SELECT * FROM posts`);
console.log(res);
}
main();