Not exactly an issue, but a guide on how to support a new type in SeaQuery.
It usually starts from ColumnType where we'd add the type, so that it can be used in schema statements
If the type has a native representation (like UUID), we can add a variant to the enum Value (and ArrayType) and implement all necessary traits (ValueType)
we should also determine the JSON serialisation (most likely string) which is implemented in sea_value_to_json_value
Feature guards i.e. #[cfg(feature = "with-uuid")] are needed
We shouldn't depend on sqlx directly in the sea-query crate, so if a type is only defined in sqlx, we have to copy the struct and put it inside sea-query
In sea-query-binder & sea-query-postgres, we then perform the type conversion and binding
Finally, in sea-orm, we should implement TryGetable for the right backend
Not exactly an issue, but a guide on how to support a new type in SeaQuery.
ColumnType
where we'd add the type, so that it can be used in schema statementsValue
(andArrayType
) and implement all necessary traits (ValueType
)sea_value_to_json_value
#[cfg(feature = "with-uuid")]
are neededsqlx
directly in thesea-query
crate, so if a type is only defined insqlx
, we have to copy the struct and put it insidesea-query
sea-query-binder
&sea-query-postgres
, we then perform the type conversion and bindingsea-orm
, we should implementTryGetable
for the right backendReference:
(ipnetwork) https://github.com/SeaQL/sea-query/pull/309 https://github.com/SeaQL/sea-query/pull/364 https://github.com/SeaQL/sea-query/pull/503
(time) https://github.com/SeaQL/sea-query/pull/267 https://github.com/SeaQL/sea-orm/pull/602