Compile time checked Raw SQL #627
Replies: 3 comments
-
Hey @johannescpk, thanks for the suggestions! I guess you are talking about this? For SeaORM, it does not force user to provide environment variable of
Extracted from https://docs.rs/sqlx/0.5.11/sqlx/macro.query.html#requirements |
Beta Was this translation helpful? Give feedback.
-
There's also the offline mode https://docs.rs/sqlx/0.5.11/sqlx/macro.query.html#offline-mode-requires-the-offline-feature On the other hand, compile time checked queries are one of biggest advantages sqlx has, and exposing that feature for raw queries in SeaORM would be really nice :) Hiding it behind feature would make it easy for users who don't care about raw queries at all to ignore those requirements. (Technically, it should be also possible to generate the offline file |
Beta Was this translation helpful? Give feedback.
-
Dynamic SQL (those built with sea-qeury) cannot be checked compile time |
Beta Was this translation helpful? Give feedback.
-
Summary
Currently Raw SQL isn't compile time checked, but since sea-orm builds on sqlx, which has compile time checks as its main feature, it would be great to allow those in sea-orm as well.
Motivation
Compile time checks for raw sql give confidence and help you to not break things when writing SQL.
Additional Information
Not sure if this is even feasible with sea-orm.
Beta Was this translation helpful? Give feedback.
All reactions