types

package
v0.34.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2024 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

View Source
const RFC3339Milli = "2006-01-02T15:04:05.999Z07:00"

Variables

View Source
var ErrNotFound = errors.New("ErrNotFound")

ErrNotFound gets returned when a database record does not exist

Functions

func IsErrNotFound added in v0.32.0

func IsErrNotFound(err error) bool

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

func (m *BigInt) MarshalJSON() ([]byte, error)

MarshalJSON converts the input to a Prisma value

func (*BigInt) UnmarshalJSON

func (m *BigInt) UnmarshalJSON(data []byte) error

UnmarshalJSON converts the Prisma QE value of string to int64

type Bytes

type Bytes = []byte

Bytes is a type alias for []byte

type DateTime

type DateTime = time.Time

DateTime is a type alias for time.Time

type Decimal

type Decimal = decimal.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 F added in v0.32.0

type F interface {
	~string
}

type JSON

type JSON json.RawMessage

JSON is a new type which implements the correct internal prisma (un)marshaller

func (JSON) MarshalJSON

func (m JSON) MarshalJSON() ([]byte, error)

MarshalJSON returns m as the JSON encoding of m.

func (*JSON) UnmarshalJSON

func (m *JSON) UnmarshalJSON(data []byte) error

UnmarshalJSON sets *m to a copy of data.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL