Documentation ¶
Index ¶
- Variables
- type ColumnType
- type Database
- type DefaultRows
- type DefaultTransaction
- func (tx *DefaultTransaction) Commit() error
- func (tx *DefaultTransaction) Execute(ctx context.Context, query []byte, args []any) (result Result, err error)
- func (tx *DefaultTransaction) Query(ctx context.Context, query []byte, args []any) (rows Rows, err error)
- func (tx *DefaultTransaction) Rollback() error
- type Isolation
- type Options
- type Preparer
- type Result
- type Rows
- type Statement
- type Statements
- type StatementsConfig
- type Transaction
- type TransactionOption
- type TransactionOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrStatementClosed = errors.Warning("sql: statement was closed")
)
Functions ¶
This section is empty.
Types ¶
type ColumnType ¶
type Database ¶
type Database interface { Name() string Construct(options Options) (err error) Begin(ctx context.Context, options TransactionOptions) (tx Transaction, err error) Query(ctx context.Context, query []byte, args []any) (rows Rows, err error) Execute(ctx context.Context, query []byte, args []any) (result Result, err error) Close(ctx context.Context) (err error) }
func MasterSlave ¶
func MasterSlave() Database
func Standalone ¶
func Standalone() Database
type DefaultRows ¶
type DefaultRows struct {
// contains filtered or unexported fields
}
func (*DefaultRows) Close ¶
func (rows *DefaultRows) Close() error
func (*DefaultRows) ColumnTypes ¶
func (rows *DefaultRows) ColumnTypes() ([]ColumnType, error)
func (*DefaultRows) Columns ¶
func (rows *DefaultRows) Columns() ([]string, error)
func (*DefaultRows) Next ¶
func (rows *DefaultRows) Next() bool
func (*DefaultRows) Scan ¶
func (rows *DefaultRows) Scan(dst ...any) error
type DefaultTransaction ¶
type DefaultTransaction struct {
// contains filtered or unexported fields
}
func (*DefaultTransaction) Commit ¶
func (tx *DefaultTransaction) Commit() error
func (*DefaultTransaction) Rollback ¶
func (tx *DefaultTransaction) Rollback() error
type Statement ¶
type Statement struct {
// contains filtered or unexported fields
}
func (*Statement) ExecContext ¶
func (*Statement) QueryContext ¶
type Statements ¶
type Statements struct {
// contains filtered or unexported fields
}
func NewStatements ¶
func (*Statements) Close ¶
func (stmts *Statements) Close()
type StatementsConfig ¶
type Transaction ¶
type Transaction interface { Commit() error Rollback() error Query(ctx context.Context, query []byte, args []any) (rows Rows, err error) Execute(ctx context.Context, query []byte, args []any) (result Result, err error) }
func NewTransaction ¶
func NewTransaction(tx *sql.Tx) Transaction
func NewTransactionWithStatements ¶
func NewTransactionWithStatements(tx *sql.Tx, statements *Statements) Transaction
type TransactionOption ¶
type TransactionOption func(options *TransactionOptions)
type TransactionOptions ¶
Click to show internal directories.
Click to hide internal directories.