Golang database/sql/driver.Queryer type example
package database/sql/driver
Queryer is an optional interface that may be implemented by a Conn.
If a Conn does not implement Queryer, the sql package's DB.Query will first prepare a query, execute the statement, and then close the statement.
Query may return ErrSkip.
Golang database/sql/driver.Queryer type usage example
type wrapResults_ struct {
Query string
Values []driver.Value
}
var results = &wrapResults_{}
var dbwrap = New("test", f)
dbwrap.HandleQuery = func(r driver.Queryer, qs string, v []driver.Value) (driver.Rows, error) {
results.Query = qs
results.Values = v
return dbwrap.Driver.(driver.Queryer).Query(qs, v)
}
References :
https://github.com/metakeule/dbwrap/blob/master/dbwrap_test.go
Advertisement
Something interesting
Tutorials
+13.6k Android Studio : Password input and reveal password example
+7.8k Golang : Example of how to detect which type of script a word belongs to
+27.6k PHP : Convert(cast) string to bigInt
+4.7k Golang : How to pass data between controllers with JSON Web Token
+19.2k Golang : Check if directory exist and create if does not exist
+29.2k Golang : missing Git command
+5.7k List of Golang XML tutorials
+10.8k Golang : Command line file upload program to server example
+4.6k Javascript : Detect when console is activated and do something about it
+6.7k Golang : Skip or discard items of non-interest when iterating example