How to implement MySql's GROUP_CONCAT using Esqueleto in Haskell?

75 Views Asked by At

I need to find out how to implement MySql's Group_Concat under Esqueleto in Haskell. The esqueleto function should look like the following but this version is suitable for Sqlite. So I need a working solution for Mysql:

sqliteGroupConcat ::
     PersistField a
  => SqlExpr (Value a)
  -> SqlExpr (Value a)
  -> SqlExpr (Value Text)
 -- sqliteGroupConcat (t ^. BookmarkTagTag) (val " ") 
sqliteGroupConcat expr sep = unsafeSqlFunction "GROUP_CONCAT" [expr, sep]

I cannot use this group_concat function for mysql as the inputs in mysql's version aren't comma separated. The group_concat function for mysql should be able to perform the following sql function:

GROUP_CONCAT(country SEPARATOR ';')
0

There are 0 best solutions below