Skip to content
Discussion options

You must be logged in to vote

You’re on the right track trying to transform the query!

However, the problem is that Contember’s DataGridQueryFilter only builds conditions for the database – it doesn’t modify the actual column values at query time. So if the database contains values with spaces and dots, they will still be matched literally unless you normalize them.

The best solution is to normalize the text at the database level using a view. You can learn more about views here: https://docs.contember.com/reference/engine/schema/views/

Here’s an example that:

  • trims the text
  • replaces dots and spaces
  • makes everything lowercase
@c.View(`
    SELECT
        article.id AS id,
        article.id AS article_id,
        LO…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@kausik10
Comment options

Answer selected by kausik10
Comment options

You must be logged in to vote
1 reply
@jonasnobile
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants