Documentation ¶
Index ¶
- Variables
- func GetDBByCtx(ctx context.Context) *gorm.DB
- func NewGormDB(conf *config.Config, gormLogger logger.Interface) *gorm.DB
- func SetCtxDB(ctx context.Context, tx *gorm.DB) 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 (*Query) Transaction ¶
func (*Query) WithContext ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.