feat: migrate displayed historical data to postgres
This commit is contained in:
@@ -5,7 +5,7 @@ from __future__ import annotations
|
||||
import sqlite3
|
||||
from pathlib import Path
|
||||
|
||||
from .config import get_storage_path
|
||||
from .config import get_database_url, get_storage_path
|
||||
from .player_event_storage import initialize_player_event_storage
|
||||
|
||||
|
||||
@@ -249,6 +249,10 @@ def _build_common_where(
|
||||
|
||||
|
||||
def _connect(db_path: Path) -> sqlite3.Connection:
|
||||
if get_database_url():
|
||||
from .postgres_display_storage import connect_postgres_compat
|
||||
|
||||
return connect_postgres_compat()
|
||||
connection = sqlite3.connect(db_path or get_storage_path())
|
||||
connection.row_factory = sqlite3.Row
|
||||
return connection
|
||||
|
||||
Reference in New Issue
Block a user