You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...
sql: Scan error on column index 5, name \"created_at\": unsupported Scan, storing driver.Value type string into type*time.Time
...
after looking at GORM issues, this should be solved if we're using the parseTime=True on the dsn. Ref: this issue and this issue.
Apparently, GORM didn't parse the dsn correctly. I'm not sure how to fix this issue. I would gladly make a fix for this issue if you can lead me on how to fix this issue properly. Thanks!
The text was updated successfully, but these errors were encountered:
Sqlmock is a mock database, it does not know that you use gorm or any other thing underneath. If you use non standard arguments to sql value converter. You need to register it for mock database via options
Sqlmock is a mock database, it does not know that you use gorm or any other thing underneath. If you use non standard arguments to sql value converter. You need to register it for mock database via options
Is there a sqlmock options configuration with gorm example showing how to achieve the time conversion?
Hi, I have an issue with mocking for GORM that uses timestamp on the model. For example, I have this model
I know that we can use
sqlmock.NewWithDSN
for this case and this is how I initiate the database mock connectionthen this error happens
after looking at GORM issues, this should be solved if we're using the
parseTime=True
on the dsn. Ref: this issue and this issue.Apparently, GORM didn't parse the dsn correctly. I'm not sure how to fix this issue. I would gladly make a fix for this issue if you can lead me on how to fix this issue properly. Thanks!
The text was updated successfully, but these errors were encountered: