From d2f264f30c1d2dde7d6b798a5796f6d452e8a291 Mon Sep 17 00:00:00 2001 From: missinglink Date: Wed, 20 Oct 2021 16:15:40 +0200 Subject: [PATCH] feat(sqlite): use better-sqlite "unsafe" mode for all import APIs --- api/oa.js | 1 + api/osm.js | 1 + api/polyline.js | 1 + api/tiger.js | 1 + api/vertices.js | 2 +- 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/api/oa.js b/api/oa.js index a8116aeb..8e035535 100644 --- a/api/oa.js +++ b/api/oa.js @@ -8,6 +8,7 @@ function oa(dataStream, addressDbPath, streetDbPath, done){ // connect to db const db = new Database(addressDbPath); + db.unsafeMode(true); query.configure(db); // configure database query.tables.address(db); // create tables only if not already created diff --git a/api/osm.js b/api/osm.js index 63f987c1..0bc28e2f 100644 --- a/api/osm.js +++ b/api/osm.js @@ -8,6 +8,7 @@ function osm(dataStream, addressDbPath, streetDbPath, done){ // connect to db const db = new Database(addressDbPath); + db.unsafeMode(true); query.configure(db); // configure database query.tables.address(db); // create tables only if not already created diff --git a/api/polyline.js b/api/polyline.js index d95f155e..eaa25d64 100644 --- a/api/polyline.js +++ b/api/polyline.js @@ -8,6 +8,7 @@ function polyline(dataStream, streetDbPath, done){ // connect to db const db = new Database(streetDbPath); + db.unsafeMode(true); query.configure(db); // configure database query.tables.street(db, true); // reset database and create tables diff --git a/api/tiger.js b/api/tiger.js index f82b75d1..002de77d 100644 --- a/api/tiger.js +++ b/api/tiger.js @@ -8,6 +8,7 @@ function tiger(dataStream, addressDbPath, streetDbPath, done){ // connect to db var db = new Database( addressDbPath ); + db.unsafeMode(true); query.configure(db); // configure database query.tables.address(db); // create tables only if not already created diff --git a/api/vertices.js b/api/vertices.js index 2a95438a..e5e5ba65 100644 --- a/api/vertices.js +++ b/api/vertices.js @@ -8,7 +8,7 @@ function vertices(addressDbPath, streetDbPath, done){ // connect to db const db = new Database(addressDbPath); - db.unsafeMode(); + db.unsafeMode(true); query.configure(db); // configure database query.tables.address(db); // create tables only if not already created