Update app/db.py
Browse files
app/db.py
CHANGED
@@ -29,8 +29,13 @@ class User(SQLAlchemyBaseUserTableUUID, Base):
|
|
29 |
pass
|
30 |
|
31 |
|
32 |
-
engine = create_async_engine(DATABASE_URL)
|
33 |
-
async_session_maker = async_sessionmaker(engine,
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
|
36 |
async def create_db_and_tables():
|
|
|
29 |
pass
|
30 |
|
31 |
|
32 |
+
engine = create_async_engine(DATABASE_URL, pool_per_ping=True)
|
33 |
+
async_session_maker = async_sessionmaker(engine,
|
34 |
+
#class_=AsyncSession,
|
35 |
+
autoflush=True,
|
36 |
+
autocommit=False,
|
37 |
+
expire_on_commit=False,
|
38 |
+
)
|
39 |
|
40 |
|
41 |
async def create_db_and_tables():
|