Versions in this module Expand all Collapse all v2 v2.0.1 Jul 16, 2025 Changes in this version + const And + const Asc + const Between + const CASCADE + const CrossJoin + const Desc + const Diff + const DiffAll + const DiffAny + const Eq + const EqAll + const EqAny + const Exists + const FullOuterJoin + const GrEq + const GrEqAll + const GrEqAny + const Greater + const GreaterAll + const GreaterAny + const In + const InnerJoin + const LeEq + const LeEqAll + const LeEqAny + const LeftJoin + const Lesser + const LesserAll + const LesserAny + const Like + const MODEL + const NAME + const NotBetween + const NotEq + const NotEqAll + const NotEqAny + const NotExists + const NotIn + const NotLike + const NotNull + const Null + const Or + const REFERENCE + const RELATION + const RightJoin + const TABLE + const TYPE + func Connect(connURL, driver string) (*sqlx.DB, error) + func CreateModel[T any](m *T) error + func DeleteModel[T any](m *T) error + func FindModels[T any](page, limit int, sortField string, sortDir qb.OrderByDir, ...) ([]T, int, error) + func GetModelByID[T any](value any) (*T, error) + func GetModelBy[T any](field string, value any) (*T, error) + func GetModelWhereEq[T any](field string, value any) (*T, error) + func GetModel[T any](conditions ...Condition) (*T, error) + func Load() + func Register(driver IDatabase) + func UpdateModel[T any](m *T) error + type Column struct + HasValue bool + IsZero bool + Key string + Name string + Primary bool + Ref string + Relation string + Types string + type Condition struct + AndOr WhereAndOr + Field any + Group []Condition + Opt WhereOpt + Value any + func (c Condition) ToQBCondition() qb.Condition + type DB struct + type DBModel struct + func Instance() *DBModel + func (db *DBModel) Begin() *DBModel + func (db *DBModel) Commit() error + func (db *DBModel) Create(model any) (err error) + func (db *DBModel) Delete(model any) error + func (db *DBModel) Fetch(offset, fetch int) *DBModel + func (db *DBModel) Find(model any) (total int, err error) + func (db *DBModel) First(model any) (err error) + func (db *DBModel) Get(model any, getType GetOne) (err error) + func (db *DBModel) GroupBy(fields ...string) *DBModel + func (db *DBModel) Having(field any, opt WhereOpt, value any) *DBModel + func (db *DBModel) Join(join qb.JoinType, table string, condition Condition) *DBModel + func (db *DBModel) Last(model any) (err error) + func (db *DBModel) Limit(limit, offset int) *DBModel + func (db *DBModel) Model(model any) *DBModel + func (db *DBModel) Omit(columns ...any) *DBModel + func (db *DBModel) OrderBy(field string, dir qb.OrderByDir) *DBModel + func (db *DBModel) Raw(sqlStr string, args ...any) *DBModel + func (db *DBModel) RemoveFetch() qb.Fetch + func (db *DBModel) RemoveLimit() qb.Limit + func (db *DBModel) Rollback() error + func (db *DBModel) Select(columns ...any) *DBModel + func (db *DBModel) Update(model any) (err error) + func (db *DBModel) When(condition bool, groupCondition qb.FnWhereBuilder) *DBModel + func (db *DBModel) Where(field any, opt qb.WhereOpt, value any) *DBModel + func (db *DBModel) WhereGroup(groupCondition qb.FnWhereBuilder) *DBModel + func (db *DBModel) WhereOr(field any, opt qb.WhereOpt, value any) *DBModel + type FieldEmpty qb.FieldEmpty + type FieldNot qb.FieldNot + type FieldYear qb.FieldYear + type GetOne int + const GetFirst + const GetLast + const TakeOne + type IDatabase interface + Load func() (*sqlx.DB, error) + type JoinType = qb.JoinType + type MetaData string + type OrderByDir = qb.OrderByDir + type Raw struct + type Table struct + Columns []Column + HasData bool + Name string + Primaries []Column + Relation []*Table + Values map[string]any + func ModelData(model any) (*Table, error) + func NewTable() *Table + type ValueField qb.ValueField + type WhereAndOr = qb.WhereAndOr + type WhereOpt = qb.WhereOpt Other modules containing this package github.com/gflydev/db