[IMPORTANT] ALTER TABLE catch slikt alle fouten — ook serieuze #6
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
eddy/weegschaal-app#6
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Probleem
src/database/db.ts:28-30:De lege
catch {}is bedoeld om de "column already exists" fout op te vangen bij herhaaldelijk initialiseren. Maar het vangt ook serieuze fouten:Bij een corrupte database gaat de app gewoon door alsof alles in orde is, terwijl data-operaties vervolgens stilletjes falen.
Oplossing
Gebruik
PRAGMA table_infoom te checken of de kolom al bestaat vóór de ALTER:Of als alternatief: check expliciet op "duplicate column" in de catch en re-throw bij andere fouten.