conn

package
v0.4.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(cfg config.Database) *Connection

func NewOpenedConnection

func NewOpenedConnection(db *sqlx.DB) (*Connection, error)

func (*Connection) Close

func (c *Connection) Close() error

func (*Connection) Connect

func (c *Connection) Connect(ctx context.Context) (*sqlx.DB, error)

func (*Connection) Database

func (c *Connection) Database() config.Database

func (*Connection) ExtContext

func (c *Connection) ExtContext(ctx context.Context) (sqlx.ExtContext, error)

func (*Connection) Transact

func (c *Connection) Transact(ctx context.Context, fn func(context.Context) error) error

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

func NewPool

func NewPool() *Pool

func (*Pool) All

func (p *Pool) All() map[string]*Connection

func (*Pool) Close

func (p *Pool) Close() error

func (*Pool) Get

func (p *Pool) Get(name string) (*Connection, bool)

func (*Pool) Setup

func (p *Pool) Setup(ds map[string]config.Database)

type Transactioner

type Transactioner func(context.Context, func(ctx context.Context) error) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL