▲ | tmpfs a day ago | |
I have used this as well as many of the other lower-level db drivers (which don't check your SQL at compile time) and I can say I much prefer the latter. My issues with SQLx when I first tried it were that it was really awkward (nigh impossible) to abstract away the underlying DB backend, I expect those issues are fixed now but for some simple apps it's nice to be able to start with SQLite and then switch out with postgres. Then I wanted to dockerize an SQLx app at one point and it all becomes a hassle as you need postgres running at compile time and trying to integrate with docker compose was a real chore. Now I don't use SQLx at all. I recommend other libraries like sqlite[1] or postgres[2] instead. SQLx is a nice idea but too cumbersome in my experience. [1]: https://docs.rs/sqlite/latest/sqlite/ [2]: https://docs.rs/postgres/latest/postgres/ | ||
▲ | vegizombie 21 hours ago | parent | next [-] | |
It's definitely not perfect, but I think both of those issues are better now, if not fully solved. For needing a DB at compile time, there's an option to have it produce artefacts on demand that replace the DB, although you'll need to connect to a DB again each time your queries change. Even that is all optional though, if you want it to compile time check your queries. | ||
▲ | stmw 11 hours ago | parent | prev [-] | |
Thanks, interesting experience - so much depends on getting developer ergonomics right. There is something to be said for checking the SQL at compile-time, though - esp. if trying to ORM to a typesafe language. |