Help us shape the future of Go! Take the 2026 Go Developer Survey

sql

package
v0.3.100 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: MIT Imports: 15 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 DBNoDefault

func DBNoDefault(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 JsonB added in v0.3.92

type JsonB[T any] struct {
	// contains filtered or unexported fields
}

func NewJsonB added in v0.3.95

func NewJsonB[T any](value T) *JsonB[T]

func (*JsonB[T]) Scan added in v0.3.92

func (j *JsonB[T]) Scan(value any) error

func (JsonB[T]) String added in v0.3.95

func (j JsonB[T]) String() string

func (JsonB[T]) Value added in v0.3.92

func (j JsonB[T]) Value() (driver.Value, error)

func (JsonB[T]) ValueType added in v0.3.95

func (j JsonB[T]) ValueType() T

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