squeaknode/squeakserver/db/db_engine.py
Jonathan Zernik 8b9f87990d
Show peer connection in lightning node (#280)
* 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
2020-10-09 05:55:32 -07:00

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,
)