Skip to content

Commit

Permalink
Tests for bindings functions
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerbinns committed Jun 16, 2024
1 parent 34ecf37 commit 2e1deed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apsw/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = """
Expand Down
2 changes: 2 additions & 0 deletions tools/fi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 2e1deed

Please sign in to comment.