-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
Is there any support for collations in rel8, or an easy way to implement them in terms of existing primitives? I saw rawBinaryOperator :: QualifiedName -> Expr a -> Expr b -> Expr c, but I don't think it makes sense for the b argument to actually be a Expr, given collation syntax in postgres looks like SELECT * FROM table WHERE "column" COLLATE "de_DE". If the second argument was an Expr we could generate something like SELECT * FROM table WHERE table.text COLLATE text.lang = 'something'?, which I don't believe is valid.
The collation needs to be hardcoded, so the type would probably be something like collate :: Expr Text -> Text -> Expr Text, and I'm not sure if something like this would be safe to use:
collate :: Text -> Expr Text -> Expr Text
collate ty txt = rawBinaryOperator "COLLATE" txt (unsafeLiteral (show ty) :: Expr Text) -- type signature needed to prevent ambiguous types
Metadata
Metadata
Assignees
Labels
No labels