sql

package
v0.3.74 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2025 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(config map[string]config.SQL)

func DB

func DB(name ...string) some.Some[*sql.DB]

func GetNoDefault added in v0.3.73

func GetNoDefault(name ...string) some.Some[*sql.DB]

func NewNullString

func NewNullString(inp *string) sql.NullString

func NewNullUUID

func NewNullUUID(inp *uuid.UUID) uuid.NullUUID

Types

type Executor

type Executor interface {
	ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
}

type NullTime

type NullTime struct {
	sql.NullTime
}

func NewNullTime

func NewNullTime(inp *time.Time) NullTime

func (NullTime) MarshalJSON

func (nt NullTime) MarshalJSON() ([]byte, error)

func (*NullTime) UnmarshalJSON

func (nt *NullTime) UnmarshalJSON(data []byte) error

type Preparation

type Preparation interface {
	PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)
}

type Querier

type Querier interface {
	PingContext(ctx context.Context) error
	QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
	QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
	BeginTx(ctx context.Context, opts *sql.TxOptions) (*sql.Tx, error)
}

type Tx

type Tx interface {
	Querier
	Executor
	Commit() error
	Rollback() error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL