SeaORM is not typesafe, by design (and also uses sqlx itself as a dependency). Diesel can do dynamic queries too but it still remains completely typesafe.
What is your definition of typesafe here? With SeaOrm structs are created directly from the db schema with codegen. This is vastly superior to using strings and checking them at build time.
Just up front, it seems like you think I don't know about how all of these things are implemented.
I do.
So when you say SeaORM has Sqlx as a dependency. I know that. If the purpose of that statement was to say seaorm compile times can't be faster that sqlx because sqlx is a dependency of seaorm, that thought is wrong.
Using SeaORM the way it is intended to be used results in code that is much faster to compile than sqlx being used the way it's intended to be used.
I make no assumption about your level of knowledge, I simply stated that sqlx is a dependency just for completeness. I also did not imply anything about whether having such a dependency makes for faster or slower compile times than without.
Anyway, my comparison was with regards to SeaORM (and/or sqlx) versus Diesel. SeaORM explicitly say they are not fully typesafe. From the docs [0]:
> Using a completely static query builder can eliminate this entire class of errors. However, it requires that every parameter be defined statically and available compile-time. This is a harsh requirement, as there is always something you could not know until your program starts (environment variables) and runs (runtime configuration change). This is especially awkward if you come from a scripting language background where the type system has always been dynamic.
> As such, SeaORM does not attempt to check things at compile-time. We intend to (still in development) provide runtime linting on the dynamically generated queries against the mentioned problems that you can enable in unit tests but disable in production.
That is simply a deal breaker for me. I use an ORM specifically to be fully compile-time safe, so having this sort of "escape hatch" in a language that is already typesafe and sound is just going backwards. In contrast, Diesel is fully typesafe and fixes all of the issues from [0], even for dynamic queries [1].
This all being said, I have also found Prisma Client Rust [2] and Cornucopia [3] to be viable alternatives to the "big 3 (SeaORM, sqlx, Diesel)" so to speak. PCR uses Prisma to generate an ORM but is generally slower due to the overhead of running the Prisma engine, but it's ergonomic if you already use Prisma in the TypeScript world, and it's a pretty good ORM itself. I have not used Cornucopia as much but it is less of an ORM and more of a way to generate types in Rust from your SQL. There is some discussion about them on reddit, for comparison [4].