Conversation
| type BaseRunner interface { | ||
| Execer | ||
| ExecerContext | ||
| Queryer |
There was a problem hiding this comment.
The role of the BaseRunner was to determine minimal functionality (be able to Query and Exec) of some DB connection in compile-time. Now Query* methods are gone and the only thing we require from DB connection is existence of Exec* methods. That renders BaseRunner less useful, so it seems like it should be removed completely and interface{} should be used instead of it.
But that means no compile-time checks, only runtime checks in wrapRunner function. Which means "rebuilding lots of stuff". I don't think we should go this way.
| // RowsScanner is the interface that wraps the sql row methods. | ||
| // | ||
| // functions behave like database/sql.Rows methods | ||
| type RowsScanner interface { |
There was a problem hiding this comment.
RowsScanner should be rather renamed to RowCursor, because:
- It does more than just scanning.
- Having
RowsScannerandRowScanneris confusing for a reader.
|
|
||
| // otherRunner wraps BaseRunner to implement Runner. | ||
| type otherRunner struct { | ||
| BaseRunner |
There was a problem hiding this comment.
Another example of that BaseRunner is not needed anymore with this change. Why should we keep it? For 2 Exec* methods? Doesn't make too much sense IMHO.
Created
RowsScannerinterface to enable mockingsql.Rowsstruct. Potentially solves #24