Documentation
¶
Overview ¶
Copyright 2022 taichi
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type Conn
- func (conn *Conn) Begin(ctx context.Context) (*Tx, error)
- func (conn *Conn) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (conn *Conn) Close() error
- func (conn *Conn) Conn() *sql.Conn
- func (conn *Conn) Exec(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (conn *Conn) Find(ctx context.Context, dest interface{}, query string, args ...interface{}) error
- func (conn *Conn) FindAll(ctx context.Context, dest interface{}, query string, args ...interface{}) error
- func (conn *Conn) Ping(ctx context.Context) error
- func (conn *Conn) Prepare(ctx context.Context, query string, examples ...interface{}) (*Stmt, error)
- func (conn *Conn) Query(ctx context.Context, query string, args ...interface{}) (*Rows, error)
- type ConnBeginTx
- type ConnClose
- type ConnExec
- type ConnFind
- type ConnFindAll
- type ConnHook
- type ConnPing
- type ConnPrepare
- type ConnQuery
- type Core
- type DB
- func (db *DB) Begin(ctx context.Context) (*Tx, error)
- func (db *DB) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (db *DB) Close() error
- func (db *DB) Conn(ctx context.Context) (*Conn, error)
- func (db *DB) DB() *sql.DB
- func (db *DB) Exec(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (db *DB) Find(ctx context.Context, dest interface{}, query string, args ...interface{}) error
- func (db *DB) FindAll(ctx context.Context, dest interface{}, query string, args ...interface{}) error
- func (db *DB) Ping(ctx context.Context) error
- func (db *DB) Prepare(ctx context.Context, query string, examples ...interface{}) (*Stmt, error)
- func (db *DB) Query(ctx context.Context, query string, args ...interface{}) (*Rows, error)
- type DBBeginTx
- type DBClose
- type DBExec
- type DBFind
- type DBFindAll
- type DBHook
- type DBPing
- type DBPrepare
- type DBQuery
- type HookHolster
- type Rows
- type RowsClose
- type RowsErr
- type RowsHook
- type RowsNext
- type RowsScan
- type Stmt
- type StmtClose
- type StmtExec
- type StmtHook
- type StmtQuery
- type Tx
- func (tx *Tx) Commit() error
- func (tx *Tx) Exec(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (tx *Tx) Find(ctx context.Context, dest interface{}, query string, args ...interface{}) error
- func (tx *Tx) FindAll(ctx context.Context, dest interface{}, query string, args ...interface{}) error
- func (tx *Tx) Prepare(ctx context.Context, query string, examples ...interface{}) (*Stmt, error)
- func (tx *Tx) Query(ctx context.Context, query string, args ...interface{}) (*Rows, error)
- func (tx *Tx) Rollback() error
- func (tx *Tx) Tx() *sql.Tx
- type TxBeginTx
- type TxClose
- type TxCommit
- type TxExec
- type TxFind
- type TxFindAll
- type TxHook
- type TxPing
- type TxPrepare
- type TxQuery
- type TxRollback
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
type ConnBeginTx ¶ added in v0.2.0
type ConnBeginTx invocation[Conn, ConnHook, func(ctx context.Context, txOptions *sql.TxOptions) (*Tx, error)]
func NewConnBeginTx ¶ added in v0.2.0
type ConnClose ¶ added in v0.2.0
func NewConnClose ¶ added in v0.2.0
type ConnExec ¶ added in v0.2.0
type ConnExec invocation[Conn, ConnHook, func(ctx context.Context, query string, args ...interface{}) (sql.Result, error)]
func NewConnExec ¶ added in v0.2.0
type ConnFind ¶ added in v0.2.0
type ConnFind invocation[Conn, ConnHook, func(ctx context.Context, dest interface{}, query string, args ...interface{}) error]
func NewConnFind ¶ added in v0.2.0
type ConnFindAll ¶ added in v0.2.0
type ConnFindAll invocation[Conn, ConnHook, func(ctx context.Context, dest interface{}, query string, args ...interface{}) error]
func NewConnFindAll ¶ added in v0.2.0
type ConnHook ¶ added in v0.2.0
type ConnHook struct {
BeginTx func(invocation *ConnBeginTx, ctx context.Context, txOptions *sql.TxOptions) (*Tx, error)
Exec func(invocation *ConnExec, ctx context.Context, query string, args ...interface{}) (sql.Result, error)
Ping func(invocation *ConnPing, ctx context.Context) error
Prepare func(invocation *ConnPrepare, ctx context.Context, query string, examples ...interface{}) (*Stmt, error)
Query func(invocation *ConnQuery, ctx context.Context, query string, args ...interface{}) (*Rows, error)
Find func(invocation *ConnFind, ctx context.Context, dest interface{}, query string, args ...interface{}) error
FindAll func(invocation *ConnFindAll, ctx context.Context, dest interface{}, query string, args ...interface{}) error
Close func(invocation *ConnClose) error
}
type ConnPing ¶ added in v0.2.0
func NewConnPing ¶ added in v0.2.0
type ConnPrepare ¶ added in v0.2.0
type ConnPrepare invocation[Conn, ConnHook, func(ctx context.Context, query string, examples ...interface{}) (*Stmt, error)]
func NewConnPrepare ¶ added in v0.2.0
type ConnQuery ¶ added in v0.2.0
type ConnQuery invocation[Conn, ConnHook, func(ctx context.Context, query string, args ...interface{}) (*Rows, error)]
func NewConnQuery ¶ added in v0.2.0
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
type DBBeginTx ¶ added in v0.2.0
type DBBeginTx invocation[DB, DBHook, func(ctx context.Context, txOptions *sql.TxOptions) (*Tx, error)]
func NewDBBeginTx ¶ added in v0.2.0
type DBClose ¶ added in v0.2.0
func NewDBClose ¶ added in v0.2.0
type DBExec ¶ added in v0.2.0
type DBExec invocation[DB, DBHook, func(ctx context.Context, query string, args ...interface{}) (sql.Result, error)]
type DBFind ¶ added in v0.2.0
type DBFind invocation[DB, DBHook, func(ctx context.Context, dest interface{}, query string, args ...interface{}) error]
type DBFindAll ¶ added in v0.2.0
type DBFindAll invocation[DB, DBHook, func(ctx context.Context, dest interface{}, query string, args ...interface{}) error]
func NewDBFindAll ¶ added in v0.2.0
type DBHook ¶ added in v0.2.0
type DBHook struct {
BeginTx func(invocation *DBBeginTx, ctx context.Context, txOptions *sql.TxOptions) (*Tx, error)
Exec func(invocation *DBExec, ctx context.Context, query string, args ...interface{}) (sql.Result, error)
Ping func(invocation *DBPing, ctx context.Context) error
Prepare func(invocation *DBPrepare, ctx context.Context, query string, examples ...interface{}) (*Stmt, error)
Query func(invocation *DBQuery, ctx context.Context, query string, args ...interface{}) (*Rows, error)
Find func(invocation *DBFind, ctx context.Context, dest interface{}, query string, args ...interface{}) error
FindAll func(invocation *DBFindAll, ctx context.Context, dest interface{}, query string, args ...interface{}) error
Close func(invocation *DBClose) error
}
type DBPrepare ¶ added in v0.2.0
type DBPrepare invocation[DB, DBHook, func(ctx context.Context, query string, examples ...interface{}) (*Stmt, error)]
func NewDBPrepare ¶ added in v0.2.0
type DBQuery ¶ added in v0.2.0
type DBQuery invocation[DB, DBHook, func(ctx context.Context, query string, args ...interface{}) (*Rows, error)]
func NewDBQuery ¶ added in v0.2.0
type HookHolster ¶ added in v0.2.0
type HookHolster struct {
Core []*kra.CoreHook
Conn []*ConnHook
DB []*DBHook
Tx []*TxHook
Stmt []*StmtHook
Rows []*RowsHook
}
func NewHookHolster ¶ added in v0.2.0
func NewHookHolster(hooks ...interface{}) *HookHolster
type RowsClose ¶ added in v0.2.0
func NewRowsClose ¶ added in v0.2.0
type RowsErr ¶ added in v0.2.0
func NewRowsErr ¶ added in v0.2.0
type RowsNext ¶ added in v0.2.0
func NewRowsNext ¶ added in v0.2.0
type RowsScan ¶ added in v0.2.0
func NewRowsScan ¶ added in v0.2.0
type Stmt ¶
type Stmt struct {
// contains filtered or unexported fields
}
type StmtClose ¶ added in v0.2.0
func NewStmtClose ¶ added in v0.2.0
type StmtExec ¶ added in v0.2.0
type StmtExec invocation[Stmt, StmtHook, func(ctx context.Context, args ...interface{}) (sql.Result, error)]
func NewStmtExec ¶ added in v0.2.0
type StmtQuery ¶ added in v0.2.0
type StmtQuery invocation[Stmt, StmtHook, func(ctx context.Context, args ...interface{}) (*Rows, error)]
func NewStmtQuery ¶ added in v0.2.0
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
type TxBeginTx ¶ added in v0.2.0
type TxBeginTx invocation[Tx, TxHook, func(ctx context.Context, txOptions *sql.TxOptions) (*Tx, error)]
func NewTxBeginTx ¶ added in v0.2.0
type TxClose ¶ added in v0.2.0
func NewTxClose ¶ added in v0.2.0
type TxCommit ¶ added in v0.2.0
func NewTxCommit ¶ added in v0.2.0
type TxExec ¶ added in v0.2.0
type TxExec invocation[Tx, TxHook, func(ctx context.Context, query string, args ...interface{}) (sql.Result, error)]
type TxFind ¶ added in v0.2.0
type TxFind invocation[Tx, TxHook, func(ctx context.Context, dest interface{}, query string, args ...interface{}) error]
type TxFindAll ¶ added in v0.2.0
type TxFindAll invocation[Tx, TxHook, func(ctx context.Context, dest interface{}, query string, args ...interface{}) error]
func NewTxFindAll ¶ added in v0.2.0
type TxHook ¶ added in v0.2.0
type TxHook struct {
BeginTx func(invocation *TxBeginTx, ctx context.Context, txOptions *sql.TxOptions) (*Tx, error)
Exec func(invocation *TxExec, ctx context.Context, query string, args ...interface{}) (sql.Result, error)
Ping func(invocation *TxPing, ctx context.Context) error
Prepare func(invocation *TxPrepare, ctx context.Context, query string, examples ...interface{}) (*Stmt, error)
Query func(invocation *TxQuery, ctx context.Context, query string, args ...interface{}) (*Rows, error)
Find func(invocation *TxFind, ctx context.Context, dest interface{}, query string, args ...interface{}) error
FindAll func(invocation *TxFindAll, ctx context.Context, dest interface{}, query string, args ...interface{}) error
Commit func(invocation *TxCommit) error
Rollback func(invocation *TxRollback) error
Close func(invocation *TxClose) error
}
type TxPrepare ¶ added in v0.2.0
type TxPrepare invocation[Tx, TxHook, func(ctx context.Context, query string, examples ...interface{}) (*Stmt, error)]
func NewTxPrepare ¶ added in v0.2.0
type TxQuery ¶ added in v0.2.0
type TxQuery invocation[Tx, TxHook, func(ctx context.Context, query string, args ...interface{}) (*Rows, error)]
func NewTxQuery ¶ added in v0.2.0
type TxRollback ¶ added in v0.2.0
func NewTxRollback ¶ added in v0.2.0
func NewTxRollback(recv *Tx, original func() error) *TxRollback
func (*TxRollback) Proceed ¶ added in v0.2.0
func (invocation *TxRollback) Proceed() error
Click to show internal directories.
Click to hide internal directories.