Documentation ¶
Index ¶
- Variables
- type 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
- type DataSourceProperties
- type Operations
- type 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
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrConnectionDoesNotExist = errors.New("this connection has been closed")
)
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func NewConnection ¶
func NewConnection(db *sql.DB) *Connection
func (*Connection) BeginTransaction ¶
func (c *Connection) BeginTransaction(ctx context.Context) (sql.TransactionStatus, error)
func (*Connection) Close ¶
func (c *Connection) Close() error
func (*Connection) Driver ¶
func (c *Connection) Driver() driver.Driver
func (*Connection) ExecContext ¶
func (*Connection) IsClosed ¶
func (c *Connection) IsClosed() bool
func (*Connection) PingContext ¶
func (c *Connection) PingContext(ctx context.Context) error
func (*Connection) PrepareContext ¶
func (*Connection) QueryContext ¶
func (*Connection) QueryRowContext ¶
func (*Connection) SetConnMaxIdleTime ¶
func (c *Connection) SetConnMaxIdleTime(d time.Duration) error
func (*Connection) SetConnMaxLifetime ¶
func (c *Connection) SetConnMaxLifetime(d time.Duration) error
func (*Connection) SetMaxIdleConns ¶
func (c *Connection) SetMaxIdleConns(n int) error
func (*Connection) SetMaxOpenConns ¶
func (c *Connection) SetMaxOpenConns(n int) error
type DataSource ¶
type DataSource struct {
// contains filtered or unexported fields
}
func NewDataSource ¶
func NewDataSource(props DataSourceProperties) *DataSource
func (*DataSource) GetConnection ¶
func (ds *DataSource) GetConnection() (sql.Connection, error)
type DataSourceProperties ¶
type Operations ¶
type Operations interface { Exec(ctx context.Context, query string, args ...any) (sql.Result, error) Prepare(ctx context.Context, query string) (sql.Statement, error) Query(ctx context.Context, query string, args ...any) (sql.RowSet, error) QueryRow(ctx context.Context, query string, args ...any) sql.Row }
Click to show internal directories.
Click to hide internal directories.