mirror of
https://github.com/notherealmarco/WASAPhoto.git
synced 2025-05-05 12:22:35 +02:00
Add database query status (and improved response), photos, likes, comments, bans
This commit is contained in:
parent
519ae22197
commit
abbd5bc494
22 changed files with 1118 additions and 72 deletions
|
@ -9,3 +9,17 @@ func EmptySet(err error) bool {
|
|||
}
|
||||
return strings.Contains(err.Error(), "no rows in result set")
|
||||
}
|
||||
|
||||
func UniqueViolation(err error) bool {
|
||||
if err == nil {
|
||||
return false
|
||||
}
|
||||
return strings.Contains(err.Error(), "UNIQUE constraint failed")
|
||||
}
|
||||
|
||||
func ForeignKeyViolation(err error) bool {
|
||||
if err == nil {
|
||||
return false
|
||||
}
|
||||
return strings.Contains(err.Error(), "FOREIGN KEY constraint failed")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue