Standardize database operations to use SQLAlchemy ORM

- Updated the `MarketDataRepository` and `RawTradeRepository` classes to exclusively utilize SQLAlchemy ORM for all database interactions, enhancing maintainability and type safety.
- Removed raw SQL queries in favor of ORM methods, ensuring a consistent and database-agnostic approach across the repository layer.
- Revised documentation to reflect these changes, emphasizing the importance of using the ORM for database operations.

These modifications improve the overall architecture of the database layer, making it more scalable and easier to manage.
This commit is contained in:
Vasily.onl
2025-06-06 22:07:19 +08:00
parent 028371a0e1
commit b30c16bc33
4 changed files with 122 additions and 154 deletions

View File

@@ -435,6 +435,8 @@ candle = OHLCVCandle(...) # Create candle object
success = db.market_data.upsert_candle(candle)
```
The entire repository layer has been standardized to use the SQLAlchemy ORM internally, ensuring a consistent, maintainable, and database-agnostic approach. Raw SQL is avoided in favor of type-safe ORM queries.
## Performance Considerations
### Connection Pooling