Closed atyoshioka closed 3 months ago
The recent updates introduce a significant refactor in the database handling code, shifting from raw SQL queries to leveraging the Diesel ORM for improved readability and maintainability. Several public methods for data deletion and selection in the PostgreSQL backend have been removed, indicating a streamlined approach to database interactions. This modernization simplifies the codebase while enhancing type safety and reducing potential errors.
Files | Change Summary |
---|---|
src/backends/postgres.rs |
Removed several public methods and query-building functions for data deletion and selection, streamlining the database interaction layer. |
src/model.rs |
Refactored database interaction to use Diesel ORM methods, enhancing code readability and maintainability by replacing raw SQL with Diesel's query builder. |
sequenceDiagram
participant Client
participant Database
participant DieselORM
Client->>Database: Request to add model
Database->>DieselORM: Insert model using insert_into
DieselORM-->>Database: Confirmation of insert
Database-->>Client: Return success
Client->>Database: Request to delete model
Database->>DieselORM: Delete model using delete
DieselORM-->>Database: Confirmation of delete
Database-->>Client: Return success
In a garden, a rabbit hops with glee,
βOh, look at the code, so neat and free!
No more tangled SQL, just Diesel's grace,
Simplified queries, a joyous embrace.
With each little change, our code's in bloom,
Hooray for the updates, letβs make some room!β πβ¨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Attention: Patch coverage is 0%
with 140 lines
in your changes missing coverage. Please review.
Project coverage is 61.72%. Comparing base (
c3343e3
) to head (aa34476
). Report is 1 commits behind head on main.
Files | Patch % | Lines |
---|---|---|
src/model.rs | 0.00% | 140 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Use diesel's query builder in
model
.Summary by CodeRabbit
New Features
Bug Fixes
Refactor