-
v0.7.0 – PostgreSQL-Backend
Stablereleased this
2026-04-17 21:16:29 +02:00 | 86 commits to main since this releaseWas ist neu
PostgreSQL-Backend (
modules/pg_adapter.py)Transparenter Drop-in-Ersatz für
sqlite3— alle 17 datenbanknutzenden Module importieren jetztfrom modules import pg_adapter as sqlite3.- Automatische SQL-Übersetzung:
?→%s,AUTOINCREMENT→GENERATED ALWAYS AS IDENTITY,datetime(now, ...)→NOW() + INTERVAL,PRAGMA table_info→information_schema.columns,sqlite_master→information_schema.tables,INSERT OR REPLACE/IGNORE→ON CONFLICT,COLLATE NOCASEentfernt - Psycopg2-Thread-Connection-Pool (2–20),
CompatRowfür Dict+Index-Zugriff - Vollständiger SQLite-Fallback wenn
DATABASE_URLnicht gesetzt — keine Änderung für bestehende SQLite-Setups
Config-in-Datenbank (
modules/config_store.py)bot_config-Tabelle als Overlay für ConfigParser. DB-Werte überschreibenconfig.ini. Beim ersten Start werden alleconfig.ini-Werte als Defaults importiert.Docker mit PostgreSQL (
docker-compose.yml)PostgreSQL 16 Alpine als separater Service mit Healthcheck. Bot startet erst nach
pg_isready. Passwort über${DB_PASSWORD:-meshcore_secret}konfigurierbar.Dashboard-API (
GET /api/dashboard)Neuer öffentlicher Endpoint: bot_name, version, uptime, Kontakte, Nachrichten, Top-5-Commands, zuletzt gehörte Kontakte.
Migrationsskript (
scripts/migrate_sqlite_to_postgres.py)Idempotentes SQLite→PostgreSQL-Migrationsskript für beide Datenbanken, mit
--dry-run-Flag.Behoben
PgCursor.execute:lastrowid-Fetch konsumierte SELECT-Rows → Login schlug stets fehl- Web-Viewer-Subprocess: fehlende
cwd+PYTHONPATHverhindertenmodules-Import sqlite_master: fehlende Übersetzung zuinformation_schema.tables/api/dashboard: falscher Spaltennamecommandstattcommand_name
Upgrade-Hinweis
SQLite-Nutzer: Keine Änderung erforderlich — der Bot fällt automatisch auf SQLite zurück wenn
DATABASE_URLnicht gesetzt ist.PostgreSQL-Migration:
DATABASE_URL=postgresql://user:pass@host:5432/meshcore_bot \ python3 scripts/migrate_sqlite_to_postgres.py \ --sqlite-main data/databases/meshcore_bot.db \ --sqlite-telemetry data/databases/telemetry_data.dbVollständiges Changelog: CHANGELOG.md
Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads
- Automatische SQL-Übersetzung: