nidus-sync/db/dberrors/bob_errors.bob.go
Eli Ribble 1395e3d3ac Remove old FieldSeeker tables, use v2 generated tables.
This requires a bunch of changes since the types on these tables are
much closer to the underlying types of the Fieldseeker data we are
getting back from the API.

I now need to use proper UUID types everywhere, which means I had to
modify the bob gen config to consistently use google UUID, my UUID
library of choice.

I also had to add the organization_id to all the fieldseeker tables
since we rely on them existing for some of our compound queries.

There were some changes to the API type signatures to get things to
build. I may yet regret those.
2025-12-24 17:58:08 -07:00

32 lines
1,022 B
Go

// Code generated by BobGen psql v0.0.4-0.20251216163753-8e325b7c773a+dirty. DO NOT EDIT.
// This file is meant to be re-generated in place and/or deleted at any time.
package dberrors
import "github.com/lib/pq"
// ErrUniqueConstraint captures all unique constraint errors by explicitly leaving `s` empty.
var ErrUniqueConstraint = &UniqueConstraintError{s: ""}
type UniqueConstraintError struct {
// schema is the schema where the unique constraint is defined.
schema string
// table is the name of the table where the unique constraint is defined.
table string
// columns are the columns constituting the unique constraint.
columns []string
// s is a string uniquely identifying the constraint in the raw error message returned from the database.
s string
}
func (e *UniqueConstraintError) Error() string {
return e.s
}
func (e *UniqueConstraintError) Is(target error) bool {
err, ok := target.(*pq.Error)
if !ok {
return false
}
return err.Code == "23505" && (e.s == "" || err.Constraint == e.s)
}