Versions in this module Expand all Collapse all v1 v1.28.0-dev Jun 29, 2026 v1.27.0 Jul 13, 2026 Changes in this version + const DefaultMaxInSize + const NoConditionID + var ContextKeyTestFixtures = contextKey + var ErrGetResourceIndexFailed = errors.New("get resource index failed") + var ListOptionsAll = ListOptions + func BuildCaseInsensitiveIn(key string, values []string) builder.Cond + func BuildCaseInsensitiveLike(key, value string) builder.Cond + func BuilderDialect() string + func CellToInt[T ~int | int64](cell xorm.Cell, def T) (ret T, has bool, err error) + func ConnStr(opts ConnOptions) (string, string, error) + func ConnStrDefaultDatabase(opts ConnOptions) (string, string, error) + func ConvertDatabaseTable() error + func ConvertVarcharToNVarchar() error + func CountBadSequences(_ context.Context) (int64, error) + func CountByBean(ctx context.Context, bean any) (int64, error) + func CountOrphanedObjects(ctx context.Context, subject, refObject, joinCond string) (int64, error) + func Count[T any](ctx context.Context, opts FindOptions) (int64, error) + func DecrByIDs(ctx context.Context, ids []int64, decrCol string, bean any) error + func DeleteAllRecords(tableName string) error + func DeleteBeans(ctx context.Context, beans ...any) (err error) + func DeleteByBean(ctx context.Context, bean any) (int64, error) + func DeleteByID[T any](ctx context.Context, id int64) (int64, error) + func DeleteByIDs[T any](ctx context.Context, ids ...int64) error + func DeleteOrphanedObjects(ctx context.Context, subject, refObject, joinCond string) error + func DeleteResourceIndex(ctx context.Context, tableName string, groupID int64) error + func Delete[T any](ctx context.Context, opts FindOptions) (int64, error) + func DumpDatabase(filePath string, dbType setting.DatabaseType) error + func ErrCancelledf(format string, args ...any) error + func Exec(ctx context.Context, sqlAndArgs ...any) (sql.Result, error) + func ExistByID[T any](ctx context.Context, id int64) (bool, error) + func Exist[T any](ctx context.Context, cond builder.Cond) (bool, error) + func FindAndCount[T any](ctx context.Context, opts FindOptions) ([]*T, int64, error) + func FindIDs(ctx context.Context, tableName, idCol string, cond builder.Cond) ([]int64, error) + func Find[T any](ctx context.Context, opts FindOptions) ([]*T, error) + func FixBadSequences(_ context.Context) error + func GetByID[T any](ctx context.Context, id int64) (object *T, exist bool, err error) + func GetMaxID(beanOrTableName any) (maxID int64, err error) + func GetNextResourceIndex(ctx context.Context, tableName string, groupID int64) (int64, error) + func GetXORMEngineForTesting() *xorm.Engine + func Get[T any](ctx context.Context, cond builder.Cond) (object *T, exist bool, err error) + func InTransaction(ctx context.Context) bool + func InitEngine(ctx context.Context) error + func InitEngineWithMigration(ctx context.Context, migrateFunc func(context.Context, EngineMigration) error) (err error) + func Insert(ctx context.Context, beans ...any) error + func IsErrCancelled(err error) bool + func IsErrNameCharsNotAllowed(err error) bool + func IsErrNamePatternNotAllowed(err error) bool + func IsErrNameReserved(err error) bool + func IsErrNotExist(err error) bool + func IsErrSSHDisabled(err error) bool + func IsTableNotEmpty(beanOrTableName any) (bool, error) + func IsUsableName(reservedNames, reservedPatterns []string, name string) error + func Iterate[Bean any](ctx context.Context, cond builder.Cond, ...) error + func MaxBatchInsertSize(bean any) int + func NamesToBean(names ...string) ([]any, error) + func NewXORMLogger(showSQL bool) xormlog.Logger + func RegisterModel(bean any, initFunc ...func() error) + func SetDefaultEngine(ctx context.Context, eng *xorm.Engine) + func SetLogSQL(ctx context.Context, on bool) + func SetSessionPagination(sess Engine, p Paginator) + func SyncAllTables() error + func SyncMaxResourceIndex(ctx context.Context, tableName string, groupID, maxIndex int64) (err error) + func TruncateBeans(ctx context.Context, beans ...any) (err error) + func UnsetDefaultEngine() + func WithTx(parentCtx context.Context, f func(ctx context.Context) error) error + func WithTx2[T any](parentCtx context.Context, f func(ctx context.Context) (T, error)) (ret T, errRet error) + type AbsoluteListOptions struct + func NewAbsoluteListOptions(skip, take int) *AbsoluteListOptions + func (opts *AbsoluteListOptions) GetSkipTake() (skip, take int) + func (opts *AbsoluteListOptions) IsListAll() bool + type CheckCollationsResult struct + AvailableCollation container.Set[string] + CollationEquals func(a, b string) bool + DatabaseCollation string + ExistingTableNumber int + ExpectedCollation string + InconsistentCollationColumns []string + IsCollationCaseSensitive func(s string) bool + func CheckCollations(x EngineMigration) (*CheckCollationsResult, error) + func CheckCollationsDefaultEngine() (*CheckCollationsResult, error) + type Committer interface + Close func() error + Commit func() error + func TxContext(parentCtx context.Context) (context.Context, Committer, error) + type ConnOptions struct + Database string + Host string + Passwd string + SQLiteBusyTimeout int + SQLiteJournalMode string + SQLitePath string + SSLMode string + Schema string + Type setting.DatabaseType + User string + func GlobalConnOptions() ConnOptions + type Engine interface + Ping func() error + Sync func(...any) error + func GetEngine(ctx context.Context) Engine + type EngineHook struct + Logger log.Logger + Threshold time.Duration + func (*EngineHook) BeforeProcess(c *contexts.ContextHook) (context.Context, error) + func (h *EngineHook) AfterProcess(c *contexts.ContextHook) error + type EngineMigration interface + Close func() error + DB func() *core.DB + DBMetas func() ([]*schemas.Table, error) + Dialect func() dialects.Dialect + DropTables func(beans ...any) error + NewSession func() *xorm.Session + SetMapper func(mapper names.Mapper) + SyncWithOptions func(opts xorm.SyncOptions, beans ...any) (*xorm.SyncResult, error) + TableInfo func(bean any) (*schemas.Table, error) + TableName func(bean any, includeSchema ...bool) string + type ErrCancelled struct + Message string + func (err ErrCancelled) Error() string + type ErrNameCharsNotAllowed struct + Name string + func (err ErrNameCharsNotAllowed) Error() string + func (err ErrNameCharsNotAllowed) Unwrap() error + type ErrNamePatternNotAllowed struct + Pattern string + func (err ErrNamePatternNotAllowed) Error() string + func (err ErrNamePatternNotAllowed) Unwrap() error + type ErrNameReserved struct + Name string + func (err ErrNameReserved) Error() string + func (err ErrNameReserved) Unwrap() error + type ErrNotExist struct + ID int64 + Resource string + func (err ErrNotExist) Error() string + func (err ErrNotExist) Unwrap() error + type ErrSSHDisabled struct + func (err ErrSSHDisabled) Error() string + type FindOptions interface + GetPage func() int + GetPageSize func() int + IsListAll func() bool + ToConds func() builder.Cond + type FindOptionsJoin interface + ToJoins func() []JoinFunc + type FindOptionsOrder interface + ToOrders func() string + type JoinFunc func(sess Engine) error + type ListOptions struct + ListAll bool + Page int + PageSize int + func (opts *ListOptions) GetSkipTake() (skip, take int) + func (opts *ListOptions) SetDefaultValues() + func (opts ListOptions) GetPage() int + func (opts ListOptions) GetPageSize() int + func (opts ListOptions) IsListAll() bool + func (opts ListOptions) ToConds() builder.Cond + type Paginator interface + GetSkipTake func() (skip, take int) + IsListAll func() bool + type ResourceIndex struct + GroupID int64 + MaxIndex int64 + type SQLSession interface + Asc func(colNames ...string) *xorm.Session + Cols func(...string) *xorm.Session + Context func(ctx context.Context) *xorm.Session + Count func(...any) (int64, error) + Decr func(column string, arg ...any) *xorm.Session + Delete func(...any) (int64, error) + Desc func(colNames ...string) *xorm.Session + Distinct func(...string) *xorm.Session + Exec func(...any) (sql.Result, error) + Exist func(...any) (bool, error) + Find func(any, ...any) error + FindAndCount func(any, ...any) (int64, error) + Get func(beans ...any) (bool, error) + ID func(any) *xorm.Session + In func(string, ...any) *xorm.Session + Incr func(column string, arg ...any) *xorm.Session + Insert func(...any) (int64, error) + IsTableExist func(tableNameOrBean any) (bool, error) + Iterate func(any, xorm.IterFunc) error + Join func(joinOperator string, tablename, condition any, args ...any) *xorm.Session + Limit func(limit int, start ...int) *xorm.Session + NoAutoTime func() *xorm.Session + NotIn func(string, ...any) *xorm.Session + OrderBy func(any, ...any) *xorm.Session + Query func(...any) ([]map[string][]byte, error) + QueryInterface func(sqlOrArgs ...any) ([]map[string]any, error) + SQL func(any, ...any) *xorm.Session + Select func(string) *xorm.Session + SetExpr func(string, any) *xorm.Session + SumInt func(bean any, columnName string) (res int64, err error) + Table func(tableNameOrBean any) *xorm.Session + Truncate func(...any) (int64, error) + Where func(any, ...any) *xorm.Session + type SQLiteConnStrOptions struct + BusyTimeout int + FilePath string + JournalMode string + type SearchOrderBy string + const SearchOrderByAlphabetically + const SearchOrderByAlphabeticallyReverse + const SearchOrderByForks + const SearchOrderByForksReverse + const SearchOrderByID + const SearchOrderByIDReverse + const SearchOrderByLeastUpdated + const SearchOrderByNewest + const SearchOrderByOldest + const SearchOrderByRecentUpdated + const SearchOrderByStars + const SearchOrderByStarsReverse + func (s SearchOrderBy) String() string + type Session interface + And func(query any, args ...any) *xorm.Session + Begin func() error + Close func() error + Commit func() error + Engine func() *xorm.Engine + IsInTx func() bool + Rollback func() error + type XORMLogBridge struct + func (l *XORMLogBridge) Debug(v ...any) + func (l *XORMLogBridge) Debugf(format string, v ...any) + func (l *XORMLogBridge) Error(v ...any) + func (l *XORMLogBridge) Errorf(format string, v ...any) + func (l *XORMLogBridge) Info(v ...any) + func (l *XORMLogBridge) Infof(format string, v ...any) + func (l *XORMLogBridge) IsShowSQL() bool + func (l *XORMLogBridge) Level() xormlog.LogLevel + func (l *XORMLogBridge) Log(skip int, level log.Level, format string, v ...any) + func (l *XORMLogBridge) SetLevel(lvl xormlog.LogLevel) + func (l *XORMLogBridge) ShowSQL(show ...bool) + func (l *XORMLogBridge) Warn(v ...any) + func (l *XORMLogBridge) Warnf(format string, v ...any) v1.27.0-rc0 Jun 29, 2026