Open wvffle opened 4 months ago
So no support for enums right now? @wvffle @cajun @lex148 @sunnyregion
@TheGP welds is really just a wrapper around sqlx
and tiberius
. Type wise, if they support it we do too. sqlx
supports direct mapping of you enum types into custom postgres enum types. this is functional in welds, but runtime level database verification can get a little confused. welds::check::schema::*
I need to bump this in priority and address.
I've just migrated my app to welds and it is pretty neat.
Although it throws me some false-positive errors regarding custom types when doing
welds::check::schema
:Decimal type
Here, the type is
sqlx::types::Decimal
and it's defined asNUMERIC(12,2)
in the database.Custom enum type
Here, it is an enum type that I want to store in the database. It derives
sqlx::Type
and renames the type tobuying_place
. Sqlx does not have any problems with that.Custom newtype
This is a newtype implemented by me to represent a
BIT(7)
type in the postgres database. It wraps around thesqlx::types::BitVec
type, and manually implementssqlx::Type
which contains information about the correct type name.