Documentation ¶
Index ¶
- func FileWithLineNum() string
- func MysqlDocker() (*dockertest.Pool, *dockertest.Resource, ormcontract.DB, error)
- func New(connection string) (*gorm.DB, error)
- func NewLogger(writer logger.Writer, config logger.Config) logger.Interface
- func PostgresqlDocker() (*dockertest.Pool, *dockertest.Resource, ormcontract.DB, error)
- func SqliteDocker() (*dockertest.Pool, *dockertest.Resource, ormcontract.DB, error)
- func SqlserverDocker() (*dockertest.Pool, *dockertest.Resource, ormcontract.DB, error)
- type DB
- type Logger
- func (l Logger) Error(ctx context.Context, msg string, data ...any)
- func (l Logger) Info(ctx context.Context, msg string, data ...any)
- func (l *Logger) LogMode(level logger.LogLevel) logger.Interface
- func (l Logger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
- func (l Logger) Warn(ctx context.Context, msg string, data ...any)
- type Query
- func (r *Query) Association(association string) ormcontract.Association
- func (r *Query) Count(count *int64) error
- func (r *Query) Create(value any) error
- func (r *Query) Delete(value any, conds ...any) error
- func (r *Query) Distinct(args ...any) ormcontract.Query
- func (r *Query) Driver() ormcontract.Driver
- func (r *Query) Exec(sql string, values ...any) error
- func (r *Query) Find(dest any, conds ...any) error
- func (r *Query) First(dest any) error
- func (r *Query) FirstOrCreate(dest any, conds ...any) error
- func (r *Query) ForceDelete(value any, conds ...any) error
- func (r *Query) Get(dest any) error
- func (r *Query) Group(name string) ormcontract.Query
- func (r *Query) Having(query any, args ...any) ormcontract.Query
- func (r *Query) Join(query string, args ...any) ormcontract.Query
- func (r *Query) Limit(limit int) ormcontract.Query
- func (r *Query) Load(model any, relation string, args ...any) error
- func (r *Query) LoadMissing(model any, relation string, args ...any) error
- func (r *Query) Model(value any) ormcontract.Query
- func (r *Query) Offset(offset int) ormcontract.Query
- func (r *Query) Omit(columns ...string) ormcontract.Query
- func (r *Query) OrWhere(query any, args ...any) ormcontract.Query
- func (r *Query) Order(value any) ormcontract.Query
- func (r *Query) Paginate(page, limit int, dest any, total *int64) error
- func (r *Query) Pluck(column string, dest any) error
- func (r *Query) Raw(sql string, values ...any) ormcontract.Query
- func (r *Query) Save(value any) error
- func (r *Query) Scan(dest any) error
- func (r *Query) Scopes(funcs ...func(ormcontract.Query) ormcontract.Query) ormcontract.Query
- func (r *Query) Select(query any, args ...any) ormcontract.Query
- func (r *Query) Table(name string, args ...any) ormcontract.Query
- func (r *Query) Update(column string, value any) error
- func (r *Query) Updates(values any) error
- func (r *Query) Where(query any, args ...any) ormcontract.Query
- func (r *Query) With(query string, args ...any) ormcontract.Query
- func (r *Query) WithTrashed() ormcontract.Query
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileWithLineNum ¶
func FileWithLineNum() string
FileWithLineNum return the file name and line number of the current file
func MysqlDocker ¶
func MysqlDocker() (*dockertest.Pool, *dockertest.Resource, ormcontract.DB, error)
func PostgresqlDocker ¶
func PostgresqlDocker() (*dockertest.Pool, *dockertest.Resource, ormcontract.DB, error)
func SqliteDocker ¶
func SqliteDocker() (*dockertest.Pool, *dockertest.Resource, ormcontract.DB, error)
func SqlserverDocker ¶
func SqlserverDocker() (*dockertest.Pool, *dockertest.Resource, ormcontract.DB, error)
Types ¶
type DB ¶
type DB struct { ormcontract.Query // contains filtered or unexported fields }
func (*DB) Begin ¶
func (r *DB) Begin() (ormcontract.Transaction, error)
type Logger ¶
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
func (*Query) Association ¶
func (r *Query) Association(association string) ormcontract.Association
func (*Query) Driver ¶
func (r *Query) Driver() ormcontract.Driver
func (*Query) LoadMissing ¶
func (*Query) Scopes ¶
func (r *Query) Scopes(funcs ...func(ormcontract.Query) ormcontract.Query) ormcontract.Query
func (*Query) WithTrashed ¶
func (r *Query) WithTrashed() ormcontract.Query
type Transaction ¶
type Transaction struct { ormcontract.Query // contains filtered or unexported fields }
func NewTransaction ¶
func NewTransaction(instance *gorm.DB) *Transaction
func (*Transaction) Commit ¶
func (r *Transaction) Commit() error
func (*Transaction) Rollback ¶
func (r *Transaction) Rollback() error
Click to show internal directories.
Click to hide internal directories.