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
{{ message }}
This repository has been archived by the owner on Jun 6, 2019. It is now read-only.
postgresql数据库的josnb字段是允许为空
映射string后,插入数据时,字段不赋值,插入式给的是'' 不是nil 导致插入不进去,报错
模型
type Test struct { Id int
xorm:"pk autoincr INT"Name string
xorm:"JSONB"}
访问数据库代码
test := model.Test{Id: 2} id, err := db.Insert(&test)
出错信息
[xorm] [info] 2017/07/27 14:28:04.194950 [SQL] INSERT INTO "test" ("id","name") VALUES ($1, $2) RETURNING "id" []interface {}{2, ""} pq: json类型使用了无效的输入语法
name是个jsonb 允许为空,会出错,插""是不行的,求更新!
The text was updated successfully, but these errors were encountered: