You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DatabaseSessionService class: set a more explicit way to decide the schema #2217
hi @Istorn , i'm interested to work on this feature. Left some of the thought and would like to see if this can support your case:
2 changes to be made for it:
Change 1: Add optional arg "engine" to init() of the DatabaseSessionService.
Benefits: Scalable to many agents system because different sessions (of different agent) can share the same connection pool to the same SQL engine. The response time will also be much faster when db connections are reused.
Change 2:For every session manipulation method, keep it within a context which: (a) create the schema if it does not exist. (b) utilize the schema translate map to make operation under the give schema.
Benefits: Ensure the designated schema is effective in every operation to allow recycling of db connections.
This enhancement is very critical to enable the SessionService to support different enterprise cases where agents need to work on separate schemas with proper data isolation. Let me know if it sounds fine. I could submit a PR accordingly.
For default option, that's what i mean the engine should be optional. Backward compatibility is important. I'm expecting the change will not impact any current implementation.
Hi @Istorn , thanks for reporting this, we started to record the schema version in 0094eea and also provided a cli command adk migration session for future migrations.
Activity
dylan-apex commentedon Jul 28, 2025
Duplicate/Related to #2115
jeffreyrubi commentedon Jul 31, 2025
hi @Istorn , i'm interested to work on this feature. Left some of the thought and would like to see if this can support your case:
2 changes to be made for it:
Change 1: Add optional arg "engine" to init() of the DatabaseSessionService.
Benefits: Scalable to many agents system because different sessions (of different agent) can share the same connection pool to the same SQL engine. The response time will also be much faster when db connections are reused.
Change 2:For every session manipulation method, keep it within a context which: (a) create the schema if it does not exist. (b) utilize the schema translate map to make operation under the give schema.
Benefits: Ensure the designated schema is effective in every operation to allow recycling of db connections.
This enhancement is very critical to enable the SessionService to support different enterprise cases where agents need to work on separate schemas with proper data isolation. Let me know if it sounds fine. I could submit a PR accordingly.
Istorn commentedon Jul 31, 2025
Hi @jeffreyrubi wanna join the forces together?
I understand your concerns, what if we keep a default option in case of none custom ones are being provided?
jeffreyrubi commentedon Jul 31, 2025
Sure. Happy to join force.
For default option, that's what i mean the engine should be optional. Backward compatibility is important. I'm expecting the change will not impact any current implementation.
dylan-apex commentedon Jul 31, 2025
While working on this, can you update the
adk.cli.fast_api.get_fast_api_app()to also accept a database engine?klateefa commentedon Nov 21, 2025
@Istorn Thanks for reporting!
We are currently reviewing your feature request,Its under review
Thanks for your patience.
DeanChensj commentedon Nov 27, 2025
Hi @Istorn , thanks for reporting this, we started to record the schema version in 0094eea and also provided a cli command
adk migration sessionfor future migrations.jeffreyrubi commentedon Dec 10, 2025
I'm seeing this issue get closed. are we planning to do this or decide not to go ahead?
dylan-apex commentedon Dec 10, 2025
You can add db args when creating the DB Session
divakaivan commentedon Sep 21, 2026
if you're using
postgresql+asyncpg, this seems to be a solution