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
2024-07-14T16:58:00.546408Z ERROR api::models: public.pass_types (High): The Column `price` is has changed, db_type: NUMERIC welds_type: Decimal
Here, the type is sqlx::types::Decimal and it's defined as NUMERIC(12,2) in the database.
Custom enum type
2024-07-14T16:58:00.546336Z ERROR api::models: public.passes (High): The Column `buying_place` is has changed, db_type: BUYING_PLACE welds_type: BuyingPlace
Here, it is an enum type that I want to store in the database. It derives sqlx::Type and renames the type to buying_place. Sqlx does not have any problems with that.
2024-07-14T16:58:00.546444Z ERROR api::models: public.section_types (High): The Column `days` is has changed, db_type: BIT welds_type: Bits<7>
This is a newtype implemented by me to represent a BIT(7) type in the postgres database. It wraps around the sqlx::types::BitVec type, and manually implements sqlx::Type which contains information about the correct type name.
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.