From 6c38407742f1cfec2e2d927352a5518ac2786d47 Mon Sep 17 00:00:00 2001 From: Roger Binns Date: Tue, 16 Apr 2024 08:00:14 -0700 Subject: [PATCH] sqlite3 warns on :number for tuple bindings Any ? : etc followed by any text including a number gives a deprecation warning and will error requiring a dict in future releases --- apsw/speedtest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apsw/speedtest.py b/apsw/speedtest.py index 96c03e1b..81e31893 100755 --- a/apsw/speedtest.py +++ b/apsw/speedtest.py @@ -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", ) @@ -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", )