-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LIKE and ILIKE #144
Comments
Hi @fabfianda, thanks for the kind words! like, ilike :: Expr Text -> Expr Text -> Expr Bool
like = dbFunction "LIKE"
ilike = dbFunction "ILIKE" |
oh wow, excellent lib with excellent support XD |
Follow up: I solved by doing this instead: like, ilike :: Expr Text -> Expr Text -> Expr Bool
like = binaryOperator "LIKE"
ilike = binaryOperator "ILIKE" So now I can happily have functions like this: type Pattern = Text
articlesNamedLike :: Pattern -> Query (Article Expr)
articlesNamedLike pattern = do
article <- allArticles
where_ $ (articleName article) `like` (lit pattern)
return article |
Oh sorry, you're exactly right - you want |
Thanks for the lib, I'm enjoying using it a lot.
One question, though.
I don't seem to find a way to express a LIKE or ILIKE query.
If not supported directly, as it seems, what would be the best workaround?
Thanks
The text was updated successfully, but these errors were encountered: