Documentation
¶
Index ¶
- func ForceReplica(db *gorm.DB) *gorm.DB
- func IsForceReplica(ctx context.Context) bool
- func IsWithoutReplica(ctx context.Context) bool
- func Primary(db *gorm.DB) *gorm.DB
- func Replica(db *gorm.DB) *gorm.DB
- func ResolveTable(db *gorm.DB, model interface{}) string
- func UseReplica(ctx context.Context) bool
- func WithDecision(ctx context.Context, p Pool) context.Context
- func WithForceReplica(ctx context.Context) context.Context
- func WithReplica(ctx context.Context) context.Context
- func WithoutReplica(ctx context.Context) context.Context
- type ACLBuilder
- type ConnPool
- func (p *ConnPool) BeginTx(ctx context.Context, opts *sql.TxOptions) (*sql.Tx, error)
- func (p *ConnPool) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (p *ConnPool) GetDBConn() (*sql.DB, error)
- func (p *ConnPool) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)
- func (p *ConnPool) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (p *ConnPool) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
- type Plugin
- type Pool
- type TableACL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsForceReplica ¶
func IsWithoutReplica ¶
func ResolveTable ¶
func UseReplica ¶
Types ¶
type ACLBuilder ¶
type ACLBuilder struct {
// contains filtered or unexported fields
}
func NewACLBuilder ¶
func NewACLBuilder(db *gorm.DB) *ACLBuilder
func (*ACLBuilder) Allow ¶
func (b *ACLBuilder) Allow(models ...interface{}) *ACLBuilder
func (*ACLBuilder) Build ¶
func (b *ACLBuilder) Build() *TableACL
func (*ACLBuilder) Deny ¶
func (b *ACLBuilder) Deny(models ...interface{}) *ACLBuilder
type ConnPool ¶
type ConnPool struct {
// contains filtered or unexported fields
}
func NewConnPool ¶
func (*ConnPool) ExecContext ¶
func (*ConnPool) PrepareContext ¶
func (*ConnPool) QueryContext ¶
Click to show internal directories.
Click to hide internal directories.