Is it possible to use arbitrary SQL aggregation functions using the Select class?

We have a need to use the string_agg function of Postgres in some backend code which runs SQL against the DB using the Select class, but this is not one of the standard available AggregationTypeStrict enum types. Is there a method for using arbitrary database aggregation functions such as string_agg in a Select class query construction? Or is this not possible with Creatio's Select class? If so, is the only other alternative to use the deprecated CustomQuery class?

Like 0

Like

2 comments
Best reply

It's only possible using CustomQuery. 

I am not sure why CustomQuery is marked as deprecated - I believe it has been since 7.17.4. At the time of 7.17 I had discussions with Creatio and was told they were leaving CustomQuery in place and only certain removing DBExecutor functions, however, it's remained marked as deprecated since. I assume it isn't going anywhere and (hopefully) will continue to be safe to use despite being marked deprecated.

It's only possible using CustomQuery. 

I am not sure why CustomQuery is marked as deprecated - I believe it has been since 7.17.4. At the time of 7.17 I had discussions with Creatio and was told they were leaving CustomQuery in place and only certain removing DBExecutor functions, however, it's remained marked as deprecated since. I assume it isn't going anywhere and (hopefully) will continue to be safe to use despite being marked deprecated.

Thanks Ryan, the other alternative I thought of in the meantime was to do the aggregation in C# on unaggregated data returned from the query, which isn't great but could work for low data volume situations (like the one I was dealing with). Good to hear that maybe CustomQuery isn't as deprecated as it seems then!

Show all comments