Skip to content

How to use ILIKE? #229

Answered by go-jet
isgj asked this question in Q&A
Apr 16, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Currently, ILIKE is not supported. You'll have to use Raw method. For instance:

BoolExp(Raw("table.column ILIKE :value", , RawArgs{":float": "_val%" }))

, or you can simulate ILIKE using LOWER:

LOWER(table.column).LIKE(String("_val%"))

Not sure about extending StringExpression because ILIKE is postgres specific, and StringExpression is interface for all dialects. Probably new ILIKE method would be the best: ILIKE(table.column, String("_val%")).

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@isgj
Comment options

@go-jet
Comment options

Answer selected by isgj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants