行星尺度:无法将数字列入GO结构字段

发布于 2025-01-30 03:11:36 字数 347 浏览 2 评论 0原文

当我尝试使用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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深海夜未眠 2025-02-06 03:11:36

事实证明,由于原始的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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文