mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-24 18:04: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
|
|
@ -4,9 +4,9 @@ import pytest
|
|||
|
||||
def test_recursive_triggers():
|
||||
db = Database(memory=True)
|
||||
assert db.conn.execute("PRAGMA recursive_triggers").fetchone()[0]
|
||||
assert db.execute("PRAGMA recursive_triggers").fetchone()[0]
|
||||
|
||||
|
||||
def test_recursive_triggers_off():
|
||||
db = Database(memory=True, recursive_triggers=False)
|
||||
assert not db.conn.execute("PRAGMA recursive_triggers").fetchone()[0]
|
||||
assert not db.execute("PRAGMA recursive_triggers").fetchone()[0]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue