asyncpg 接口错误服务器需要此查询的 2 个参数,已传递 1 个

问题描述

尝试从 aiosqlite 更改为 asyncpg,并一直运行到

InterfaceError: the server expects 2 arguments for this query,1 was passed
HINT:  Check the query against the passed list of arguments.

以下是一些有问题的线路

data = await bot.db.fetch('''SELECT study_time FROM guildData WHERE guild_id = ($1) AND user_id = ($2)''',(ctx.guild.id,ctx.author.id))

await bot.db.execute('''UPDATE guildData SET study_time = study_time + ($1) WHERE guild_id = ($2) AND user_id = ($3)''',(total_mins,ctx.guild.id,ctx.author.id))

async with bot.db.execute(f'''SELECT user_id,study_time FROM guildData WHERE guild_id = ($1) ORDER BY study_time DESC LIMIT ($2) OFFSET ($3)''',entries_per_page,entries_per_page*(current-1),)) as cursor:

查了参考,不知道应该改成什么...?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...