Documentation ¶
Index ¶
Constants ¶
const RFC3339Milli = "2006-01-02T15:04:05.999Z07:00"
Variables ¶
var ErrNotFound = errors.New("ErrNotFound")
ErrNotFound gets returned when a database record does not exist
Functions ¶
func IsErrNotFound ¶ added in v0.32.0
IsErrNotFound is true if the error is a ErrNotFound, which gets returned when a database record does not exist This can happen when you call `FindUnique` on a record, or update or delete a single record which doesn't exist.
Types ¶
type BatchResult ¶
type BatchResult struct {
Count int `json:"count"`
}
type BigInt ¶
type BigInt int64
BigInt is a type alias for int64
func (*BigInt) MarshalJSON ¶
MarshalJSON converts the input to a Prisma value
func (*BigInt) UnmarshalJSON ¶
UnmarshalJSON converts the Prisma QE value of string to int64
type Decimal ¶
Decimal points to github.com/shopspring/decimal.Decimal, as Go does not have a native decimal type
type ErrUniqueConstraint ¶ added in v0.32.0
type ErrUniqueConstraint[T F] struct { // Message is the error message Message string // Fields only shows on Postgres Fields []T // Key only shows on MySQL Key string }
func CheckUniqueConstraint ¶ added in v0.32.0
func CheckUniqueConstraint[T F](err error) (*ErrUniqueConstraint[T], bool)
CheckUniqueConstraint returns on a unique constraint error or violation with error info Ideally this will be replaced with Prisma-generated errors in the future
type JSON ¶
type JSON json.RawMessage
JSON is a new type which implements the correct internal prisma (un)marshaller
func (JSON) MarshalJSON ¶
MarshalJSON returns m as the JSON encoding of m.
func (*JSON) UnmarshalJSON ¶
UnmarshalJSON sets *m to a copy of data.