I suggest adding new methods to SQL queries. #45184
korenevskiy
started this conversation in
Ideas
Replies: 2 comments 1 reply
-
Hello @Fedik . Sorry to disturb I was afraid of getting a negative review without any reason or explanation. That's why I wanted to know your opinion on this issue. |
Beta Was this translation helpful? Give feedback.
0 replies
-
It is not that simple, the select/where query can be complex. In short:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I propose new functions similar to the existing ones but with the suffix
Q
.The task of the new methods is to wrap the names of columns and rows in the necessary quotation marks.
I always write queries as strings, ignoring the methods of the Query class. The reason for this is the difficulty of reading, the difficulty of perception, the difficulty of writing.
I suggest separating the processing of quotation marks from the business logic.
You and I must agree on the best syntax. So that the new methods take into account the needs of 80%-90% of all requests.
The new methods will wrap columns and row values in the appropriate quotation marks inside themselves.
The new method will wrap the first parameter in ` quotes. Take the second parameter as a comparison. The third parameter will be wrapped in direct " quotation marks.
I am sure that my colleagues will offer a more convenient option, with support for arrays.
But I'm sure that in 90%-95% of cases we use simple queries, in 99% of cases people reread their code, stumbling over the complexity of writing queries in PHP joomla.
We can also add new parameters to existing methods, taking into account the format of the methods.
Let's discuss your best options.
Beta Was this translation helpful? Give feedback.
All reactions