Modernize node sqlite - #26
Merged
Merged
Conversation
better-sqlite3 is a native module with no prebuilt binary for Node 24, so `npm install` failed and a fresh Docker image could not be built. Replace TypeORM and better-sqlite3 with Node's built-in node:sqlite and a small hand-written data-access layer, removing all native compilation from the install and the Docker build. - Add src/database/connection.ts: opens the database, enables foreign keys, runs an idempotent CREATE TABLE IF NOT EXISTS bootstrap, and creates the data directory if it is missing. - Rewrite the models as enum + interface + repository using prepared statements; drop the abstract base model and all TypeORM decorators. - Rewire notify.command.ts and watch.controller.ts onto the new repositories and simplify database.controller.ts. - Remove typeorm, better-sqlite3 and reflect-metadata, the TypeORM migrations, and ormconfig.js. Pin Node 24 (engines) and bump @types/node. - Replace the Dockerfile with a multi-stage build and add .dockerignore. - Add an in-memory data-layer test suite; delete the obsolete TypeORM-based watch controller spec. Existing therabot.db databases keep working: the bootstrap is a no-op on already-migrated databases and the physical column names are preserved.
Replace the TeamCity-triggered deploy with a self-contained GitHub Actions pipeline mirroring the fruiz repo: build the image, push it to GHCR, then SSH into the deploy host and run docker compose pull + up against deploy/compose.yaml. - Rewrite cd.yml into audit/get_sha/test/build-image/push-image/deploy jobs; drop the TeamCity step and the API_TOKEN secret. - Move Dockerfile to deploy/Dockerfile and add deploy/compose.yaml (image + build), replacing the root docker-compose.yml. - Add an undici ^6.27.0 override to clear the advisories dragged in transitively by discord.js (which pins the vulnerable 6.24.1), so npm audit --omit=dev gates cleanly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.