MCPcopy
hub / github.com/go-gorp/gorp / SqlExecutor

Interface SqlExecutor

gorp.go:92–109  ·  view source on GitHub ↗

SqlExecutor exposes gorp operations that can be run from Pre/Post hooks. This hides whether the current operation that triggered the hook is in a transaction. See the DbMap function docs for each of the functions below for more information.

Source from the content-addressed store, hash-verified

90// See the DbMap function docs for each of the functions below for more
91// information.
92type SqlExecutor interface {
93 WithContext(ctx context.Context) SqlExecutor
94 Get(i interface{}, keys ...interface{}) (interface{}, error)
95 Insert(list ...interface{}) error
96 Update(list ...interface{}) (int64, error)
97 Delete(list ...interface{}) (int64, error)
98 Exec(query string, args ...interface{}) (sql.Result, error)
99 Select(i interface{}, query string, args ...interface{}) ([]interface{}, error)
100 SelectInt(query string, args ...interface{}) (int64, error)
101 SelectNullInt(query string, args ...interface{}) (sql.NullInt64, error)
102 SelectFloat(query string, args ...interface{}) (float64, error)
103 SelectNullFloat(query string, args ...interface{}) (sql.NullFloat64, error)
104 SelectStr(query string, args ...interface{}) (string, error)
105 SelectNullStr(query string, args ...interface{}) (sql.NullString, error)
106 SelectOne(holder interface{}, query string, args ...interface{}) error
107 Query(query string, args ...interface{}) (*sql.Rows, error)
108 QueryRow(query string, args ...interface{}) *sql.Row
109}
110
111// DynamicTable allows the users of gorp to dynamically
112// use different database table names during runtime

Callers 52

TestWithCanceledContextFunction · 0.65
columnToFieldIndexFunction · 0.65
readStructColumnsMethod · 0.65
dynamicTablesTestDeleteFunction · 0.65
TestCustomDateTypeFunction · 0.65
TestPersistentUserFunction · 0.65
TestOptimisticLockingFunction · 0.65
TestScannerValuerFunction · 0.65

Implementers 2

DbMapdb.go
Transactiontransaction.go

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…