PostgreSQL JSON字段无法插入数据库 #662
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#662
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
数据库: PostgreSQL
xorm: 最新版
比如我有一个user表在数据库中定义为:
对于字段
extras
可以为空使用xorm命令行工具生成数据bean为:
当我用xorm 插入一条记录:
无法完成,总是报错:
如果我把数据库表中
extras
字段的类型改成text
, 才能插入成功。请问这是因为
xorm
不知道pg
的JSON类型
吗?只能用
text
类型替代么?万分感谢,希望可以解答一下?
结构体中的Extras改成interface{}或者其它的数据结构,JSON不能应用于string,这个可能是生成工具的Bug