Replace string-matching error detection with typed SQLite errors (closes #39) #66

Merged
sneak merged 3 commits from fix/typed-sqlite-errors into main 2026-03-10 11:54:27 +01:00

3 Commits

Author SHA1 Message Date
34246da80f Merge branch 'main' into fix/typed-sqlite-errors
All checks were successful
check / check (push) Successful in 1m2s
2026-03-10 11:52:37 +01:00
b48f7e45e0 Merge branch 'main' into fix/typed-sqlite-errors
All checks were successful
check / check (push) Successful in 1m1s
2026-03-10 11:37:01 +01:00
user
25cbbfd42a Replace string-matching error detection with typed SQLite errors
All checks were successful
check / check (push) Successful in 2m17s
Use errors.As with *sqlite.Error and SQLITE_CONSTRAINT_UNIQUE code
instead of fragile strings.Contains(err.Error(), "UNIQUE") checks.

Add db.IsUniqueConstraintError helper in internal/db/errors.go and
replace all three string-matching call sites in api.go and auth.go.
2026-03-10 03:18:33 -07:00