From 2e1deedfe9c82ee2570e57edc7993bf1dba9df1e Mon Sep 17 00:00:00 2001 From: Roger Binns Date: Sun, 16 Jun 2024 06:38:18 -0700 Subject: [PATCH] Tests for bindings functions --- apsw/tests.py | 5 +++++ tools/fi.py | 2 ++ 2 files changed, 7 insertions(+) diff --git a/apsw/tests.py b/apsw/tests.py index fe9dbe1c..5bda02b1 100644 --- a/apsw/tests.py +++ b/apsw/tests.py @@ -10392,6 +10392,11 @@ def testExtQueryInfo(self) -> None: self.assertEqual("select 3, 'three'", apsw.ext.query_info(self.db, "select ?, ?", (3, "three"), expanded_sql=True).expanded_sql) + # bindings count/names + qd = apsw.ext.query_info(self.db, "select ?2, :three, ?5, $six") + self.assertEqual(qd.bindings_count, 6) + self.assertEqual(qd.bindings_names, (None, "2", "three", None, "5", "six")) + # explain / explain query_plan # from https://sqlite.org/lang_with.html query = """ diff --git a/tools/fi.py b/tools/fi.py index 119d2808..89d0536e 100755 --- a/tools/fi.py +++ b/tools/fi.py @@ -154,6 +154,8 @@ def trace(*args): cur.execute("select 3").fetchall() cur.get + apsw.ext.query_info(con, "select ?2, $three", actions=True, expanded_sql=True) + con.pragma("user_version") con.pragma("user_version", 7)