mega chore: update sqlalchemy (#2611)

* update sqlalchemy to 1.4
* async postgres

---------

Co-authored-by: Pavol Rusnak <pavol@rusnak.io>
This commit is contained in:
dni ⚡ 2024-09-24 10:56:03 +02:00 committed by GitHub
parent c637e8d31e
commit 21d87adc52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 1020 additions and 951 deletions

View file

@ -1,5 +1,5 @@
# Python script to migrate an LNbits SQLite DB to Postgres
# All credits to @Fritz446 for the awesome work
# credits to @Fritz446 for the awesome work
# pip install psycopg2 OR psycopg2-binary
@ -9,10 +9,14 @@ import sqlite3
import sys
from typing import List, Optional
import psycopg2
from lnbits.settings import settings
try:
import psycopg2 # type: ignore
except ImportError:
print("Please install psycopg2")
sys.exit(1)
sqfolder = settings.lnbits_data_folder
db_url = settings.lnbits_database_url
@ -55,8 +59,8 @@ def check_db_versions(sqdb):
version = dbpost[key]
if value != version:
raise Exception(
f"sqlite database version ({value}) of {key} doesn't match postgres"
f" database version {version}"
f"sqlite database version ({value}) of {key} doesn't match "
f"postgres database version {version}"
)
connection = postgres.connection