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:
2025-09-29 15:47:51 -04:00
parent 3b40f8061f
commit ff62b371c9
2 changed files with 90 additions and 9 deletions

17
driver.go Normal file
View 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
}