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(ctx context.Context) contractsorm.Orm
- type Application
- type DB
- type GormDB
- type GormQuery
- func (r *GormQuery) Count(count *int64) error
- func (r *GormQuery) Create(value interface{}) error
- func (r *GormQuery) Delete(value interface{}, conds ...interface{}) error
- func (r *GormQuery) Distinct(args ...interface{}) contractsorm.Query
- func (r *GormQuery) Driver() contractsorm.Driver
- func (r *GormQuery) Exec(sql string, values ...interface{}) error
- func (r *GormQuery) Find(dest interface{}, conds ...interface{}) error
- func (r *GormQuery) First(dest interface{}) error
- func (r *GormQuery) FirstOrCreate(dest interface{}, conds ...interface{}) error
- func (r *GormQuery) ForceDelete(value interface{}, conds ...interface{}) error
- func (r *GormQuery) Get(dest interface{}) error
- func (r *GormQuery) Group(name string) contractsorm.Query
- func (r *GormQuery) Having(query interface{}, args ...interface{}) contractsorm.Query
- func (r *GormQuery) Join(query string, args ...interface{}) contractsorm.Query
- func (r *GormQuery) Limit(limit int) contractsorm.Query
- func (r *GormQuery) Model(value interface{}) contractsorm.Query
- func (r *GormQuery) Offset(offset int) contractsorm.Query
- func (r *GormQuery) OrWhere(query interface{}, args ...interface{}) contractsorm.Query
- func (r *GormQuery) Order(value interface{}) contractsorm.Query
- func (r *GormQuery) Pluck(column string, dest interface{}) error
- func (r *GormQuery) Raw(sql string, values ...interface{}) contractsorm.Query
- func (r *GormQuery) Save(value interface{}) error
- func (r *GormQuery) Scan(dest interface{}) error
- func (r *GormQuery) Scopes(funcs ...func(contractsorm.Query) contractsorm.Query) contractsorm.Query
- func (r *GormQuery) Select(query interface{}, args ...interface{}) contractsorm.Query
- func (r *GormQuery) Table(name string, args ...interface{}) contractsorm.Query
- func (r *GormQuery) Update(column string, value interface{}) error
- func (r *GormQuery) Updates(values interface{}) error
- func (r *GormQuery) Where(query interface{}, args ...interface{}) contractsorm.Query
- func (r *GormQuery) WithTrashed() contractsorm.Query
- type GormTransaction
- type Logger
- func (l Logger) Error(ctx context.Context, msg string, data ...interface{})
- func (l Logger) Info(ctx context.Context, msg string, data ...interface{})
- 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 ...interface{})
- type Orm
- type ServiceProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileWithLineNum ¶ added in v1.0.0
func FileWithLineNum() string
FileWithLineNum return the file name and line number of the current file
func NewGormQuery ¶ added in v1.0.1
func NewGormQuery(instance *gorm.DB) contractsorm.Query
func NewGormTransaction ¶ added in v1.0.1
func NewGormTransaction(instance *gorm.DB) contractsorm.Transaction
Types ¶
type Application ¶
type Application struct { }
func (*Application) Init ¶
func (app *Application) Init() orm.Orm
type GormDB ¶ added in v1.0.1
type GormDB struct { contractsorm.Query // contains filtered or unexported fields }
func (*GormDB) Begin ¶ added in v1.0.1
func (r *GormDB) Begin() (contractsorm.Transaction, error)
type GormQuery ¶ added in v1.0.1
type GormQuery struct {
// contains filtered or unexported fields
}
func (*GormQuery) Distinct ¶ added in v1.0.2
func (r *GormQuery) Distinct(args ...interface{}) contractsorm.Query
func (*GormQuery) Driver ¶ added in v1.2.3
func (r *GormQuery) Driver() contractsorm.Driver
func (*GormQuery) FirstOrCreate ¶ added in v1.0.1
func (*GormQuery) ForceDelete ¶ added in v1.0.1
func (*GormQuery) Having ¶ added in v1.0.1
func (r *GormQuery) Having(query interface{}, args ...interface{}) contractsorm.Query
func (*GormQuery) Join ¶ added in v1.0.1
func (r *GormQuery) Join(query string, args ...interface{}) contractsorm.Query
func (*GormQuery) Model ¶ added in v1.0.1
func (r *GormQuery) Model(value interface{}) contractsorm.Query
func (*GormQuery) Offset ¶ added in v1.0.1
func (r *GormQuery) Offset(offset int) contractsorm.Query
func (*GormQuery) OrWhere ¶ added in v1.0.1
func (r *GormQuery) OrWhere(query interface{}, args ...interface{}) contractsorm.Query
func (*GormQuery) Order ¶ added in v1.0.1
func (r *GormQuery) Order(value interface{}) contractsorm.Query
func (*GormQuery) Raw ¶ added in v1.0.1
func (r *GormQuery) Raw(sql string, values ...interface{}) contractsorm.Query
func (*GormQuery) Scopes ¶ added in v1.0.1
func (r *GormQuery) Scopes(funcs ...func(contractsorm.Query) contractsorm.Query) contractsorm.Query
func (*GormQuery) Select ¶ added in v1.0.1
func (r *GormQuery) Select(query interface{}, args ...interface{}) contractsorm.Query
func (*GormQuery) Table ¶ added in v1.0.1
func (r *GormQuery) Table(name string, args ...interface{}) contractsorm.Query
func (*GormQuery) Where ¶ added in v1.0.1
func (r *GormQuery) Where(query interface{}, args ...interface{}) contractsorm.Query
func (*GormQuery) WithTrashed ¶ added in v1.0.1
func (r *GormQuery) WithTrashed() contractsorm.Query
type GormTransaction ¶ added in v1.0.1
type GormTransaction struct { contractsorm.Query // contains filtered or unexported fields }
func (*GormTransaction) Commit ¶ added in v1.0.1
func (r *GormTransaction) Commit() error
func (*GormTransaction) Rollback ¶ added in v1.0.1
func (r *GormTransaction) Rollback() error
type Logger ¶ added in v1.0.0
type Orm ¶ added in v1.0.0
type Orm struct {
// contains filtered or unexported fields
}
func (*Orm) Connection ¶ added in v1.0.0
func (r *Orm) Connection(name string) contractsorm.Orm
func (*Orm) Query ¶ added in v1.0.0
func (r *Orm) Query() contractsorm.DB
func (*Orm) Transaction ¶ added in v1.0.0
func (r *Orm) Transaction(txFunc func(tx contractsorm.Transaction) error) error
func (*Orm) WithContext ¶ added in v1.0.0
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.