MySQL and MariaDB support using DISTINCT for columns in JSON_ARRAYAGG to ensure unique values. GROUP_CONCAT also supports this syntax which seems to work as expected in sqlc. When I try using JSON_ARRAYAGG(DISTINCT <column>) however, I get a syntax error on valid SQL.
Version
1.27.0
What happened?
MySQL and MariaDB support using
DISTINCT
for columns inJSON_ARRAYAGG
to ensure unique values.GROUP_CONCAT
also supports this syntax which seems to work as expected in sqlc. When I try usingJSON_ARRAYAGG(DISTINCT <column>)
however, I get a syntax error on valid SQL.Syntax for JSON_ARRAYAGG from the MariaDB docs:
Relevant log output
Database schema
SQL queries
Configuration
Playground URL
https://play.sqlc.dev/p/8d89731835ebee2564e1351fe6354772a4047787fa675975e5c318ad965fc632
What operating system are you using?
Windows, macOS
What database engines are you using?
MySQL
What type of code are you generating?
Go