How to read a sqlite3 database, using node js, synchronously?

There are a few npm packages such as better-sqlite3 and sqlite-sync that allow for synchronous SQLite queries. Here’s an example:

var sqlite = require("better-sqlite3");
var db = new sqlite("example.db");

var rows = db.prepare("SELECT * FROM probes").all();
console.log(rows);

Leave a Comment

tech