diff options
author | EuAndreh <eu@euandre.org> | 2024-02-25 05:01:00 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-02-25 05:01:00 -0300 |
commit | 458bf0fc628d9bcf6a59a0efb898045266dab6ba (patch) | |
tree | bb538753668dad5abc7eec4a65bf4f233b34d93a /src/db.mjs | |
parent | Normalize how modules import and name each other (diff) | |
download | papod-458bf0fc628d9bcf6a59a0efb898045266dab6ba.tar.gz papod-458bf0fc628d9bcf6a59a0efb898045266dab6ba.tar.xz |
Explicit import from "node:process"; move log() to hero.mjs
Diffstat (limited to 'src/db.mjs')
-rw-r--r-- | src/db.mjs | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -1,7 +1,8 @@ -import assert from "node:assert/strict"; -import fs from "node:fs"; -import path from "node:path"; -import url from "node:url"; +import assert from "node:assert/strict"; +import fs from "node:fs"; +import path from "node:path"; +import process from "node:process"; +import url from "node:url"; import sqlite from "./sqlite.cjs"; @@ -49,7 +50,7 @@ export const open = (...args) => export let handle = null; -export const init = async (dbName = process.env.PAPO_DB_PATH || ":memory:") => { +export const init = async (logFn, dbName = process.env.PAPO_DB_PATH || ":memory:") => { handle = await open(dbName); - await accretion.runMigrations(handle); + await accretion.runMigrations(logFn, handle); }; |