英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论