Documentation ¶
Index ¶
- func ALL[T Table](ctx context.Context, options ...QueryOption) (entries []T, err error)
- func Asc(name string) orders.Orders
- func Begin(ctx context.Context, options ...databases.TransactionOption) (err error)
- func Between(field string, left any, right any) conditions.Condition
- func Bool(b bool) conditions.Literal
- func Commit(ctx context.Context) (err error)
- func Count[T Table](ctx context.Context, cond conditions.Condition) (count int64, err error)
- func Delete[T Table](ctx context.Context, entry T) (v T, ok bool, err error)
- func DeleteByCondition[T Table](ctx context.Context, cond conditions.Condition) (affected int64, err error)
- func Desc(name string) orders.Orders
- func Disuse(ctx context.Context) context.Context
- func Eq(field string, expression any) conditions.Condition
- func Exist[T Table](ctx context.Context, cond conditions.Condition) (has bool, err error)
- func FAG() []modules.FnAnnotationCodeWriter
- func Float(f float32) conditions.Literal
- func Float64(f float64) conditions.Literal
- func Gt(field string, expression any) conditions.Condition
- func Gte(field string, expression any) conditions.Condition
- func In(field string, expression ...any) conditions.Condition
- func Insert[T Table](ctx context.Context, entry T) (v T, ok bool, err error)
- func InsertMulti[T Table](ctx context.Context, entries []T) (affected int64, err error)
- func InsertOrUpdate[T Table](ctx context.Context, entry T) (v T, ok bool, err error)
- func InsertWhenExist[T Table](ctx context.Context, entry T, source conditions.QueryExpr) (v T, ok bool, err error)
- func InsertWhenNotExist[T Table](ctx context.Context, entry T, source conditions.QueryExpr) (v T, ok bool, err error)
- func Int(n int) conditions.Literal
- func Int64(n int64) conditions.Literal
- func Like(field string, expression string) conditions.Condition
- func LikeContains(field string, expression string) conditions.Condition
- func LikeLast(field string, expression string) conditions.Condition
- func Lit(v string) conditions.Literal
- func LitSubQuery(query string) conditions.QueryExpr
- func Lt(field string, expression any) conditions.Condition
- func Lte(field string, expression any) conditions.Condition
- func Named(name string, value any) sql.NamedArg
- func New(options ...sql.Option) services.Service
- func NotEq(field string, expression any) conditions.Condition
- func NotIn(field string, expression ...any) conditions.Condition
- func One[T Table](ctx context.Context, options ...QueryOption) (entry T, has bool, err error)
- func Page[T Table](ctx context.Context, no int, size int, options ...QueryOption) (page dac.Pager[T], err error)
- func Query[T Table](ctx context.Context, offset int, length int, options ...QueryOption) (entries []T, err error)
- func Rollback(ctx context.Context)
- func String(s string) conditions.Literal
- func SubQuery(query any, field string, cond conditions.Condition) conditions.QueryExpr
- func Time(t time.Time) conditions.Literal
- func Tree[T Table](ctx context.Context, options ...QueryOption) (entry T, err error)
- func Trees[T Table](ctx context.Context, options ...QueryOption) (entries []T, err error)
- func Update[T Table](ctx context.Context, entry T) (v T, ok bool, err error)
- func UpdateFields[T Table](ctx context.Context, fields FieldValues, cond conditions.Condition) (affected int64, err error)
- func Use(ctx context.Context, endpointName []byte) context.Context
- func ViewALL[V View](ctx context.Context, options ...QueryOption) (entries []V, err error)
- func ViewOne[V View](ctx context.Context, options ...QueryOption) (entry V, has bool, err error)
- func Views[V View](ctx context.Context, offset int, length int, options ...QueryOption) (entries []V, err error)
- func WithDatabase(db databases.Database) sql.Option
- func WithName(name string) sql.Option
- func WithTLS(fn RegisterTLSFunc) sql.Option
- type FieldValues
- type QueryOption
- type QueryOptions
- type RegisterTLSFunc
- type Table
- type View
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ALL ¶ added in v1.2.1
func ALL[T Table](ctx context.Context, options ...QueryOption) (entries []T, err error)
func Begin ¶ added in v1.2.1
func Begin(ctx context.Context, options ...databases.TransactionOption) (err error)
func Bool ¶ added in v1.2.1
func Bool(b bool) conditions.Literal
func DeleteByCondition ¶ added in v1.2.1
func FAG ¶ added in v1.2.1
func FAG() []modules.FnAnnotationCodeWriter
func Float ¶ added in v1.2.1
func Float(f float32) conditions.Literal
func Float64 ¶ added in v1.2.1
func Float64(f float64) conditions.Literal
func InsertMulti ¶ added in v1.2.1
func InsertOrUpdate ¶
func InsertWhenExist ¶
func InsertWhenNotExist ¶
func Int ¶ added in v1.2.1
func Int(n int) conditions.Literal
func Int64 ¶ added in v1.2.1
func Int64(n int64) conditions.Literal
func LikeContains ¶ added in v1.2.1
func LikeContains(field string, expression string) conditions.Condition
func Lit ¶ added in v1.2.1
func Lit(v string) conditions.Literal
func LitSubQuery ¶ added in v1.2.1
func LitSubQuery(query string) conditions.QueryExpr
func String ¶ added in v1.2.1
func String(s string) conditions.Literal
func SubQuery ¶ added in v1.2.1
func SubQuery(query any, field string, cond conditions.Condition) conditions.QueryExpr
func Tree ¶ added in v1.2.1
func Tree[T Table](ctx context.Context, options ...QueryOption) (entry T, err error)
func Trees ¶ added in v1.2.1
func Trees[T Table](ctx context.Context, options ...QueryOption) (entries []T, err error)
func UpdateFields ¶ added in v1.2.1
func UpdateFields[T Table](ctx context.Context, fields FieldValues, cond conditions.Condition) (affected int64, err error)
func ViewALL ¶ added in v1.2.1
func ViewALL[V View](ctx context.Context, options ...QueryOption) (entries []V, err error)
func WithTLS ¶ added in v1.2.11
func WithTLS(fn RegisterTLSFunc) sql.Option
Types ¶
type FieldValues ¶ added in v1.2.1
type FieldValues dac.FieldValues
func Field ¶ added in v1.2.1
func Field(name string, value any) FieldValues
func (FieldValues) Field ¶ added in v1.2.1
func (fields FieldValues) Field(name string, value any) FieldValues
type QueryOption ¶ added in v1.2.1
type QueryOption dac.QueryOption
func Conditions ¶
func Conditions(cond conditions.Condition) QueryOption
func GroupBy ¶ added in v1.2.1
func GroupBy(by groups.GroupBy) QueryOption
func Orders ¶
func Orders(order orders.Orders) QueryOption
type QueryOptions ¶ added in v1.2.1
type QueryOptions struct {
dac.QueryOption
}
type RegisterTLSFunc ¶ added in v1.2.11
Source Files ¶
Click to show internal directories.
Click to hide internal directories.