refactor(db): switch records layer to Prisma
- Replace hand-written node:sqlite queries with a Prisma client using the better-sqlite3 driver adapter - Version the schema with migrations: baseline table, timestamp normalisation, and WAL journal mode - Store timestamps with an explicit UTC offset so they stop being parsed as local time - Show created/updated times on the edit page, formatted with dayjs - Move the root redirect into next.config to avoid a prerender error - Run migrations from the container entrypoint before starting the server BREAKING CHANGE: DNSMASQ_ADMIN_DB_PATH is replaced by DATABASE_URL, which must be a Prisma connection URL (file:./data/dnsmasq-admin.db). Existing database files are migrated in place and need no conversion.
This commit is contained in:
25 files changed
+1796
-141
No files matched your search
@@ -1,3 +1,14 @@
|
||||
allowBuilds:
|
||||
# Prisma's postinstall downloads the query engine binaries and generates the client.
|
||||
# Without these two entries pnpm refuses to add packages (ERR_PNPM_IGNORED_BUILDS).
|
||||
'@prisma/engines': true
|
||||
prisma: true
|
||||
# SQLite driver: prisma ships its own binaries, but better-sqlite3 resolved to v12 requires postinstall(prebuild-install)
|
||||
# to fetch platform binary.
|
||||
better-sqlite3: true
|
||||
# esbuild/workerd ship their platform binaries as optionalDependencies, so there is no
|
||||
# install script that needs running. Declared explicitly so pnpm stops asking.
|
||||
esbuild: false
|
||||
workerd: false
|
||||
sharp: false
|
||||
unrs-resolver: false
|
||||
Reference in new issue
Block a user