-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support JSON column->path for quoteName #246
Comments
This would be possible only, if either PostgreSQL supports that, too, or we can (want to) mimic that for PostgreSQL. |
Looks like they do. |
Doesn't sound like a good idea, quoting functions shouldn't be to complex. It would be better to have an own constructor for such queries that can build a proper field statement. Maybe looking at other database layers how this is handled. Out of the blue have something like function quoteJsonAsJson($field, $elements =[], $as='') {
return $this->quoteName($field).' -> '. implode('->', $this->quote($elements)) . ' AS ' . $as;
}
function quoteJsonAsText($field, $elements =[], $as='') {
$last = array_pop($elements);
return $this->quoteJsonAsJson($field, $elements) .' ->>' . $last . ' AS ' . $as;
}
function quoteJsonAsType($type, $field, $elements =[], $as='') {
$last = array_pop($elements);
switch($type) {
case ParameterType::INTERGER:
$type = 'INTEGER';
....
}
return 'CAST(' . $this->quoteJsonAsText($field, $elements) . ') AS ' . $as;
} That's just a short idea, nothing detail maybe others solved this in a much better or more generic/specific way. |
Just want to check if there is any plan to support MySQL JSON column->path for quoteName function.
https://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html#operator_json-column-path
Something like:
It should only quote the "params" part.
The text was updated successfully, but these errors were encountered: