You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expr scope a is typed representation of underlying db expression Ast PrimExpr
Scope helps to refer to a column in type safe manner like
Consider for example,
typeUsera=Expr '[ "id":::Int
, "name":::Text
, "email":::Text
, "role":::UserRole
] a
col @"name".=="foobar"::UserBool-- or using OverloadedLabel, same thing could be written as#name .== "foobar" :: User Bool
JSON (de-)serialiazation is exprimental attempt btw.
Idea behind (de-)serialiazation instances for Expr type are
we can get the db expression as raw string (probably as rest api param)
For Eg. name=="foobar" will successfully parse as User Bool
but, id=="foobar" will not parse as User Bool as id column is of type Int
Regarding JSON ByteString instance, I agree it is problematic to keep such opinionated orphan instance in the library. I will probably replace it with the newtype wrapped definition.
These would be pretty surprising to bump into!
The text was updated successfully, but these errors were encountered: