Skip to content
This repository has been archived by the owner on Sep 7, 2021. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.

数据库的值是null的时候 只获取某列会报错 #889

Closed
w3eee opened this issue Apr 11, 2018 · 0 comments · Fixed by #890
Closed

数据库的值是null的时候 只获取某列会报错 #889

w3eee opened this issue Apr 11, 2018 · 0 comments · Fixed by #890
Labels
Milestone

Comments

@w3eee
Copy link

w3eee commented Apr 11, 2018

写法
var name string has, err := engine.Where("id = ?", id).Cols("name").Get(&name) 数据库的name值是NULL
报错信息如下:
sql: Scan error on column index 0: unsupported Scan, storing driver.Value type <nil> into type *string

@lunny lunny added the kind/bug label Apr 11, 2018
@lunny lunny added this to the 0.7 milestone Apr 11, 2018
@lunny lunny modified the milestones: 0.7, 0.8 May 4, 2018
@lunny lunny modified the milestones: 0.8, 0.8.1 Jan 17, 2019
@lunny lunny modified the milestones: 0.8.1, 0.8 Jul 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants