driver

package
v2.27.1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 5 Imported by: 240

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

type Batch interface {
	Abort() error
	Append(v ...any) error
	AppendStruct(v any) error
	Column(int) BatchColumn
	Flush() error
	Send() error
	IsSent() bool
	Rows() int
	Columns() []column.Interface
}

type BatchColumn

type BatchColumn interface {
	Append(any) error
	AppendRow(any) error
}

type ColumnType

type ColumnType interface {
	Name() string
	Nullable() bool
	ScanType() reflect.Type
	DatabaseTypeName() string
}

type Conn

type Conn interface {
	Contributors() []string
	ServerVersion() (*ServerVersion, error)
	Select(ctx context.Context, dest any, query string, args ...any) error
	Query(ctx context.Context, query string, args ...any) (Rows, error)
	QueryRow(ctx context.Context, query string, args ...any) Row
	PrepareBatch(ctx context.Context, query string, opts ...PrepareBatchOption) (Batch, error)
	Exec(ctx context.Context, query string, args ...any) error
	AsyncInsert(ctx context.Context, query string, wait bool, args ...any) error
	Ping(context.Context) error
	Stats() Stats
	Close() error
}

type NamedDateValue added in v2.1.1

type NamedDateValue struct {
	Name  string
	Value time.Time
	Scale uint8
}

type NamedValue

type NamedValue struct {
	Name  string
	Value any
}

type PrepareBatchOption added in v2.13.0

type PrepareBatchOption func(options *PrepareBatchOptions)

func WithCloseOnFlush added in v2.24.0

func WithCloseOnFlush() PrepareBatchOption

WithCloseOnFlush closes batch INSERT query when Flush is executed

func WithReleaseConnection added in v2.13.0

func WithReleaseConnection() PrepareBatchOption

type PrepareBatchOptions added in v2.13.0

type PrepareBatchOptions struct {
	ReleaseConnection bool
	CloseOnFlush      bool
}

type Row

type Row interface {
	Err() error
	Scan(dest ...any) error
	ScanStruct(dest any) error
}

type Rows

type Rows interface {
	Next() bool
	Scan(dest ...any) error
	ScanStruct(dest any) error
	ColumnTypes() []ColumnType
	Totals(dest ...any) error
	Columns() []string
	Close() error
	Err() error
}

type ServerVersion

type ServerVersion = proto.ServerHandshake

type Stats

type Stats struct {
	MaxOpenConns int
	MaxIdleConns int
	Open         int
	Idle         int
}

Jump to

Keyboard shortcuts

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