Documentation
¶
Index ¶
- Constants
- Variables
- func CT_GetObject[T attrs.Definer](identifier any) (interface{}, error)
- func CT_ListObjects[T attrs.Definer](amount, offset uint) ([]interface{}, error)
- func CT_ListObjectsByIDs[T attrs.Definer](i []interface{}) ([]interface{}, error)
- func CountObjects[T attrs.Definer](obj T) (int64, error)
- func CreateObject[T attrs.Definer](obj T) error
- func DeleteObject[T attrs.Definer](obj T) error
- func GetObject[T attrs.Definer](identifier any) (T, error)
- func ListObjects[T attrs.Definer](offset, limit uint64, ordering ...string) ([]T, error)
- func ListObjectsByIDs[T attrs.Definer, T2 any](offset, limit uint64, ids []T2) ([]T, error)
- func RegisterDriver(driver driver.Driver, database string)
- func SaveObject[T attrs.Definer](obj T) error
- func UpdateObject[T attrs.Definer](obj T) error
- type ExprGroup
- func (g *ExprGroup) And(exprs ...Expression) Expression
- func (g *ExprGroup) Args() []any
- func (g *ExprGroup) Clone() Expression
- func (g *ExprGroup) IsNot() bool
- func (g *ExprGroup) Not(not bool) Expression
- func (g *ExprGroup) Or(exprs ...Expression) Expression
- func (g *ExprGroup) SQL(sb *strings.Builder)
- func (g *ExprGroup) With(m attrs.Definer, quote string) Expression
- type ExprNode
- func (e *ExprNode) And(exprs ...Expression) Expression
- func (e *ExprNode) Args() []any
- func (e *ExprNode) Clone() Expression
- func (e *ExprNode) IsNot() bool
- func (e *ExprNode) Not(not bool) Expression
- func (e *ExprNode) Or(exprs ...Expression) Expression
- func (e *ExprNode) SQL(sb *strings.Builder)
- func (e *ExprNode) With(m attrs.Definer, quote string) Expression
- type Expression
- type FuncExpr
- func (e *FuncExpr) And(exprs ...Expression) Expression
- func (e *FuncExpr) Args() []any
- func (e *FuncExpr) Clone() Expression
- func (e *FuncExpr) IsNot() bool
- func (e *FuncExpr) Not(not bool) Expression
- func (e *FuncExpr) Or(exprs ...Expression) Expression
- func (e *FuncExpr) SQL(sb *strings.Builder)
- func (e *FuncExpr) With(m attrs.Definer, quote string) Expression
- type LogicalOp
- type QuerySet
- func (qs *QuerySet[T]) All() ([]T, error)
- func (qs *QuerySet[T]) Clone() *QuerySet[T]
- func (qs *QuerySet[T]) Count() (int, error)
- func (qs *QuerySet[T]) Fields(fields ...string) *QuerySet[T]
- func (qs *QuerySet[T]) Filter(key interface{}, vals ...interface{}) *QuerySet[T]
- func (qs *QuerySet[T]) First() (T, error)
- func (qs *QuerySet[T]) ForUpdate() *QuerySet[T]
- func (qs *QuerySet[T]) GroupBy(fields ...string) *QuerySet[T]
- func (qs *QuerySet[T]) Having(key interface{}, vals ...interface{}) *QuerySet[T]
- func (qs *QuerySet[T]) Limit(n int) *QuerySet[T]
- func (qs *QuerySet[T]) Offset(n int) *QuerySet[T]
- func (qs *QuerySet[T]) OrderBy(fields ...string) *QuerySet[T]
- func (s *QuerySet[T]) Union(f func(*QuerySet[attrs.Definer])) *QuerySet[T]
- type Union
Constants ¶
Variables ¶
View Source
var Quote = "`"
Functions ¶
func CT_ListObjects ¶
func CT_ListObjectsByIDs ¶
func CreateObject ¶
func DeleteObject ¶
func ListObjects ¶
func ListObjectsByIDs ¶
func RegisterDriver ¶ added in v1.0.2
RegisterDriver registers a driver with the given database name.
This is used to determine the database type when using sqlx.
If your driver is not one of: - github.com/go-sql-driver/mysql.MySQLDriver - github.com/mattn/go-sqlite3.SQLiteDriver - github.com/jackc/pgx/v5/stdlib.Driver
Then it explicitly needs to be registered here.
func SaveObject ¶
func UpdateObject ¶
Types ¶
type ExprGroup ¶
type ExprGroup struct {
// contains filtered or unexported fields
}
ExprGroup
func (*ExprGroup) And ¶
func (g *ExprGroup) And(exprs ...Expression) Expression
func (*ExprGroup) Clone ¶
func (g *ExprGroup) Clone() Expression
func (*ExprGroup) Not ¶
func (g *ExprGroup) Not(not bool) Expression
func (*ExprGroup) Or ¶
func (g *ExprGroup) Or(exprs ...Expression) Expression
type ExprNode ¶
type ExprNode struct {
// contains filtered or unexported fields
}
func (*ExprNode) And ¶
func (e *ExprNode) And(exprs ...Expression) Expression
func (*ExprNode) Clone ¶
func (e *ExprNode) Clone() Expression
func (*ExprNode) Not ¶
func (e *ExprNode) Not(not bool) Expression
func (*ExprNode) Or ¶
func (e *ExprNode) Or(exprs ...Expression) Expression
type Expression ¶
type Expression interface { SQL(sb *strings.Builder) Args() []any IsNot() bool Not(b bool) Expression And(...Expression) Expression Or(...Expression) Expression Clone() Expression With(model attrs.Definer, quote string) Expression }
func And ¶
func And(exprs ...Expression) Expression
func Or ¶
func Or(exprs ...Expression) Expression
type FuncExpr ¶
type FuncExpr struct { Statement string Fields []string Params []any // contains filtered or unexported fields }
FuncExpr is a function expression for SQL queries. It is used to represent a function call in SQL queries.
It can be used like so:
FuncExpr{ // Represent the SQL function call, with each %s being replaced by the corresponding field in fields. sql: `SUBSTR(TRIM(%s, " "), 0, 2) = ?``, // The fields to be used in the SQL function call. Each field will be replaced by the corresponding value in args. fields: []string{"myField"}, // The arguments to be used in the SQL function call. Each argument will be replaced by the corresponding value in args. args: []any{"ab"}, }
func (*FuncExpr) And ¶
func (e *FuncExpr) And(exprs ...Expression) Expression
func (*FuncExpr) Clone ¶
func (e *FuncExpr) Clone() Expression
func (*FuncExpr) Not ¶
func (e *FuncExpr) Not(not bool) Expression
func (*FuncExpr) Or ¶
func (e *FuncExpr) Or(exprs ...Expression) Expression
Click to show internal directories.
Click to hide internal directories.