Plant catalog backend: CRUD + seeded built-ins (#12)
Build image / build-and-push (push) Successful in 5s

Co-authored-by: Steve Dudenhoeffer <[email protected]>
This commit was merged in pull request #31.
This commit is contained in:
2026-07-19 01:48:22 +00:00
committed by steve
parent b79bfcf7a9
commit 293532f021
11 changed files with 912 additions and 4 deletions
+7
View File
@@ -177,3 +177,10 @@ func boolToInt(b bool) int {
func isUniqueViolation(err error) bool {
return err != nil && strings.Contains(err.Error(), "UNIQUE constraint failed")
}
// isForeignKeyViolation reports whether err is a SQLite FOREIGN KEY-constraint
// failure — e.g. deleting a plant a planting still references (ON DELETE
// RESTRICT). Same stable-message approach as isUniqueViolation.
func isForeignKeyViolation(err error) bool {
return err != nil && strings.Contains(err.Error(), "FOREIGN KEY constraint failed")
}