Repository navigation
Fixing database connection and Tenant separation errors #236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
207c502
a8a4d7c
0f9b277
837cbc6
753c025
7757d32
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,7 +44,7 @@ async def calculate_total_revenue(property_id: str, tenant_id: str) -> Dict[str, | |
| await db_pool.initialize() | ||
|
|
||
| if db_pool.session_factory: | ||
| async with db_pool.get_session() as session: | ||
| async with (await db_pool.get_session()) as session: | ||
| # Use SQLAlchemy text for raw SQL | ||
| from sqlalchemy import text | ||
|
|
||
|
Comment on lines
44
to
50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Suggested FixInject or import the global Prompt for AI AgentDid we get this right? 👍 / 👎 to inform future reviews. |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug:
DATABASE_URLindocker-compose.ymllacks the+asyncpgdriver scheme, causingcreate_async_engineinDatabasePool.initialize()to fail and leave the connection pool uninitialized.Severity: HIGH
Suggested Fix
Update
DATABASE_URLindocker-compose.ymlto usepostgresql+asyncpg://, or normalize the driver scheme insideDatabasePool.initialize()/config.pyto ensure+asyncpgis always used forcreate_async_engine.Prompt for AI Agent
Did we get this right? 👍 / 👎 to inform future reviews.