Open
Description
The following executes successfully in sqlite3:
import sqlite3
dbconn = sqlite3.connect("db.sqlite")
dbconn.execute("CREATE TABLE test (first int, second int, third int)")
values = [1,2,3]
dbconn.execute("INSERT INTO test VALUES (?,?,?)", values)
dbconn.commit()
result = dbconn.execute("SELECT * FROM test").fetchall()
print (result)
Prints out
[(1, 2, 3)]
However creating the analogous code in asqlite:
import asqlite
import asyncio
async def foo():
dbconn = await asqlite.connect("db.sqlite")
await dbconn.execute("CREATE TABLE test (first int, second int, third int)")
values = [1,2,3]
await dbconn.execute("INSERT INTO test VALUES (?,?,?)", values)
await dbconn.commit()
cur = await dbconn.execute("SELECT * FROM test")
result = await cur.fetchall()
print (result)
asyncio.run(foo())
Throws:
sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 3, and there are 1 supplied.
Metadata
Metadata
Assignees
Labels
No labels