Documentation
¶
Index ¶
- type Database
- type Error
- type RealDatabase
- func (db RealDatabase) BeginTx(ctx context.Context) (Transaction, error)
- func (db RealDatabase) Close()
- func (db RealDatabase) Exec(query string, args ...interface{}) (sql.Result, error)
- func (db RealDatabase) InsertOne(ctx context.Context, query string, args ...interface{}) (int64, error)
- func (db RealDatabase) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)
- func (db RealDatabase) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (db RealDatabase) QueryRow(query string, args ...interface{}) *sql.Row
- func (db RealDatabase) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
- type RealTransaction
- func (tx RealTransaction) Commit() error
- func (tx RealTransaction) InsertOne(ctx context.Context, query string, args ...interface{}) (int64, error)
- func (tx RealTransaction) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)
- func (tx RealTransaction) Rollback(format string, v ...interface{}) string
- type Transaction
- type UnexpectedRowCountError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database interface { BeginTx(ctx context.Context) (Transaction, error) Close() Exec(query string, args ...interface{}) (sql.Result, error) InsertOne(ctx context.Context, query string, args ...interface{}) (int64, error) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) QueryRow(query string, args ...interface{}) *sql.Row QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row }
func CreateConnection ¶
type RealDatabase ¶
func (RealDatabase) BeginTx ¶
func (db RealDatabase) BeginTx(ctx context.Context) (Transaction, error)
func (RealDatabase) Close ¶
func (db RealDatabase) Close()
func (RealDatabase) Exec ¶
func (db RealDatabase) Exec(query string, args ...interface{}) (sql.Result, error)
func (RealDatabase) PrepareContext ¶
func (RealDatabase) QueryContext ¶
func (RealDatabase) QueryRow ¶
func (db RealDatabase) QueryRow(query string, args ...interface{}) *sql.Row
func (RealDatabase) QueryRowContext ¶
type RealTransaction ¶
type RealTransaction struct {
// contains filtered or unexported fields
}
func (RealTransaction) Commit ¶
func (tx RealTransaction) Commit() error
func (RealTransaction) PrepareContext ¶
func (RealTransaction) Rollback ¶
func (tx RealTransaction) Rollback(format string, v ...interface{}) string
type Transaction ¶
type UnexpectedRowCountError ¶
func (UnexpectedRowCountError) Error ¶
func (e UnexpectedRowCountError) Error() string
Click to show internal directories.
Click to hide internal directories.