Skip to content

Commit b271302

Browse files
committed
enable WAL for sqlite db, add error logger
1 parent 2a1756f commit b271302

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

migrations/20240616234100_wal.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
*
3+
* @param knex {import("knex").Knex}
4+
* @return {Promise<void>}
5+
*/
6+
export async function up(knex) {
7+
await knex.raw("PRAGMA journal_mode=WAL;")
8+
}
9+
10+
export async function down() {
11+
}

src/app.ts

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ export const createApp = () => {
4848
return createErrorJson(c, error)
4949
}
5050

51+
logger.error(error, "unhandled error")
52+
5153
const badImpl = new HTTPException(500, { cause: error })
5254
return createErrorJson(c, badImpl)
5355
})

0 commit comments

Comments
 (0)