Documentation ¶
Index ¶
- type Database
- func (d *Database) BeginTx() (*Tx, error)
- func (d *Database) BeginTxCtx(ctx context.Context) (*Tx, error)
- func (d *Database) Client() *sql.DB
- func (d *Database) Close() error
- func (d *Database) ExecContext(ctx context.Context, query string, args ...any) (int64, error)
- func (d *Database) Insert(query string, args ...any) (int64, error)
- func (d *Database) InsertContext(ctx context.Context, query string, args ...any) (int64, error)
- func (d *Database) Ping(ctx context.Context) error
- func (d *Database) QueryForMap(query string, args ...any) (map[string]any, error)
- func (d *Database) QueryForMapSlice(query string, args ...any) ([]map[string]any, error)
- func (d *Database) QueryMapContext(ctx context.Context, query string, args ...any) (map[string]any, error)
- func (d *Database) QueryMapSliceContext(ctx context.Context, query string, args ...any) ([]map[string]any, error)
- func (d *Database) Reset(db *sql.DB, dsn string)
- type Option
- type Tx
- func (t *Tx) Close() error
- func (t *Tx) ExecContext(ctx context.Context, query string, args ...any) (int64, error)
- func (t *Tx) HasError()
- func (t *Tx) Insert(query string, args ...any) (int64, error)
- func (t *Tx) InsertContext(ctx context.Context, query string, args ...any) (int64, error)
- func (t *Tx) QueryForMap(query string, args ...any) (map[string]any, error)
- func (t *Tx) QueryForMapSlice(query string, args ...any) ([]map[string]any, error)
- func (t *Tx) QueryMapContext(ctx context.Context, query string, args ...any) (map[string]any, error)
- func (t *Tx) QueryMapSliceContext(ctx context.Context, query string, args ...any) ([]map[string]any, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func (*Database) BeginTxCtx ¶ added in v1.0.10
func (*Database) ExecContext ¶ added in v1.3.0
func (*Database) InsertContext ¶
func (*Database) QueryForMap ¶
func (*Database) QueryForMapSlice ¶
func (*Database) QueryMapContext ¶
func (*Database) QueryMapSliceContext ¶
type Option ¶
type Option func(*Database)
func WithMaxConns ¶
func WithMaxIdle ¶
func WithMaxIdleTime ¶ added in v1.4.0
func WithMaxLifetime ¶
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
func (*Tx) ExecContext ¶ added in v1.3.0
func (*Tx) InsertContext ¶
func (*Tx) QueryForMap ¶
func (*Tx) QueryForMapSlice ¶
func (*Tx) QueryMapContext ¶
Click to show internal directories.
Click to hide internal directories.