sqldb

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2019 License: MIT Imports: 6 Imported by: 0

README

Build Status

sqldb

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binder

type Binder func(Scanner) error

type BindingConnectionPool

type BindingConnectionPool interface {
	Ping() error
	BeginTransaction() (BindingTransaction, error)
	Close() error
	Executor
	BindingSelector
}

func ConfigureBindingConnectionPool

func ConfigureBindingConnectionPool(pool *sql.DB, options ...Option) BindingConnectionPool

type BindingConnectionPoolAdapter

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

func NewBindingConnectionPoolAdapter

func NewBindingConnectionPoolAdapter(actual ConnectionPool, panicOnBindError bool) *BindingConnectionPoolAdapter

func (*BindingConnectionPoolAdapter) BeginTransaction

func (this *BindingConnectionPoolAdapter) BeginTransaction() (BindingTransaction, error)

func (*BindingConnectionPoolAdapter) BindSelect

func (this *BindingConnectionPoolAdapter) BindSelect(binder Binder, statement string, parameters ...interface{}) error

func (*BindingConnectionPoolAdapter) Close

func (this *BindingConnectionPoolAdapter) Close() error

func (*BindingConnectionPoolAdapter) Execute

func (this *BindingConnectionPoolAdapter) Execute(statement string, parameters ...interface{}) (uint64, error)

func (*BindingConnectionPoolAdapter) ExecuteIdentity

func (this *BindingConnectionPoolAdapter) ExecuteIdentity(statement string, parameters ...interface{}) (uint64, uint64, error)

func (*BindingConnectionPoolAdapter) Ping

func (this *BindingConnectionPoolAdapter) Ping() error

type BindingSelectExecutor

type BindingSelectExecutor interface {
	BindingSelector
	Executor
}

type BindingSelector

type BindingSelector interface {
	BindSelect(Binder, string, ...interface{}) error
}

type BindingSelectorAdapter

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

func NewBindingSelectorAdapter

func NewBindingSelectorAdapter(selector Selector, panicOnBindError bool) *BindingSelectorAdapter

func (*BindingSelectorAdapter) BindSelect

func (this *BindingSelectorAdapter) BindSelect(binder Binder, statement string, parameters ...interface{}) error

type BindingTransaction

type BindingTransaction interface {
	Commit() error
	Rollback() error
	Executor
	BindingSelector
}

type BindingTransactionAdapter

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

func NewBindingTransactionAdapter

func NewBindingTransactionAdapter(actual Transaction, panicOnBindError bool) *BindingTransactionAdapter

func (*BindingTransactionAdapter) BindSelect

func (this *BindingTransactionAdapter) BindSelect(binder Binder, statement string, parameters ...interface{}) error

func (*BindingTransactionAdapter) Commit

func (this *BindingTransactionAdapter) Commit() error

func (*BindingTransactionAdapter) Execute

func (this *BindingTransactionAdapter) Execute(statement string, parameters ...interface{}) (uint64, error)

func (*BindingTransactionAdapter) ExecuteIdentity

func (this *BindingTransactionAdapter) ExecuteIdentity(statement string, parameters ...interface{}) (uint64, uint64, error)

func (*BindingTransactionAdapter) Rollback

func (this *BindingTransactionAdapter) Rollback() error

type ConnectionPool

type ConnectionPool interface {
	Ping() error
	BeginTransaction() (Transaction, error)
	Close() error
	Executor
	Selector
}

func ConfigureConnectionPool

func ConfigureConnectionPool(pool *sql.DB, options ...Option) ConnectionPool

type Executor

type Executor interface {
	Execute(string, ...interface{}) (uint64, error)
	ExecuteIdentity(string, ...interface{}) (affected uint64, identity uint64, err error)
}

type LibraryConnectionPoolAdapter

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

func NewLibraryConnectionPoolAdapter

func NewLibraryConnectionPoolAdapter(actual *sql.DB) *LibraryConnectionPoolAdapter

func (*LibraryConnectionPoolAdapter) BeginTransaction

func (this *LibraryConnectionPoolAdapter) BeginTransaction() (Transaction, error)

func (*LibraryConnectionPoolAdapter) Close

func (this *LibraryConnectionPoolAdapter) Close() error

func (*LibraryConnectionPoolAdapter) Execute

func (this *LibraryConnectionPoolAdapter) Execute(query string, parameters ...interface{}) (uint64, error)

