How to use the sqlite3.cached function in sqlite3

To help you get started, we’ve selected a few sqlite3 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github briansd9 / exile-diary / modules / DB.js View on Github external
static getDB(startup = false) {

    var settings = require('./settings').get();
    if(!settings) {
      logger.info("No settings file found, can't initialize DB");
      return null;
    }
    if (!settings.activeProfile || !settings.activeProfile.characterName) {
      logger.info("No active profile selected, can't initialize DB");
      return null;
    }

    var app = require('electron').app || require('electron').remote.app;
    
    var db = new sqlite3.cached.Database(path.join(app.getPath("userData"), settings.activeProfile.characterName + ".db"));
    
    if(startup) {
      logger.info(`Initializing database for ${settings.activeProfile.characterName}`);
      this.init(db);
    }

    return db;

  }
github Pita / ueberDB / sqlite_db.js View on Github external
function(callback)
    {
      _this.db = new sqlite3.cached.Database(_this.settings.filename, callback);
    },
    function(callback)
github sipcapture / paStash / lib / filters / filter_app_hsp.js View on Github external
FilterAppHsp.prototype.start = function(callback) {

  if (this.sqlite_db) { 
	sqlite = new sqlite3.cached.Database(this.sqlite_db);
  	logger.info('Initializing App HSP SQLITE:',this.sqlite_db);
  }
  if (this.strip_local) { 
	this.strip_local = new RegExp(this.strip_local); 
  	logger.info('Initializing App HSP RegExp:',this.strip_local);
  } 
  if (this.strip_dialprefix) { 
	this.strip_dialprefix = new RegExp(this.strip_dialprefix); 
  	logger.info('Initializing App HSP RegExp:',this.strip_dialprefix);
  } 
  if (this.strip_testuser) { 
	this.strip_testuser = new RegExp(this.strip_testuser); 
  	logger.info('Initializing App HSP RegExp:',this.strip_testuser);
  } 

  if (this.hepic_token){

sqlite3

Asynchronous, non-blocking SQLite3 bindings

BSD-3-Clause
Latest version published 12 months ago

Package Health Score

81 / 100
Full package analysis