Versions in this module Expand all Collapse all v1 v1.0.0 Mar 11, 2026 Changes in this version + func AutoTransaction(trans func(db IDBHandle) error) error + func Binds[T ITable](m T) []interface + type IDBHandle IExecutor + type IExecutor interface + Exec func(query string, args ...any) (sql.Result, error) + Prepare func(query string) (*sql.Stmt, error) + Query func(query string, args ...any) (*sql.Rows, error) + QueryRow func(query string, args ...any) *sql.Row + type ITable interface + Pk func() string + TableName func() string + type ORM struct + Record T + func New[T ITable](data T) *ORM[T] + func (c *ORM[T]) Count(where string, values []interface{}) (int64, error) + func (c *ORM[T]) Delete(pk int64) (int64, error) + func (c *ORM[T]) Fields() string + func (c *ORM[T]) Limit(where string, values []interface{}, offset, size int64, order string) ([]T, error) + func (c *ORM[T]) Pk() string + func (c *ORM[T]) Row(where string, values []interface{}) (T, error) + func (c *ORM[T]) Rows(where string, values []interface{}) ([]T, error) + func (c *ORM[T]) Save() (int64, error) + func (c *ORM[T]) Saves(rows []T) (int64, error) + func (c *ORM[T]) SetRDb(rdb IDBHandle) *ORM[T] + func (c *ORM[T]) SetWDb(wdb IDBHandle) *ORM[T] + func (c *ORM[T]) Sum(col, where string, values []interface{}) (int64, error) + func (c *ORM[T]) TableName() string + func (c *ORM[T]) Update(pk int64) (int64, error) + func (c *ORM[T]) UpdateByPk(data map[string]interface{}, pk int64) (int64, error)