Closed cemoktra closed 2 years ago
Hey @cemoktra, I guess you need to implement ActiveEnum
manually instead of deriving DeriveActiveEnum
.
https://www.sea-ql.org/SeaORM/docs/generate-entity/enumeration#manual-implementation
Ok also possible, and what about mapping ltree to TEXT?
But I think I'll provide some changes for ltree
I'm not sure how ltree
works.
But for ActiveEnum
,
'enum_value' AS enum_type
enum_column AS text
I started with the basic work on sqlx: https://github.com/launchbadge/sqlx/pull/1696
Thanks!! @cemoktra Let me know if you need any help on it!
Yeah maybe. Currently sea-query does not depend on sqlx itself, but in order to use my new type it will
Do you have any opinion on how to integrate this into seaql?
I think we can treat ltree as a simple string? Then, we don't need any additional SQLx dependency. https://github.com/launchbadge/sqlx/pull/1696#discussion_r804343242
Currently i get thread 'test::test' panicked at 'not implemented', sea-orm/src/driver/sqlx_postgres.rs:8:1
when trying to filter for an LTree with .eq, also .contains wants a String instead of PgLTree
.filter(test::Column::Ltree.eq(ltree))
Just doing a query works
Same for insert
Ok found the missing piece, sorry
This is sad but I think our general response to "support a particular Postgres feature" will be "we will gladly accept PR" for now
We just played around with ltrees.
sea-orm-cli
currently generates an empty enum. Maybe for the special ltree case it shoud generate something likeCurrently this ends up in
error: Missing macro attribute, either
string_valueor
num_valueshould be specified
, so there would need to be a way to extract the string out of the Value variant.