Documentation ¶
Index ¶
- func ArgMap(tag string, sct any) map[string]any
- type Client
- func (c *Client) Begin() (*Transaction, error)
- func (c *Client) Clone() *Client
- func (c *Client) Exec(chk, stmt string, args map[string]any) error
- func (c *Client) Query(dst any, stmt string, args map[string]any) error
- func (c *Client) QueryStream(stmt string, args map[string]any) (*RowStream, error)
- type RowStream
- type StmtArgsError
- type Transaction
- func (t *Transaction) Commit() error
- func (t *Transaction) Exec(chk, stmt string, args map[string]any) error
- func (t *Transaction) Query(dst any, stmt string, args map[string]any) error
- func (t *Transaction) QueryStream(stmt string, args map[string]any) (*RowStream, error)
- func (t *Transaction) Rollback() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { // Tag is the struct tag to map the column name to. Tag string // ColumnTagMap takes a database column name and returns what struct tag // value it should match against. ColumnTagMap func(col string) string // OnQueryExec is a function that runs before every Query or Exec call is // made to the underlying DB object. Useful for logging. OnQueryExec func(stmt string, args []any) // StmtArgsErrors indicates whether errors should be wrapped with the // statement and args that caused the error. StmtArgsErrors bool // DB is the underlying connection to the database. DB *sql.DB }
func (*Client) Begin ¶
func (c *Client) Begin() (*Transaction, error)
type StmtArgsError ¶
func (*StmtArgsError) Error ¶
func (e *StmtArgsError) Error() string
func (*StmtArgsError) Unwrap ¶
func (e *StmtArgsError) Unwrap() error
type Transaction ¶
type Transaction struct { RollbackErrTxDone bool // contains filtered or unexported fields }
func (*Transaction) Commit ¶
func (t *Transaction) Commit() error
func (*Transaction) QueryStream ¶
func (*Transaction) Rollback ¶
func (t *Transaction) Rollback() error
Click to show internal directories.
Click to hide internal directories.