mirror of
https://github.com/creyD/creyPY.git
synced 2026-04-15 12:50:32 +02:00
fix: Force postgresql SSL mode (#27)
* fix: Force postgresql SSL mode * changes
This commit is contained in:
@@ -5,7 +5,10 @@ from sqlalchemy.orm import sessionmaker
|
|||||||
|
|
||||||
from .common import SQLALCHEMY_DATABASE_URL, name
|
from .common import SQLALCHEMY_DATABASE_URL, name
|
||||||
|
|
||||||
async_engine = create_async_engine(SQLALCHEMY_DATABASE_URL + name, pool_pre_ping=True)
|
async_engine = create_async_engine(SQLALCHEMY_DATABASE_URL + name, pool_pre_ping=True,
|
||||||
|
connect_args={
|
||||||
|
'sslmode': 'require'
|
||||||
|
})
|
||||||
|
|
||||||
AsyncSessionLocal = sessionmaker(
|
AsyncSessionLocal = sessionmaker(
|
||||||
bind=async_engine,
|
bind=async_engine,
|
||||||
|
|||||||
@@ -6,7 +6,10 @@ from sqlalchemy.orm.session import Session
|
|||||||
|
|
||||||
from .common import SQLALCHEMY_DATABASE_URL, name
|
from .common import SQLALCHEMY_DATABASE_URL, name
|
||||||
|
|
||||||
engine = create_engine(SQLALCHEMY_DATABASE_URL + name, pool_pre_ping=True)
|
engine = create_engine(SQLALCHEMY_DATABASE_URL + name, pool_pre_ping=True,
|
||||||
|
connect_args={
|
||||||
|
'sslmode': 'require'
|
||||||
|
})
|
||||||
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user