-
-
Notifications
You must be signed in to change notification settings - Fork 407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to mock results with datetime columns #1
Comments
Hacked together an example in my fork of how giving native types to Scan will let the parsing handle more types (for the ones in this list, at least). I couldn't work out a good API for multiple rows though, or I'd clean it up and submit a PR. Current example use:
Thoughts? |
Hi, yes there could be more ways to build sql driver rows. one for example, could be used to read struct data, like sqlstruct uses tags. another from an array of interface{}. I would really appreciate any contributions regarding it. So if you come up with a nice way of doing it, I would be happy to include it in the library. database sql rows interface gives us a flexible way to create them differently. I will take a look at your fork, this week, busy days recently. |
* hebo/typed_rows: Allow for multiple rows by manually creating each row Create a single row from an interface list - #1
Hey,
How can I mock columns that are stored as datetimes? It seems that
RowsFromCSVString
setsdriver.Value
s that are always[]byte
, andScan
is unable to parsetime.time
objects from them:I'd guess this would work if either
RowsFromCSVString
was able to directly createtime.time
objects when it encounters them or there was another way to assemblesqlmock.rows
objects.Example:
The text was updated successfully, but these errors were encountered: