Skip to content

Group By with Coalesce #83

@Raveline

Description

@Raveline

According to the documentation of PG on GROUP BY:

An expression used inside a grouping_element can be an input column name, or the name or ordinal number of an output column (SELECT list item), or an arbitrary expression formed from input-column values

However, the current version of Squeal is limited to columns, not "an arbitrary expression formed from input-column values". Though I suppose these would be fairy rare, and hard to fit inside the type system, I have one case which should not be that rare: a GROUP BY using a COALESCE over two fields (context: a FULL OUTER JOIN with two similar columns). I'm gonna try to find a way to shortcut this through an UnsafeGrouping expression, but it could be worth it (in the long term, obviously) to investigate ways to model more complex GROUP BY expressions.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions