mirror of
https://github.com/yzernik/squeaknode.git
synced 2026-08-15 12:50:47 +02:00
* Show peer connection status for lightning node * Add connect peer button to lightning node page * Add test for connect peer * Add working test for list peers and connect peer * Add test for disconnect peer * Fix sqk dir config * Fix sqk_dir config * Successfully connect to sqkserver_other in docker-compose * Remove unused dialog from lightning node page
24 lines
584 B
Python
24 lines
584 B
Python
from sqlalchemy import create_engine
|
|
|
|
|
|
def get_postgres_engine(user, password, host, database):
|
|
return create_engine(get_postgres_connection_string(user, password, host, database))
|
|
|
|
|
|
def get_postgres_connection_string(user, password, host, database):
|
|
return "postgresql://{}:{}@{}/{}".format(
|
|
user,
|
|
password,
|
|
host,
|
|
database,
|
|
)
|
|
|
|
|
|
def get_sqlite_engine(data_dir):
|
|
return create_engine(get_sqlite_connection_string(data_dir))
|
|
|
|
|
|
def get_sqlite_connection_string(data_dir):
|
|
return "sqlite:////{}/data.db".format(
|
|
data_dir,
|
|
)
|