diff options
Diffstat (limited to 'src/db.mjs')
-rw-r--r-- | src/db.mjs | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -3,6 +3,7 @@ import fs from "node:fs"; import path from "node:path"; import process from "node:process"; import url from "node:url"; +import util from "node:util"; import sqlite from "./sqlite.cjs"; @@ -12,9 +13,9 @@ import * as accretion from "./accretion.mjs"; export const promisifyDb = dbHandle => ({ ref: dbHandle, - all: u.promisify((...args) => dbHandle.all(...args)), - exec: u.promisify((...args) => dbHandle.exec(...args)), - run: u.promisify((...args) => dbHandle.run(...args)), + all: util.promisify((...args) => dbHandle.all(...args)), + exec: util.promisify((...args) => dbHandle.exec(...args)), + run: util.promisify((...args) => dbHandle.run(...args)), each: (...args) => new Promise((resolve, reject) => { const cb = args[args.length - 1]; @@ -28,8 +29,8 @@ export const promisifyDb = dbHandle => ({ new Promise((resolve, reject) => { const mkStmt = stmtRef => ({ ref: stmtRef, - run: u.promisify((...args) => stmtRef.run(...args)), - finalize: u.promisify((...args) => stmtRef.finalize(...args)), + run: util.promisify((...args) => stmtRef.run(...args)), + finalize: util.promisify((...args) => stmtRef.finalize(...args)), }); const ref = dbHandle.prepare( ...args, |