func (*LibraryConnectionPoolAdapter) ExecuteIdentity

func (this *LibraryConnectionPoolAdapter) ExecuteIdentity(query string, parameters ...interface{}) (uint64, uint64, error)

func (*LibraryConnectionPoolAdapter) Ping

func (this *LibraryConnectionPoolAdapter) Ping() error

func (*LibraryConnectionPoolAdapter) Select

func (this *LibraryConnectionPoolAdapter) Select(query string, parameters ...interface{}) (SelectResult, error)

type LibraryTransactionAdapter

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

func NewLibraryTransactionAdapter

func NewLibraryTransactionAdapter(actual *sql.Tx) *LibraryTransactionAdapter

func (*LibraryTransactionAdapter) Commit

func (this *LibraryTransactionAdapter) Commit() error

func (*LibraryTransactionAdapter) Execute

func (this *LibraryTransactionAdapter) Execute(query string, parameters ...interface{}) (uint64, error)

func (*LibraryTransactionAdapter) ExecuteIdentity

func (this *LibraryTransactionAdapter) ExecuteIdentity(query string, parameters ...interface{}) (uint64, uint64, error)

func (*LibraryTransactionAdapter) Rollback

func (this *LibraryTransactionAdapter) Rollback() error

func (*LibraryTransactionAdapter) Select

func (this *LibraryTransactionAdapter) Select(query string, parameters ...interface{}) (SelectResult, error)

type Option

type Option func(wireup *Wireup)

func WithMySQL

func WithMySQL() Option

func WithPanicOnBindError

func WithPanicOnBindError() Option

func WithParameterPrefix

func WithParameterPrefix(value string) Option

func WithRetry

func WithRetry(retrySleep time.Duration) Option

func WithStackTraceErrDiagnostics

func WithStackTraceErrDiagnostics() Option

type RetryBindingConnectionPool

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

func NewRetryBindingConnectionPool

func NewRetryBindingConnectionPool(inner BindingConnectionPool, sleep time.Duration) *RetryBindingConnectionPool

func (*RetryBindingConnectionPool) BeginTransaction

func (this *RetryBindingConnectionPool) BeginTransaction() (BindingTransaction, error)

func (*RetryBindingConnectionPool) BindSelect

func (this *RetryBindingConnectionPool) BindSelect(binder Binder, statement string, parameters ...interface{}) error

func (*RetryBindingConnectionPool) Close

func (this *RetryBindingConnectionPool) Close() error

func (*RetryBindingConnectionPool) Execute

func (this *RetryBindingConnectionPool) Execute(statement string, parameters ...interface{}) (uint64, error)

func (*RetryBindingConnectionPool) ExecuteIdentity

func (this *RetryBindingConnectionPool) ExecuteIdentity(statement string, parameters ...interface{}) (uint64, uint64, error)

func (*RetryBindingConnectionPool) Ping

func (this *RetryBindingConnectionPool) Ping() error

type RetryBindingSelector

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

func NewRetryBindingSelector

func NewRetryBindingSelector(actual BindingConnectionPool, duration time.Duration) *RetryBindingSelector

func (*RetryBindingSelector) BindSelect

func (this *RetryBindingSelector) BindSelect(binder Binder, statement string, parameters ...interface{}) error

type Scanner

type Scanner interface {
	Scan(...interface{}) error
}

type SelectExecutor

type SelectExecutor interface {
	Selector
	Executor
}

type SelectResult

type SelectResult interface {
	Next() bool
	Err() error
	Close() error
	Scanner
}

type Selector

type Selector interface {
	Select(string, ...interface{}) (SelectResult, error)
}

type SplitStatementConnectionPool

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

func NewSplitStatementConnectionPool

func NewSplitStatementConnectionPool(inner ConnectionPool, delimiter string) *SplitStatementConnectionPool

func (*SplitStatementConnectionPool) BeginTransaction

func (this *SplitStatementConnectionPool) BeginTransaction() (Transaction, error)

func (*SplitStatementConnectionPool) Close

func (this *SplitStatementConnectionPool) Close() error

func (*SplitStatementConnectionPool) Execute

func (this *SplitStatementConnectionPool) Execute(statement string, parameters ...interface{}) (uint64, error)

func (*SplitStatementConnectionPool) ExecuteIdentity

