Versions in this module Expand all Collapse all v0 v0.0.1 Jan 14, 2024 Changes in this version + var ErrConnectionDoesNotExist = errors.New("this connection has been closed") + type Connection struct + func NewConnection(db *sql.DB) *Connection + func (c *Connection) BeginTransaction(ctx context.Context) (sql.TransactionStatus, error) + func (c *Connection) Close() error + func (c *Connection) Driver() driver.Driver + func (c *Connection) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error) + func (c *Connection) IsClosed() bool + func (c *Connection) PingContext(ctx context.Context) error + func (c *Connection) PrepareContext(ctx context.Context, query string, args ...any) (sql.Statement, error) + func (c *Connection) QueryContext(ctx context.Context, query string, args ...any) (sql.RowSet, error) + func (c *Connection) QueryRowContext(ctx context.Context, query string, args ...any) (sql.Row, error) + func (c *Connection) SetConnMaxIdleTime(d time.Duration) error + func (c *Connection) SetConnMaxLifetime(d time.Duration) error + func (c *Connection) SetMaxIdleConns(n int) error + func (c *Connection) SetMaxOpenConns(n int) error + type DataSource struct + func NewDataSource(props DataSourceProperties) *DataSource + func (ds *DataSource) GetConnection() (sql.Connection, error) + type DataSourceProperties struct + Password string + Url string + Username string + type Operations interface + Exec func(ctx context.Context, query string, args ...any) (sql.Result, error) + Prepare func(ctx context.Context, query string) (sql.Statement, error) + Query func(ctx context.Context, query string, args ...any) (sql.RowSet, error) + QueryRow func(ctx context.Context, query string, args ...any) sql.Row + type Template struct + func NewTemplate(dataSource sql.DataSource) *Template + func (t *Template) Exec(ctx context.Context, query string, args ...any) (sql.Result, error) + func (t *Template) Prepare(ctx context.Context, query string) (sql.Statement, error) + func (t *Template) Query(ctx context.Context, query string, args ...any) (sql.RowSet, error) + func (t *Template) QueryRow(ctx context.Context, query string, args ...any) sql.Row v0.0.1-dev Jan 14, 2024