Run the backend suite on Dev Postgres instead of isolated SQLite.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
709370da93
commit
36b9a2e424
34 files changed
+234
-79
No files matched your search
@@ -1,7 +1,8 @@
|
||||
"""Translate SQLite-oriented SQL so the same stores can run against PostgreSQL.
|
||||
|
||||
Local Windows development and tests keep SQLite. Docker/Server set
|
||||
KANSHO_DB_BACKEND=postgres. Identity, keys and journal bodies are not logged here.
|
||||
Windows without Docker still uses SQLite for the running app. Docker/Server and
|
||||
the test suite use PostgreSQL (`KANSHO_DB_BACKEND=postgres`). Identity, keys and
|
||||
journal bodies are not logged here.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
@@ -29,7 +30,8 @@ def use_postgres() -> bool:
|
||||
"""Decide the engine at connect time, not at import time.
|
||||
|
||||
Explicit KANSHO_DB_BACKEND wins. KANSHO_DB_PATH without an explicit postgres
|
||||
backend keeps tests on isolated SQLite even inside a Compose container.
|
||||
backend keeps the Windows local app on SQLite. Tests set postgres and DB_NAME
|
||||
kansho_test on the Dev instance, never kansho_dev.
|
||||
"""
|
||||
raw = (os.environ.get("KANSHO_DB_BACKEND") or "").strip().lower()
|
||||
if raw in {"sqlite", "sqlite3"}:
|
||||
|
||||
Reference in new issue
Block a user