func (this *SplitStatementConnectionPool) ExecuteIdentity(statement string, parameters ...interface{}) (uint64, uint64, error)

func (*SplitStatementConnectionPool) Ping

func (this *SplitStatementConnectionPool) Ping() error

func (*SplitStatementConnectionPool) Select

func (this *SplitStatementConnectionPool) Select(statement string, parameters ...interface{}) (SelectResult, error)

type SplitStatementExecutor

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

func NewSplitStatementExecutor

func NewSplitStatementExecutor(actual Executor, delimiter string) *SplitStatementExecutor

func (*SplitStatementExecutor) Execute

func (this *SplitStatementExecutor) Execute(statement string, parameters ...interface{}) (uint64, error)

func (*SplitStatementExecutor) ExecuteIdentity

func (this *SplitStatementExecutor) ExecuteIdentity(statement string, parameters ...interface{}) (uint64, uint64, error)

type SplitStatementTransaction

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

func NewSplitStatementTransaction

func NewSplitStatementTransaction(inner Transaction, delimiter string) *SplitStatementTransaction

func (*SplitStatementTransaction) Commit

func (this *SplitStatementTransaction) Commit() error

func (*SplitStatementTransaction) Execute

func (this *SplitStatementTransaction) Execute(statement string, parameters ...interface{}) (uint64, error)

func (*SplitStatementTransaction) ExecuteIdentity

func (this *SplitStatementTransaction) ExecuteIdentity(statement string, parameters ...interface{}) (uint64, uint64, error)

func (*SplitStatementTransaction) Rollback

func (this *SplitStatementTransaction) Rollback() error

func (*SplitStatementTransaction) Select

func (this *SplitStatementTransaction) Select(statement string, parameters ...interface{}) (SelectResult, error)

type StackTrace

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

StackTrace, like github.com/smartystreets/clock.Clock performs in production mode when used as a nil pointer struct field. When non-nil, it returns a preset value. This is useful during testing when asserting on simple, deterministic values is helpful.

func ContrivedStackTrace

func ContrivedStackTrace(trace string) *StackTrace

func (*StackTrace) StackTrace

func (this *StackTrace) StackTrace() string

func (*StackTrace) Wrap

func (this *StackTrace) Wrap(err error) error

type StackTraceConnectionPool

type StackTraceConnectionPool struct {
	*StackTrace
	// contains filtered or unexported fields
}

func NewStackTraceConnectionPool

func NewStackTraceConnectionPool(inner ConnectionPool) *StackTraceConnectionPool

func (*StackTraceConnectionPool) BeginTransaction

func (this *StackTraceConnectionPool) BeginTransaction() (Transaction, error)

func (*StackTraceConnectionPool) Close

func (this *StackTraceConnectionPool) Close() error

func (*StackTraceConnectionPool) Execute

func (this *StackTraceConnectionPool) Execute(statement string, parameters ...interface{}) (uint64, error)

func (*StackTraceConnectionPool) ExecuteIdentity

func (this *StackTraceConnectionPool) ExecuteIdentity(statement string, parameters ...interface{}) (uint64, uint64, error)

func (*StackTraceConnectionPool) Ping

func (this *StackTraceConnectionPool) Ping() error

func (*StackTraceConnectionPool) Select

func (this *StackTraceConnectionPool) Select(query string, parameters ...interface{}) (SelectResult, error)

type StackTraceTransaction

type StackTraceTransaction struct {
	*StackTrace
	// contains filtered or unexported fields
}

func NewStackTraceTransaction

func NewStackTraceTransaction(inner Transaction) *StackTraceTransaction

func (*StackTraceTransaction) Commit

func (this *StackTraceTransaction) Commit() error

func (*StackTraceTransaction) Execute

func (this *StackTraceTransaction) Execute(statement string, parameters ...interface{}) (uint64, error)

func (*StackTraceTransaction) ExecuteIdentity

func (this *StackTraceTransaction) ExecuteIdentity(statement string, parameters ...interface{}) (uint64, uint64, error)

func (*StackTraceTransaction) Rollback

func (this *StackTraceTransaction) Rollback() error

func (*StackTraceTransaction) Select

func (this *StackTraceTransaction) Select(statement string, args ...interface{}) (SelectResult, error)

type Transaction

type Transaction interface {
	Commit() error
	Rollback() error
	Executor
	Selector
}

type Wireup

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

Jump to

Keyboard shortcuts

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