Documentation
¶
Index ¶
- Constants
- type DistinctOption
- type Error
- type GroupOption
- type HavingOption
- type Join
- type JoinOption
- type Link
- func (r *Link) Delete(ctx context.Context, link *model.Link) error
- func (r *Link) Distinct(options ...DistinctOption) *Link
- func (r *Link) Get(ctx context.Context) ([]model.Link, error)
- func (r *Link) GetCount(ctx context.Context) (int, error)
- func (r *Link) GetMap(ctx context.Context) (map[int64]model.Link, error)
- func (r *Link) GetOne(ctx context.Context) (*model.Link, error)
- func (r *Link) Insert(ctx context.Context, link *model.Link) error
- func (r *Link) Limit(limit int) *Link
- func (r *Link) Offset(offset int) *Link
- func (r *Link) Order(options ...OrderOption) *Link
- func (r *Link) Update(ctx context.Context, link *model.Link) error
- func (r *Link) Where(options ...WhereOption) *Link
- func (r *Link) WithDeleted(include bool) *Link
- type LinkOrderCreatedAt
- type LinkWhereCreatedAtBefore
- type LinkWhereID
- type LinkWhereShort
- type OrderDirection
- type OrderOption
- type QueryOptions
- func (q *QueryOptions) AddDistinct(options ...DistinctOption)
- func (q *QueryOptions) AddOrder(options ...OrderOption)
- func (q *QueryOptions) AddWhere(options ...WhereOption)
- func (q *QueryOptions) BuildDistinct() string
- func (q *QueryOptions) BuildGroup() string
- func (q *QueryOptions) BuildHaving() string
- func (q *QueryOptions) BuildJoin() string
- func (q *QueryOptions) BuildLimit() string
- func (q *QueryOptions) BuildOrder() string
- func (q *QueryOptions) BuildWhere() string
- func (q *QueryOptions) SetLimit(limit int)
- func (q *QueryOptions) SetOffset(offset int)
- type WhereOption
Constants ¶
View Source
const ( ErrUniqueViolation = Error("unique constraint violation") ErrNoResults = Error("no results found") )
View Source
const ( OrderDirectionAsc = OrderDirection(`ASC`) OrderDirectionAscNullsFirst = OrderDirection(`ASC NULLS FIRST`) OrderDirectionDesc = OrderDirection(`DESC`) OrderDirectionDescNullsLast = OrderDirection(`DESC NULLS LAST`) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DistinctOption ¶
type DistinctOption interface {
GetDistinct() string
}
type GroupOption ¶
type GroupOption interface {
GetGroup() string
}
type HavingOption ¶
type HavingOption interface { WhereOption GetHaving(start int) (stmt string, args []interface{}) }
type JoinOption ¶
type JoinOption interface {
GetJoin() []Join
}
type Link ¶
type Link struct {
// contains filtered or unexported fields
}
func (*Link) Distinct ¶
func (r *Link) Distinct(options ...DistinctOption) *Link
func (*Link) Order ¶
func (r *Link) Order(options ...OrderOption) *Link
func (*Link) Where ¶
func (r *Link) Where(options ...WhereOption) *Link
func (*Link) WithDeleted ¶
type LinkOrderCreatedAt ¶
type LinkOrderCreatedAt OrderDirection
func (LinkOrderCreatedAt) GetOrder ¶
func (o LinkOrderCreatedAt) GetOrder() string
type LinkWhereCreatedAtBefore ¶
func (LinkWhereCreatedAtBefore) GetWhere ¶
func (o LinkWhereCreatedAtBefore) GetWhere(start int) (stmt string, args []interface{})
type LinkWhereID ¶
type LinkWhereID []int64
func (LinkWhereID) GetWhere ¶
func (o LinkWhereID) GetWhere(start int) (stmt string, args []interface{})
type LinkWhereShort ¶
type LinkWhereShort []string
func (LinkWhereShort) GetWhere ¶
func (o LinkWhereShort) GetWhere(start int) (stmt string, args []interface{})
type OrderDirection ¶
type OrderDirection string
type OrderOption ¶
type OrderOption interface {
GetOrder() string
}
type QueryOptions ¶
type QueryOptions struct { Distinct []string Join []Join Where []string Group []string Having []string Order []string Limit *int Offset *int Arguments []interface{} }
func (*QueryOptions) AddDistinct ¶
func (q *QueryOptions) AddDistinct(options ...DistinctOption)
func (*QueryOptions) AddOrder ¶
func (q *QueryOptions) AddOrder(options ...OrderOption)
func (*QueryOptions) AddWhere ¶
func (q *QueryOptions) AddWhere(options ...WhereOption)
func (*QueryOptions) BuildDistinct ¶
func (q *QueryOptions) BuildDistinct() string
func (*QueryOptions) BuildGroup ¶
func (q *QueryOptions) BuildGroup() string
func (*QueryOptions) BuildHaving ¶
func (q *QueryOptions) BuildHaving() string
func (*QueryOptions) BuildJoin ¶
func (q *QueryOptions) BuildJoin() string
func (*QueryOptions) BuildLimit ¶
func (q *QueryOptions) BuildLimit() string
func (*QueryOptions) BuildOrder ¶
func (q *QueryOptions) BuildOrder() string
func (*QueryOptions) BuildWhere ¶
func (q *QueryOptions) BuildWhere() string
func (*QueryOptions) SetLimit ¶
func (q *QueryOptions) SetLimit(limit int)
func (*QueryOptions) SetOffset ¶
func (q *QueryOptions) SetOffset(offset int)
type WhereOption ¶
Click to show internal directories.
Click to hide internal directories.