行星尺度:无法将数字列入GO结构字段
当我尝试使用cli
连接到我的Planetscale
数据库时,我将获得无法将数字放入GO struct field
错误中。
CLI命令连接到DB:
pscale connect <db_name> <branch_name> --port 3310
错误响应:
Error: json: cannot unmarshal number into Go struct field
DatabaseBranch.dev of type bool
When I try to connect to my PlanetScale
database using the CLI
, I get a cannot unmarshal number into Go struct field
error.
CLI command to connect to DB:
pscale connect <db_name> <branch_name> --port 3310
Error response:
Error: json: cannot unmarshal number into Go struct field
DatabaseBranch.dev of type bool
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,由于原始的SQL插入物将1输入布尔字段而不是真实,因此引起了这个问题。运行SQL Update命令将1S替换为TRUE解决了问题。
Turns out this issue was caused because of a raw SQL insert that inputted 1 into a boolean field instead of true. Running an SQL update command to replace the 1s with true solved the issue.