Documentation ¶
Index ¶
- Variables
- func Exec(ctx context.Context, e Execer, sql string, args ...any) error
- func Open(ctx context.Context, url string) (*pgxpool.Pool, error)
- func Query[T any](ctx context.Context, q Queryer, sql string, args ...any) ([]T, error)
- func QueryRow[T any](ctx context.Context, q Queryer, sql string, args ...any) (T, error)
- func QueryValue[T any](ctx context.Context, q Queryer, sql string, args ...any) (T, error)
- type Acquirer
- type BatchSender
- type Beginner
- type Client
- type ClientOption
- type ClientOptionFunc
- type Closer
- type Connector
- type Copier
- type DB
- type Execer
- type MigrateAction
- type MigrateActionFlag
- type Migrator
- type NamedArgs
- type Opener
- type Queryer
- type Tx
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("not found") ErrAlreadyExists = errors.New("already exists") )
Functions ¶
Types ¶
type BatchSender ¶
type ClientOption ¶
type ClientOption interface {
// contains filtered or unexported methods
}
type ClientOptionFunc ¶
type ClientOptionFunc func(*client)
func WithLogger ¶
func WithLogger(log *slog.Logger) ClientOptionFunc
func WithMigrations ¶
func WithMigrations(fsys fs.FS, act MigrateAction) ClientOptionFunc
type MigrateAction ¶
type MigrateAction string
const ( MigrateUp MigrateAction = "up" MigrateDown MigrateAction = "down" )
func ParseMigrateAction ¶
func ParseMigrateAction(s string) (MigrateAction, error)
type MigrateActionFlag ¶
type MigrateActionFlag struct { IsSet bool Val MigrateAction }
func (*MigrateActionFlag) Set ¶
func (f *MigrateActionFlag) Set(s string) error
func (*MigrateActionFlag) String ¶
func (f *MigrateActionFlag) String() string
Click to show internal directories.
Click to hide internal directories.