Customize the available sql operators#117
Customize the available sql operators#117sergant210 wants to merge 1 commit intomodxcms:3.xfrom sergant210:patch-2
Conversation
|
Not sure there is any significance to this, where an IN or NOT IN can be used in the current xPDO. |
|
@wshawn Do you really understand how the FIND_IN_SET operator works? I showed only one example. There are many SQL operators that are not allowed in MODX by default. |
|
It is functionally similar to IN without the casting IN performs. If memory serves, FIND_IN_SET is also much heavier at the query level, doesn't use indexes, and easily breaks if commas are used. Lastly it is limited in MySQL to 64 items in a set. This is off the top of my head. |
|
Hello! But in xpdo don't have this functions This very need function This is call not work, because xpdo do not support work with JSON. In this theme have PR. But if you do not want to accept PR, then add work with JSON fields P.S. PR is good :) |
|
@Kossin7 Currently, we use xPDO::toJSON and xPDO::fromJSON to save the JSON to a text field. I understand MODX3 has a minimum MySQL version of 2.6, I do not know if xPDO has a minimum established, but if it is 2.6 then 2.7 functions may not be possible at this time. |
|
@wshawn , it's so bad... |
What does it do?
It allows to manage the list of sql operators. To do this you need to add two system settings - allowed_sql_operators and denied_sql_operators.
Why is it needed?
This PR give me the ability to do like that
All I need is to set the allowed_sql_operators system setting in JSON format: ["FIND_IN_SET", "ANOTHER_SQL_OPERATOR"]
P.S. It also simplifies the usage of the pdoTools library:
Related issue(s)/PR(s)
?