Gorm: Scan error on column index 4: unsupported Scan

Created on 11 Apr 2016  ·  5Comments  ·  Source: go-gorm/gorm

code

code1

2016/04/11 17:40:21 http: panic serving 127.0.0.1:56089: sql: Scan error on column index 4: unsupported Scan, storing driver.Value type []uint8 into type *time.Time

why? bug?

Most helpful comment

I guess you need to add proper parameter to your connection string. (?parseTime=true)
https://github.com/Go-SQL-Driver/MySQL/issues/9

All 5 comments

I guess you need to add proper parameter to your connection string. (?parseTime=true)
https://github.com/Go-SQL-Driver/MySQL/issues/9

Am closing this, if its still a bug then please re-open

I solved the problem with add ?parseTime=true, thank you !

What about postgres?

This great article nicely explains the problem and offers solutions for MySQL and Postgres: https://medium.com/aubergine-solutions/how-i-handled-null-possible-values-from-database-rows-in-golang-521fb0ee267

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leebrooks0 picture leebrooks0  ·  3Comments

rfyiamcool picture rfyiamcool  ·  3Comments

alanyuen picture alanyuen  ·  3Comments

izouxv picture izouxv  ·  3Comments

bramp picture bramp  ·  3Comments