类型错误:SQLite3 只能绑定数字、字符串、大整数、缓冲区和空值。

huangapple go评论61阅读模式
英文:

TypeError: SQLite3 can only bind numbers, strings, bigints, buffers, and null

问题

有一个 SQL 查询方法被调用,但我不确定传递的参数在这里表示什么。

selectMethod({ a: b });

在 SQLite 中运行时出现错误:

TypeError: SQLite3 只能绑定数字、字符串、大整数、缓冲区和空值

在 MySQL 上运行正常。

英文:

there is an sql select method being called but im not sure what the parameters passed indicate here

selectMethod({ a: b });

this is failing to run in sqlite with error:

> TypeError: SQLite3 can only bind numbers, strings, bigints, buffers, and null

.. worked fine on mysql

答案1

得分: 1

对我来说,似乎你内部使用的函数尝试绑定一个不是这些支持的类型(数字、字符串、大整数、缓冲区和null)之一的值,从而导致错误。
请确保传递的值(在这种情况下是{a: b})符合SQLite3文档中支持的类型。你可能需要转换或修改该值,以匹配SQLite3所期望的类型。

如果有效,请告诉我。

英文:

for me it seems that the function you are using internally tries to bind a value that is not one of these supported types (numbers, strings, bigints, buffers, and null), causing the error.
Make sure that the value being passed ({a: b} in this case) is of a supported type according to the SQLite3 documentation. You may need to convert or modify the value to match the expected types for SQLite3.

Let me know if it works

huangapple
  • 本文由 发表于 2023年5月7日 18:04:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/76193235.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定