-
Notifications
You must be signed in to change notification settings - Fork 99
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Feature Request: Support for Synchronous Database Sessions
Is your feature request related to a problem?
No, this is a new feature proposal.
Proposed Solution
I'd like to discuss options for integrating support for synchronous database sessions. I'm open to implementing this myself, but I'd appreciate opinions on the best approach. Here are some potential solutions I've considered:
-
Separate Synchronous Classes
- Create new
SyncFastCrudclass andsync_crud_routerinstance - Drawback: This would introduce significant code redundancy
- Create new
-
Dual Function Approach (Similar to Langchain)
- Introduce separate functions for sync and async operations
- Example:
createfor sync andacreatefor async - Implementation: Check if the passed db is a
SessionorAsyncSession
-
Artificial Session Wrapper
- Create a wrapper to convert sync
Sessions intoAsyncSessions - Use
run_in_threadpool(which FastAPI would do internally for the previous two proposals)
- Create a wrapper to convert sync
I'm open to other ideas and would appreciate any feedback or alternative suggestions.
mrharpo and bradleybluebeannevehallon and octrow
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request