db.iterdump() method uses sqlite-dump if available

This commit is contained in:
Simon Willison 2023-06-25 15:29:00 -07:00
commit 31bde41baf
8 changed files with 55 additions and 8 deletions

View file

@ -135,7 +135,8 @@ def test_analyze_column(db_to_analyze, column, extra_kwargs, expected):
def db_to_analyze_path(db_to_analyze, tmpdir):
path = str(tmpdir / "test.db")
db = sqlite3.connect(path)
db.executescript("\n".join(db_to_analyze.conn.iterdump()))
sql = "\n".join(db_to_analyze.iterdump())
db.executescript(sql)
return path