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
We're building a table view. Users can sort by one or more columns, and can also filter by column value. For example, the column "done" hosts a checkbox, and the user can choose to show only rows where the "done" checkbox is checked.
We'd like one of the columns to be filterable by fuzzy text search, for example entering "abcde" should match "abcdef" and "acbde". Postgres supports a number of trigram distance operators which can be used to implement this filter as a SQL function.
The question is: Is it possible to use a SQL function in the where clause of a Hasura GraphQL query? This would simplify the implementation of custom filters, and enable us to combine multiple such custom filters as needed. Otherwise we'll probably have to generate our own SQL.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
We're building a table view. Users can sort by one or more columns, and can also filter by column value. For example, the column "done" hosts a checkbox, and the user can choose to show only rows where the "done" checkbox is checked.
We'd like one of the columns to be filterable by fuzzy text search, for example entering "abcde" should match "abcdef" and "acbde". Postgres supports a number of trigram distance operators which can be used to implement this filter as a SQL function.
The question is: Is it possible to use a SQL function in the
where
clause of a Hasura GraphQL query? This would simplify the implementation of custom filters, and enable us to combine multiple such custom filters as needed. Otherwise we'll probably have to generate our own SQL.Beta Was this translation helpful? Give feedback.
All reactions