full-stack-fastapi-template icon indicating copy to clipboard operation
full-stack-fastapi-template copied to clipboard

Question - Connect to existing database

Open breinbaas opened this issue 4 years ago • 1 comments

Hi all,

Short question, what would be the best direction to use an existing postgres database on another server? Or should I not bother using this nice template.

Regards, Rob

breinbaas avatar Jul 01 '21 10:07 breinbaas

maybe modifying in the content of full-stack-fastapi-postgresql/backend/app/app/db/session.py from engine = create_engine(settings.SQLALCHEMY_DATABASE_URI, pool_pre_ping=True)

to

engine = create_engine("postgresql://"username:password@ip:port/db_name", pool_pre_ping=True)

ieferrari avatar Aug 04 '21 17:08 ieferrari