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, config *gorm.Config, disableLog bool) (orm.DB, error)
- func NewGormInstance(connection string, config *gorm.Config, disableLog bool) (*gorm.DB, error)
- func NewGormQuery(instance *gorm.DB) orm.Query
- func NewGormTransaction(instance *gorm.DB) orm.Transaction
- func NewLog(logger *log.Logger, config logger.Config, silent bool) logger.Interface
- func NewOrm(ctx context.Context, name string, config *gorm.Config, disableLog bool) contractsorm.Orm
- type Application
- type DB
- type Field
- type GormDB
- type GormQuery
- func (r *GormQuery) Count(count *int64) *gorm.DB
- func (r *GormQuery) Create(value interface{}) *gorm.DB
- func (r *GormQuery) Delete(value interface{}, conds ...interface{}) *gorm.DB
- func (r *GormQuery) Distinct(args ...interface{}) orm.Query
- func (r *GormQuery) Driver() orm.Driver
- func (r *GormQuery) Exec(sql string, values ...interface{}) *gorm.DB
- func (r *GormQuery) Fields(schema, name string) (fields []string, err error)
- func (r *GormQuery) Find(dest interface{}, conds ...interface{}) *gorm.DB
- func (r *GormQuery) First(dest interface{}) *gorm.DB
- func (r *GormQuery) FirstOrCreate(dest interface{}, conds ...interface{}) *gorm.DB
- func (r *GormQuery) ForceDelete(value interface{}, conds ...interface{}) *gorm.DB
- func (r *GormQuery) Get(dest interface{}) *gorm.DB
- func (r *GormQuery) Group(name string) orm.Query
- func (r *GormQuery) Having(query interface{}, args ...interface{}) orm.Query
- func (r *GormQuery) Instance() *gorm.DB
- func (r *GormQuery) Join(query string, args ...interface{}) orm.Query
- func (r *GormQuery) Limit(limit int) orm.Query
- func (r *GormQuery) Model(value interface{}) orm.Query
- func (r *GormQuery) Offset(offset int) orm.Query
- func (r *GormQuery) OrWhere(query interface{}, args ...interface{}) orm.Query
- func (r *GormQuery) Order(value interface{}) orm.Query
- func (r *GormQuery) Pluck(column string, dest interface{}) *gorm.DB
- func (r *GormQuery) Raw(sql string, values ...interface{}) orm.Query
- func (r *GormQuery) Save(value interface{}) *gorm.DB
- func (r *GormQuery) Scan(dest interface{}) *gorm.DB
- func (r *GormQuery) Scopes(funcs ...func(orm.Query) orm.Query) orm.Query
- func (r *GormQuery) Select(query interface{}, args ...interface{}) orm.Query
- func (r *GormQuery) Table(name string, args ...interface{}) orm.Query
- func (r *GormQuery) Update(column string, value interface{}) *gorm.DB
- func (r *GormQuery) Updates(values interface{}) *gorm.DB
- func (r *GormQuery) Where(query interface{}, args ...interface{}) orm.Query
- func (r *GormQuery) With(query string, args ...interface{}) orm.Query
- func (r *GormQuery) WithContext(ctx context.Context) orm.Query
- func (r *GormQuery) WithTrashed() orm.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 NewGormInstance ¶
func NewGormTransaction ¶
func NewGormTransaction(instance *gorm.DB) orm.Transaction
Types ¶
type Application ¶
func (*Application) Init ¶
func (app *Application) Init() orm.Orm
type GormQuery ¶
type GormQuery struct {
// contains filtered or unexported fields
}
func (*GormQuery) FirstOrCreate ¶
func (*GormQuery) ForceDelete ¶
func (*GormQuery) WithContext ¶ added in v1.0.86
func (*GormQuery) WithTrashed ¶
type GormTransaction ¶
func (*GormTransaction) Commit ¶
func (r *GormTransaction) Commit() *gorm.DB
func (*GormTransaction) Rollback ¶
func (r *GormTransaction) Rollback() *gorm.DB
type Logger ¶
type Orm ¶
type Orm struct { Name string // contains filtered or unexported fields }
func (*Orm) Connection ¶
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 ¶
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.