Documentation ¶
Index ¶
- Constants
- func CreateDBPool(driver, dsn string, cfg *ConnConfig) (*sql.DB, error)
- func GetROConnection(ctx context.Context) *sql.DB
- func GetRWConnection(ctx context.Context) *sql.DB
- func NewDataServerManagerContext(ctx context.Context, m *Manager) context.Context
- func SQLiteSchemaPath(ctx context.Context) string
- func SQLiteSchemaProvider(ctx context.Context) string
- type ConnConfig
- type ConnOptions
- type Connection
- type ConnectionType
- type DSNConfig
- type DSNOptions
- type Manager
Constants ¶
View Source
const (
SQLiteDriver = "sqlite3"
)
Variables ¶
This section is empty.
Functions ¶
func CreateDBPool ¶
func CreateDBPool(driver, dsn string, cfg *ConnConfig) (*sql.DB, error)
func SQLiteSchemaPath ¶
func SQLiteSchemaProvider ¶
Types ¶
type ConnConfig ¶
type ConnConfig struct {
// contains filtered or unexported fields
}
func NewConnConfig ¶
func NewConnConfig(opts ...ConnOptions) *ConnConfig
type ConnOptions ¶
type ConnOptions func(*ConnConfig)
type Connection ¶
type Connection struct { Type ConnectionType // contains filtered or unexported fields }
func ROConnPoolProvider ¶
func ROConnPoolProvider(ctx context.Context) *Connection
func RWConnPoolProvider ¶
func RWConnPoolProvider(ctx context.Context) *Connection
type ConnectionType ¶
type ConnectionType string
type DSNConfig ¶
type DSNConfig struct {
// contains filtered or unexported fields
}
func NewConfig ¶
func NewConfig(opts ...DSNOptions) *DSNConfig
type DSNOptions ¶
type DSNOptions func(*DSNConfig)
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager supports connection to only one SQLite DB
func DataServerManagerFromContext ¶
DataServerManagerFromContext extracts the db manager instance from the given context.
func NewManager ¶
func (*Manager) GetDBConnection ¶
func (m *Manager) GetDBConnection(ctype ConnectionType) *sql.DB
Click to show internal directories.
Click to hide internal directories.