package
2.2.1+incompatible
Repository: https://github.com/goharbor/harbor.git
Documentation: pkg.go.dev
# Functions
AsConflictError checks whether the err is duplicate key error.
AsForeignKeyError checks whether the err is violating foreign key constraint error.
AsNotFoundError checks whether the err is orm.ErrNoRows.
Clone returns new context with orm for ctx.
Context returns a context with an orm.
CreateInClause creates an IN clause with the provided sql and args to avoid the sql injection The sql should return the ID list with the specific condition(e.g.
Escape special characters.
FromContext returns orm from context.
NewContext returns new context with orm.
NewCreator creates an ORM creator.
ParamPlaceholderForIn returns a string that contains placeholders for sql keyword "in" e.g.
QuerySetter generates the query setter according to the query.
ReadOrCreate read or create instance to datebase, retry to read when met a duplicate key error after the creating.
RegisterModel ...
WithTransaction a decorator which make f run in transaction.
WrapConflictError wrap error as ConflictError when it is duplicate key error otherwise return err.
WrapNotFoundError wrap error as NotFoundError when it is orm.ErrNoRows otherwise return err.
# Variables
Crt is a global instance of ORM creator.
NewCondition alias function of orm.NewCondition.
# Interfaces
Creator creates ORMer Introducing the "Creator" interface to eliminate the dependency on database.
# Type aliases
Condition alias to orm.Condition.
Params alias to orm.Params.
ParamsList alias to orm.ParamsList.
QuerySeter alias to orm.QuerySeter.