-
Improvement
-
Resolution: Deferred
-
Minor
-
None
-
Future Dev
-
None
The rough idea is we have some sql like this which is written for postgres:
SELECT
|
STRING_AGG(u.firstname || ' ' || u.lastname, ',') creators |
FROM {user}
|
This sql could be in code somewhere, or in a customsql report. But it's gonna break when we run it on mysql or oracle. The current correct way to fix it is to rip the sql apart and call
$sqlchunk = sql_group_concat(u.firstname || ' ' || u.lastname, ',') |
$sql = '....' $sqlchunk . '....'; |
I'm just imagining a better world where we can do this all in "sql" and the dml libraries internally translate it into the right sql:
SELECT
|
group_concat(u.firstname || ' ' || u.lastname, ',') creators |
FROM {user}
|
the exact syntax doesn't matter, it might need to have some sort of tokens to make it all work:
SELECT
|
{{group_concat(u.firstname || ' ' || u.lastname, ',')}} creators |
FROM {user}
|
This would make a lot of code much easier and more natural to write. This would apply to a bunch of the sql_* helpers functions
- has a non-specific relationship to
-
MDL-26171 sql_fullname() should respect the system or language settings
-
- Closed
-