How to use the sqlite3.READ_ONLY 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 xixilive / chinese_regions_db / dump.js View on Github external
r.c = rows.filter(function(s){
          return s.parent_id == r.i;
        }).map(simplify);
        if(r.c.length == 0) delete r.c;
        return r;
      });

      fs.writeFileSync('json/'+p.id+'.json', JSON.stringify(regions));
    });

    fs.writeFileSync('json/last-updated-at', new Date().toString());
    console.log("data dumping ok.\n");
  }

  var sqlite3 = require('sqlite3'), db;
  db = new sqlite3.Database(db_file, sqlite3.READ_ONLY);
  db.all("select * from `regions` order by `id` ASC", dump);
  db.close();
})('regions.db');

sqlite3

Asynchronous, non-blocking SQLite3 bindings

BSD-3-Clause
Latest version published 12 months ago

Package Health Score

81 / 100
Full package analysis