Skip to content

Commit

Permalink
sqlite3 warns on :number for tuple bindings
Browse files Browse the repository at this point in the history
Any ? : etc followed by any text including a number gives
a deprecation warning and will error requiring a dict
in future releases
  • Loading branch information
rogerbinns committed Apr 16, 2024
1 parent 1852aec commit 6c38407
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apsw/speedtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def getlines(scale, bindings=False):
for i in range(1, scale * 10000 + 1):
r = random.randint(0, 500000)
if bindings:
yield ("INSERT INTO t1 VALUES(:1, :2, number_name(:2))", (i, r))
yield ("INSERT INTO t1 VALUES(?, ?, number_name(?))", (i, r, r))
else:
yield ("INSERT INTO t1 VALUES(%d, %d, '%s')" % (i, r, number_name(r)), )
yield ("COMMIT", )
Expand All @@ -152,7 +152,7 @@ def getlines(scale, bindings=False):
x = number_name(r)
t1c_list.append(x)
if bindings:
yield ("INSERT INTO t2 VALUES(:1, :2, number_name(:2))", (i, r))
yield ("INSERT INTO t2 VALUES(?, ?, number_name(?))", (i, r, r))
else:
yield ("INSERT INTO t2 VALUES(%d, %d, '%s')" % (i, r, x), )
yield ("COMMIT", )
Expand Down

0 comments on commit 6c38407

Please sign in to comment.