polyphony-chat / chorus

A Rust library for interacting with multiple Polyphony- and Spacebar-Compatible instances at once.
https://crates.io/crates/chorus
Mozilla Public License 2.0
16 stars 7 forks source link

Initial support for PostgreSQL #548

Closed bitfl0wer closed 3 weeks ago

bitfl0wer commented 3 weeks ago

Initial support for using chorus with a PostgreSQL database, using the backend feature. In the same step, this removes support for MySQL/MariaDB. This does not mean that all types are now fully compatible with Postgres. Only the types needed in the current revision of symfonia have been ported over.

Interestingly, the sqlx docs mention the following when deriving sqlx::Type for structs in Postgres:

Records

User-defined composite types are supported through deriving a struct.

This is only supported for PostgreSQL.

#[derive(sqlx::Type)]
#[sqlx(type_name = "interface_type")]
struct InterfaceType {
    name: String,
    supplier_id: i32,
    price: f64
}