Versions in this module Expand all Collapse all v2 v2.1.0 Mar 11, 2026 Changes in this version + func Connect() (*gorm.DB, error) + func ConnectWithConfig(cfg DBConfig) (*gorm.DB, error) + func WithTransaction(db *gorm.DB, fn TxFunc) error + type CursorResult struct + HasMore bool + NextCursor string + PerPage int + PrevCursor string + func CursorPaginate(db *gorm.DB, cursor, orderCol string, perPage int, direction string, ...) (*CursorResult, error) + type DBConfig struct + ConnMaxIdleTime time.Duration + ConnMaxLifetime time.Duration + Driver string + Host string + MaxIdleConns int + MaxOpenConns int + Name string + Password string + Port string + SSLMode string + User string + func NewDBConfig() DBConfig + func NewReadDBConfig() DBConfig + func (cfg DBConfig) DSN() string + type PageResult struct + Page int + PerPage int + Total int64 + TotalPages int + func Paginate(db *gorm.DB, page, perPage int, dest interface{}) (*PageResult, error) + type Resolver struct + func NewResolver(writer, reader *gorm.DB) *Resolver + func (r *Resolver) Reader() *gorm.DB + func (r *Resolver) Writer() *gorm.DB + type TxFunc func(tx *gorm.DB) error