base

package
v0.0.0-...-27647ab Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	ScanType(c Column) reflect.Type
	// contains filtered or unexported methods
}

type BaseAdapter

type BaseAdapter struct{}

func (BaseAdapter) ScanType

func (a BaseAdapter) ScanType(c Column) reflect.Type

type BaseConn

type BaseConn struct{}

type BaseDb

type BaseDb struct{}

type BaseRows

type BaseRows struct{}

type Column

type Column struct {
	Name   string
	DbType string
	Type   reflect.Type
}

type Columns

type Columns struct {
	// contains filtered or unexported fields
}

func ColumnsOf

func ColumnsOf(s ...Column) (*Columns, error)

func (Columns) At

func (cs Columns) At(i int) Column

func (Columns) Contains

func (cs Columns) Contains(k string) bool

func (Columns) ForEach

func (cs Columns) ForEach(fn func(kv bt.Kv[string, Column]) bool) bool

func (Columns) Get

func (cs Columns) Get(k string) Column

func (Columns) Index

func (cs Columns) Index(k string) (int, bool)

func (Columns) Iterate

func (cs Columns) Iterate() bt.Iterator[bt.Kv[string, Column]]

func (Columns) Len

func (cs Columns) Len() int

func (Columns) TryGet

func (cs Columns) TryGet(k string) (Column, bool)

type Conn

type Conn interface {
	Querier
	// contains filtered or unexported methods
}

type Db

type Db interface {
	Querier

	Connect(ctx context.Context) (Conn, error)
	// contains filtered or unexported methods
}

type Dsn

type Dsn struct {
	Host string
	Port int

	User string
	Pass stru.Secret
}

type DuplicateColumnError

type DuplicateColumnError struct {
	Name string
}

func (DuplicateColumnError) Error

func (e DuplicateColumnError) Error() string

type Querier

type Querier interface {
	Adapter() Adapter
	Query(qry Query) (Rows, error)

	Close() error
}

type Query

type Query struct {
	Ctx  context.Context
	Mode QueryMode
	Text string
	Args []any
}

type QueryMode

type QueryMode int8
const (
	QueryQuery QueryMode = iota
	ExecQuery
)

type Rows

type Rows interface {
	Columns() (*Columns, error)

	Next() bool
	Scan(dest ...any) error
	Err() error

	Close() error
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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