acme-dns/vendor/github.com/erikstmartin/go-testdb/stmt.go
Joona Hoikkala fd9ce4606d
Get rid of Iris and use julienschmidt/httprouter instead (#20)
* Replace iris with httprouter

* Linter fixes

* Finalize iris removal

* Vendor dependencies for reproducable builds

* Api tests are back
2017-11-14 23:54:29 +02:00

28 lines
541 B
Go

package testdb
import (
"database/sql/driver"
)
type stmt struct {
queryFunc func(args []driver.Value) (driver.Rows, error)
execFunc func(args []driver.Value) (driver.Result, error)
}
func (s *stmt) Close() error {
return nil
}
func (s *stmt) NumInput() int {
// This prevents the sql package from validating the number of inputs
return -1
}
func (s *stmt) Exec(args []driver.Value) (driver.Result, error) {
return s.execFunc(args)
}
func (s *stmt) Query(args []driver.Value) (driver.Rows, error) {
return s.queryFunc(args)
}