adding new functionality for mocks
- working through insert logic - ideally return struct with 'good' fields - also return list of args to prevent relooping
This commit is contained in:
17
driver.go
Normal file
17
driver.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package lazy
|
||||
|
||||
//driver.Result does not play well with creation, overriding it here so we can return the results without
|
||||
//requiring sqlmock
|
||||
type sqlResult struct {
|
||||
insertID int64
|
||||
rowsAffected int64
|
||||
err error
|
||||
}
|
||||
|
||||
func (r *sqlResult) LastInsertId() (int64, error) {
|
||||
return r.insertID, r.err
|
||||
}
|
||||
|
||||
func (r *sqlResult) RowsAffected() (int64, error) {
|
||||
return r.rowsAffected, r.err
|
||||
}
|
Reference in New Issue
Block a user