Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "aa-sqlite3", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "async await with sqlite3", | ||
@@ -5,0 +5,0 @@ "main": "aa-sqlite3.js", |
@@ -51,4 +51,6 @@ # [aa-sqlite3](https://www.npmjs.com/package/aa-sqlite3) - npm | ||
await db.run('INSERT INTO users(name, age) VALUES($name, $age)', { $name: 'Kaz', $age: 57 }); | ||
await db.run('INSERT INTO users(name, age) VALUES(?, ?)', 'Leo', 13); | ||
await db.run('INSERT INTO users(name, age) VALUES($name, $age)', | ||
{ $name: 'Kaz', $age: 57 }); | ||
await db.run('INSERT INTO users(name, age) VALUES(?, ?)', | ||
'Leo', 13); | ||
@@ -58,3 +60,4 @@ const rows = await db.all('SELECT * FROM users'); | ||
const row = await db.get('SELECT * FROM users WHERE name = $name', { $name: 'Leo' }); | ||
const row = await db.get('SELECT * FROM users WHERE name = $name', | ||
{ $name: 'Leo' }); | ||
console.log('db.get: ->', row); | ||
@@ -110,3 +113,4 @@ | ||
await db.exec('DROP TABLE IF EXISTS users'); | ||
await db.exec('CREATE TABLE IF NOT EXISTS users(name TEXT PRIMARY KEY, age INTEGER) WITHOUT rowid'); | ||
await db.exec('CREATE TABLE IF NOT EXISTS users' + | ||
'(name TEXT PRIMARY KEY, age INTEGER) WITHOUT rowid'); | ||
await db.exec('CREATE INDEX IF NOT EXISTS users_ix01 ON users(name, age)'); | ||
@@ -122,3 +126,4 @@ | ||
const row = await db.get('SELECT * FROM users WHERE name = $name', { $name: 'Leo' }); | ||
const row = await db.get('SELECT * FROM users WHERE name = $name', | ||
{ $name: 'Leo' }); | ||
console.log(' Database.get: ->', row); | ||
@@ -125,0 +130,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13953
252