circuithub / rel8

Hey! Hey! Can u rel8?
https://rel8.readthedocs.io
Other
150 stars 38 forks source link

Add new `Case` constraint which is more general than `Table Expr` #208

Open shane-circuithub opened 1 year ago

shane-circuithub commented 1 year ago

The Case constraint is used for functions like bool, case_, maybeTable, nullable, all of which ultimately compile down to a PostgreSQL CASE statement. Case has two instances: an overlapping Table Expr a => Case a instance, and a Case b => Case (a -> b) instance, that allows expressions like maybeTable id (+) which would not have been possible for.