Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function wrappedSQLiteDatabase (name) {
const db = new SQLiteDatabase(name);
if (CFG.sqlBusyTimeout) {
db._db.configure('busyTimeout', CFG.sqlBusyTimeout); // Default is 1000
}
if (CFG.sqlTrace) {
db._db.configure('trace', CFG.sqlTrace);
}
if (CFG.sqlProfile) {
db._db.configure('profile', CFG.sqlProfile);
}
return db;
}
const nodeWebSQL = customOpenDatabase(wrappedSQLiteDatabase);
export default nodeWebSQL;
import customOpenDatabase from 'websql/custom'
import SQLiteDatabase from './SQLiteDatabase'
var openDB = customOpenDatabase(SQLiteDatabase)
function SQLitePlugin() {}
function openDatabase(name, version, description, size, callback) {
if (name && typeof name === 'object') {
// accept SQLite Plugin 1-style object here
callback = version
size = name.size
description = name.description
version = name.version
name = name.name
}
if (!size) {
size = 1
}
if (!description) {
import customOpenDatabase from 'websql/custom';
import SQLiteDatabase from './SQLiteDatabase';
var openDB = customOpenDatabase(SQLiteDatabase);
function SQLitePlugin() {
}
function openDatabase(name, version, description, size, callback) {
if (name && typeof name === 'object') {
// accept SQLite Plugin 1-style object here
callback = version;
size = name.size;
description = name.description;
version = name.version;
name = name.name;
}
if (!size) {
size = 1;
}
function wrappedSQLiteDatabase (name) {
const db = new SQLiteDatabase(name);
if (CFG.sqlBusyTimeout) {
db._db.configure('busyTimeout', CFG.sqlBusyTimeout); // Default is 1000
}
if (CFG.sqlTrace) {
db._db.configure('trace', CFG.sqlTrace);
}
if (CFG.sqlProfile) {
db._db.configure('profile', CFG.sqlProfile);
}
return db;
}
return function openDB(opts) {
return openDatabase(opts.name, opts.version, opts.description, opts.size);
};
}