added some scripts for the sqlite db for cleanup

This commit is contained in:
2025-10-27 20:16:53 +01:00
parent f1bc30a64d
commit 6e34f30d4a
3 changed files with 17 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
{
"version": "0.1.3",
"name": "77th_eventcalendernotification",
"name": "77th_eventcalendarnotification",
"module": "./src/app.ts",
"type": "module",
"private": true,
@@ -16,12 +16,13 @@
"typescript-eslint": "^8.46.2"
},
"scripts": {
"dev": "bun run ./src/app.ts",
"dev:init": "bun run ./src/app.ts --init",
"start": "NODE_ENV=production bun run ./src/app.ts",
"dev": "NODE_ENV=development bun ./src/app.ts",
"db:init": "bun run ./run/db_init.ts",
"db:deleteall": "bun run ./run/db_deleteall.ts",
"build": "bun build --compile --minify --sourcemap ./src/app.ts --outfile ./build/77th_eventcalendernotification",
"build:linux": "bun build --compile --minify --sourcemap --target=bun-linux-arm64 ./src/app.ts --outfile ./build/77th_eventcalendernotification",
"db:deleteall": "bun run ./run/db_event_deleteall.ts",
"db:event:dedup": "bun run ./run/db_event_delete_duplicates.ts",
"build": "bun build --compile --minify --sourcemap ./src/app.ts --outfile ./build/77th_eventcalendarnotification",
"build:linux": "bun build --compile --minify --sourcemap --target=bun-linux-arm64 ./src/app.ts --outfile ./build/77th_eventcalendarnotification",
"docker:build": "docker build -t chiko/77th_eventcalendarntfy:0.1.0 ."
},
"peerDependencies": {

View File

@@ -0,0 +1,10 @@
import * as db from "../src/sql";
const query = db.db.query(`DELETE FROM events
WHERE rowid NOT IN (
SELECT MIN(rowid)
FROM events
GROUP BY uid
);`);
query.run();