orbitalci / orbital

Orbital is a self-hosted CI system for solo/small consulting dev teams. Written in Rust.
GNU General Public License v3.0
29 stars 2 forks source link

Consider migrating DB interface to something async compatible #248

Open tjtelan opened 4 years ago

tjtelan commented 4 years ago

As I'm completing the rest of the interfaces for #243, I am feeling like I'm fighting the compiler a lot because Diesel's connector cannot be sent across async threads safely. It is frustrating but I wanted to open this issue so I can revisit the pros/cons later.

I'm using Diesel because I want compile-time checked queries, but also because it will manage sql migrations. Another feature is mapping custom Postgres enums to my own structs.

I see is sqlx. But it doesn't handle migrations and I'm unsure how it maps queries to my structs. Especially w/ my custom PG types.

I may be able to keep Diesel and use the tokio-diesel crate.