I have a CTE and I want an array to coalesce to [] and the count to coalesce to 0. ``` export function aggregateAsArray<Column extends AnyColumn>(column: Column) { return sql< GetColumnData<Column, 'raw'>[] >`coalesce(array_agg(distinct ${sql`${column}`}) filter (where ${column} is not null), ARRAY[]::text[])`; } ``` ``` const tagData = db.$with('library_tag_data').as( db .select({ fooId: tableSurveysTagsLibrary.fooId, tags: aggregateAsArray(tableSurveysTagsLibrary.tag).as('tags'), tagCount: count(tableSurveysTagsLibrary.tag).as('tagCount') }) .from(tableSurveysTagsLibrary) .groupBy(tableSurveysTagsLibrary.fooId) ); ``` This feels too hard. What am I am missing?