Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
sqlite-wrapper
Advanced tools
A small wrapper on node-sqlite3 providing simple bindings to most commonly used SQLite functions in standard applications.
npm install sqlite-wrapper
var db = require('sqlite-wrapper')('/tmp/foo.db');
var tableName = 'people';
db.createTable(tableName, {
'id': {
type: 'INTEGER',
primary: true,
notnull: true
},
'name': {
type: 'TEXT',
notnull: true,
unique: true,
default: "'John Doe'"
},
'city_id': {
type: 'INTEGER',
notnull: true,
ref: 'cities'
}
}, callback);
// Single insertion
db.insert(tableName, {
name: 'Donald Knuth',
city_id: 42
}, callback);
// Multiple inserts (bulk)
db.insertAll(tableName, [
{ name: 'Dennis Richie', city_id: 23 },
{ name: 'Bjarne Stoustrup', city_id: 347 }
], callback);
// Update
db.update(tableName, 'name=?', ['Donald Knuth'], {city_id: 378 }, callback);
// Remove
db.remove(tableName, 'city_id=?', ['666'], callback);
// Select
db.select(tableName,
{'cities': 'cities.id=people.city_id' },
{ 'cities.name': 'city_name', 'people.name': 'person_name' },
'people.id IS NOT NULL',
null,
callback,
'people.name DESC',
100,
false
);
// Select with single result
db.selectOne(tableName,
null,
['name'],
'name LIKE ?',
['%Donald%'],
callback
);
// Find by id
db.find(tableName, 3, callback);
// List all elements in table
db.list(tableName, callback);
// Update by id
db.updateById(tableName, 3, { city_id: 42 }, callback);
// OR
db.updateById(tableName, { id: 3, city_id: 42 }, callback);
// Remove by id
db.removeById(tableName, 3, callback);
FAQs
Small wrapper on node-sqlite3
The npm package sqlite-wrapper receives a total of 0 weekly downloads. As such, sqlite-wrapper popularity was classified as not popular.
We found that sqlite-wrapper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.