Documentation ¶
Index ¶
- func Query() query.Query
- func Schema() schema.Schema
- type Connection
- type Manager
- func Add(name string, driver string, dsn string) (*Manager, error)
- func AddConn(name string, driver string, datasource string, timeout ...time.Duration) *Manager
- func AddRead(name string, driver string, dsn string) (*Manager, error)
- func AddReadConn(name string, driver string, datasource string, timeout ...time.Duration) *Manager
- func New() *Manager
- func NewWithOption(option dbal.Option) *Manager
- func (manager *Manager) Add(name string, driver string, datasource string, readonly bool) (*Manager, error)
- func (manager *Manager) AddConn(name string, driver string, datasource string, timeout ...time.Duration) *Manager
- func (manager *Manager) AddConnection(name string, driver string, datasource string, readonly bool, ...) *Manager
- func (manager *Manager) AddReadConn(name string, driver string, datasource string, timeout ...time.Duration) *Manager
- func (manager *Manager) Close() error
- func (manager *Manager) Primary() (*Connection, error)
- func (manager *Manager) Query() query.Query
- func (manager *Manager) ReadOnly() (*Connection, error)
- func (manager *Manager) Schema() schema.Schema
- func (manager *Manager) SetAsGlobal()
- func (manager *Manager) SetOption(option dbal.Option)
- type Pool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Connection ¶
type Manager ¶
func AddReadConn ¶
func NewWithOption ¶
func (*Manager) AddConnection ¶
func (*Manager) AddReadConn ¶
func (*Manager) Primary ¶
func (manager *Manager) Primary() (*Connection, error)
func (*Manager) ReadOnly ¶
func (manager *Manager) ReadOnly() (*Connection, error)
func (*Manager) SetAsGlobal ¶
func (manager *Manager) SetAsGlobal()
type Pool ¶
type Pool struct { Primary []*Connection Readonly []*Connection }
func (Pool) RandPrimary ¶
func (pool Pool) RandPrimary() (*Connection, error)
func (*Pool) RandReadOnly ¶
func (pool *Pool) RandReadOnly() (*Connection, error)
Click to show internal directories.
Click to hide internal directories.