4 ms·
What’s a good PostgreSQL interface in Rust? Not looking for ORMs.
by xwdv 6y ago
What’s a good PostgreSQL interface in Rust? Not looking for ORMs.
- aliceryhl 6y agoFor a blocking interface, use https://docs.rs/postgres https://docs.rs/postgres and for an async interface https://docs.rs/tokio-postgres https://docs.rs/tokio-postgres
- stu2b50 6y agoThere's rust-postgres, which is just a driver as you are looking for. It's not exactly what I'd call mature. Diesel is more mature, but it is an ORM, albeit one with significantly less "magic", so maybe you'll like it more.
- brunoqc 6y agoAlso look at https://github.com/launchbadge/sqlx https://github.com/launchbadge/sqlx. I love compile-time checked queries (it's optional). It's simple to use too, async and includes a pool.
- Spartan-S63 6y agoDiesel is going to be your most ORM-like option, which isn't what you're looking for. `tokio-postgres` is great for async connections. SQLx is also a really good option, too, and has some ORM-like features (such as transforming SQL rows into a Rust struct via macros) while still allowing SQL to be a first-class citizen. SQLx is also async, so that would probably be the best one to look at first.
- yannikyeo 6y agoMy goto is SQLx with Warp.