Documentation ¶
Index ¶
- func FileWithLineNum() string
- func GetDsn(connection string) (string, error)
- func New(writer logger.Writer, config logger.Config) logger.Interface
- func NewGormDB(ctx context.Context, connection string) (contractsorm.DB, error)
- func NewGormInstance(connection string) (*gorm.DB, error)
- func NewGormQuery(instance *gorm.DB) contractsorm.Query
- func NewGormTransaction(instance *gorm.DB) contractsorm.Transaction
- func NewOrm() contractsorm.Orm
- type Application
- type DB
- type GormDB
- type GormQuery
- func (r *GormQuery) Count(count *int64) error
- func (r *GormQuery) Create(value any) error
- func (r *GormQuery) Delete(value any, conds ...any) error
- func (r *GormQuery) Distinct(args ...any) contractsorm.Query
- func (r *GormQuery) Exec(sql string, values ...any) error
- func (r *GormQuery) Find(dest any, conds ...any) error
- func (r *GormQuery) First(dest any) error
- func (r *GormQuery) FirstOrCreate(dest any, conds ...any) error
- func (r *GormQuery) ForceDelete(value any, conds ...any) error
- func (r *GormQuery) Get(dest any) error
- func (r *GormQuery) Group(name string) contractsorm.Query
- func (r *GormQuery) Having(query any, args ...any) contractsorm.Query
- func (r *GormQuery) Join(query string, args ...any) contractsorm.Query
- func (r *GormQuery) Limit(limit int) contractsorm.Query
- func (r *GormQuery) Model(value any) contractsorm.Query
- func (r *GormQuery) Offset(offset int) contractsorm.Query
- func (r *GormQuery) OrWhere(query any, args ...any) contractsorm.Query
- func (r *GormQuery) Order(value any) contractsorm.Query
- func (r *GormQuery) Pluck(column string, dest any) error
- func (r *GormQuery) Raw(sql string, values ...any) contractsorm.Query
- func (r *GormQuery) Save(value any) error
- func (r *GormQuery) Scan(dest any) error
- func (r *GormQuery) Scopes(funcs ...func(contractsorm.Query) contractsorm.Query) contractsorm.Query
- func (r *GormQuery) Select(query any, args ...any) contractsorm.Query
- func (r *GormQuery) Table(name string, args ...any) contractsorm.Query
- func (r *GormQuery) Update(column string, value any) error
- func (r *GormQuery) Updates(values any) error
- func (r *GormQuery) Where(query any, args ...any) contractsorm.Query
- func (r *GormQuery) WithTrashed() contractsorm.Query
- type GormTransaction
- 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 Orm
- type ServiceProvider
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 NewGormQuery ¶
func NewGormQuery(instance *gorm.DB) contractsorm.Query
func NewGormTransaction ¶
func NewGormTransaction(instance *gorm.DB) contractsorm.Transaction
func NewOrm ¶
func NewOrm() contractsorm.Orm
Types ¶
type Application ¶
type Application struct { }
func (*Application) Init ¶
func (app *Application) Init() orm.Orm
type GormDB ¶
type GormDB struct { contractsorm.Query // contains filtered or unexported fields }
func (*GormDB) Begin ¶
func (r *GormDB) Begin() (contractsorm.Transaction, error)
type GormQuery ¶
type GormQuery struct {
// contains filtered or unexported fields
}
func (*GormQuery) Scopes ¶
func (r *GormQuery) Scopes(funcs ...func(contractsorm.Query) contractsorm.Query) contractsorm.Query
func (*GormQuery) WithTrashed ¶
func (r *GormQuery) WithTrashed() contractsorm.Query
type GormTransaction ¶
type GormTransaction struct { contractsorm.Query // contains filtered or unexported fields }
func (*GormTransaction) Commit ¶
func (r *GormTransaction) Commit() error
func (*GormTransaction) Rollback ¶
func (r *GormTransaction) Rollback() error
type Logger ¶
type Orm ¶
type Orm struct {
// contains filtered or unexported fields
}
func (*Orm) Connection ¶
func (r *Orm) Connection(name string) contractsorm.Orm
func (*Orm) Query ¶
func (r *Orm) Query() contractsorm.DB
func (*Orm) Transaction ¶
func (r *Orm) Transaction(txFunc func(tx contractsorm.Transaction) error) error
func (*Orm) WithContext ¶
func (r *Orm) WithContext(ctx context.Context) contractsorm.Orm
type ServiceProvider ¶
type ServiceProvider struct { }
func (*ServiceProvider) Boot ¶
func (database *ServiceProvider) Boot()
func (*ServiceProvider) Register ¶
func (database *ServiceProvider) Register()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.