Documentation ¶
Index ¶
- Variables
- func GetDB() *gorm.DB
- func NewGormDB(conf *config.Config, gormLogger logger.Interface) *gorm.DB
- func SetCtxQuery(ctx context.Context, q *Query) context.Context
- func SetDefault(db *gorm.DB, opts ...gen.DOOption)
- func Transaction(ctx context.Context, fn func(txCtx context.Context) error) error
- type Query
- func (q *Query) Available() bool
- func (q *Query) Begin(opts ...*sql.TxOptions) *QueryTx
- func (q *Query) ReadDB() *Query
- func (q *Query) ReplaceDB(db *gorm.DB) *Query
- func (q *Query) Transaction(fc func(tx *Query) error, opts ...*sql.TxOptions) error
- func (q *Query) WithContext(ctx context.Context) *queryCtx
- func (q *Query) WriteDB() *Query
- type QueryTx
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DB *gorm.DB DBType consts.DBType )
View Source
var ( Q = new(Query) Attachment *attachment Category *category Comment *comment CommentBlack *commentBlack FlywaySchemaHistory *flywaySchemaHistory Journal *journal Link *link Log *log Menu *menu Meta *meta Option *option Photo *photo Post *post PostCategory *postCategory PostTag *postTag Tag *tag ThemeSetting *themeSetting User *user )
Functions ¶
Types ¶
type Query ¶
type Query struct { Attachment attachment Category category Comment comment CommentBlack commentBlack FlywaySchemaHistory flywaySchemaHistory Journal journal Link link Log log Menu menu Meta meta Option option Photo photo Post post PostCategory postCategory PostTag postTag Tag tag ThemeSetting themeSetting User user // contains filtered or unexported fields }
func GetQueryByCtx ¶ added in v1.0.3
func (*Query) Transaction ¶
func (*Query) WithContext ¶
type QueryTx ¶
func (*QueryTx) RollbackTo ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.