Skip to content

refactor: migrate to diesel-rs for query construction#928

Merged
drahnr merged 43 commits intonextfrom
bernhard-diesel-demo-for-store-query
Jul 30, 2025
Merged

refactor: migrate to diesel-rs for query construction#928
drahnr merged 43 commits intonextfrom
bernhard-diesel-demo-for-store-query

Conversation

@drahnr
Copy link
Contributor

@drahnr drahnr commented Jun 5, 2025

A example of using diesel.rs as an ORM for a single query.

Learnings

  • Caveats

    • types in models.rs need to align precisely with the schema generated from the database in schema.rs - otherwise one gets lengthy errors - but at least at compile time
    • filters still require type conversions to the native DB representation
    • requires an intermediate type to represent a row (it's good, but sometimes might get in the way
    • additional complexity
  • Upsides

    • More structured / a little less boilerplate
    • No inline SQL (if desired)
    • Drop in for postgres possible

Outstanding

  • Understand how to load records partially
  • Migration integration - deferred

Closes #921

@drahnr drahnr force-pushed the bernhard-diesel-demo-for-store-query branch from ec1d97d to 4f94df1 Compare June 5, 2025 13:42
@drahnr drahnr requested a review from Mirko-von-Leipzig June 5, 2025 16:11
@drahnr drahnr force-pushed the bernhard-diesel-demo-for-store-query branch from fae3879 to 39ea14d Compare June 10, 2025 15:09
@bobbinth bobbinth requested a review from igamigo June 23, 2025 17:48
@drahnr drahnr force-pushed the bernhard-diesel-demo-for-store-query branch 2 times, most recently from b4b6fd7 to e4c3ee5 Compare July 3, 2025 12:57
@drahnr drahnr changed the title diesel demo for store query refactor: migrate to diesel-rs for query construction Jul 14, 2025
@drahnr drahnr force-pushed the bernhard-diesel-demo-for-store-query branch from e4c3ee5 to ed19245 Compare July 15, 2025 17:42
@drahnr drahnr marked this pull request as ready for review July 15, 2025 21:34
@drahnr
Copy link
Contributor Author

drahnr commented Jul 25, 2025

Let's have a call on Monday post our regular calls and sync up then @sergerad @Mirko-von-Leipzig

@drahnr drahnr force-pushed the bernhard-diesel-demo-for-store-query branch from 1dca38f to b5d7dca Compare July 29, 2025 12:43
Copy link
Collaborator

@Mirko-von-Leipzig Mirko-von-Leipzig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of questions but I think we should proceed with this before we damage it (and its authors) health any more :D

@drahnr drahnr merged commit 0489647 into next Jul 30, 2025
8 checks passed
@drahnr drahnr deleted the bernhard-diesel-demo-for-store-query branch July 30, 2025 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task]: trial run diesel.rs as thin ORM for store

5 participants