core
core copied to clipboard
Select field value search doesn't work with PostgreSQL
Description
First reported in Slack: https://boltcms.slack.com/archives/C0NJEK631/p1651144369168399
With PostgreSql database, when select field has more than 1 value, query doesn't match when needle is in position > 0.
Eg: searching for bar
returns only record ID_1.
id | select value |
---|---|
0 | ["foo", "bar"] |
1 | ["bar", "baz"] |
2 | ["baz"] |
Root
There is no Doctrine json function JSON_SEARCH for PostgreSQL database.
This line checks for feature existence. https://github.com/bolt/core/blob/master/src/Storage/SelectQuery.php#L599
Unless feature is available, Bolt offers limited support.