mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-27 19:34:32 +02:00
Tracer mechanism for showing underlying SQL queries
* Pass a tracer= function to Database constructor * New db.tracer() contextmanager * Neater SQL indentation, because tracer means it could be visible now * New db.execute() and db.executescript() methods Closes #150
This commit is contained in:
parent
3e87500e15
commit
cf2cb244fa
12 changed files with 231 additions and 79 deletions
|
|
@ -680,7 +680,7 @@ def test_create_index_if_not_exists(fresh_db):
|
|||
)
|
||||
def test_insert_dictionaries_and_lists_as_json(fresh_db, data_structure):
|
||||
fresh_db["test"].insert({"id": 1, "data": data_structure}, pk="id")
|
||||
row = fresh_db.conn.execute("select id, data from test").fetchone()
|
||||
row = fresh_db.execute("select id, data from test").fetchone()
|
||||
assert row[0] == 1
|
||||
assert data_structure == json.loads(row[1])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue