feat: set sqlite pragma by env variable (#3136)

* set sqlite pragma by env variable

* configurable

* [autofix.ci] apply automated fixes

* fix circular dep

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Nicolò Boschi <boschi1997@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
ming 2024-08-01 08:48:00 -04:00 • committed by GitHub
commit 1dd840c526
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 42 additions and 14 deletions

View file

@ -402,3 +402,13 @@ def test_migrate_transactions_no_duckdb(client: TestClient):
migrate_transactions_from_monitor_service_to_database(session)
new_trans = get_transactions_by_flow_id(session, UUID(flow_id))
assert 0 == len(new_trans)
def test_sqlite_pragmas():
db_service = get_db_service()
with db_service as session:
from sqlalchemy import text
assert "wal" == session.execute(text("PRAGMA journal_mode;")).fetchone()[0]
assert 1 == session.execute(text("PRAGMA synchronous;")).fetchone()[0]