Skip to content

Commit

Permalink
Merge pull request #60 from cipherstash/add-back-group-by-support
Browse files Browse the repository at this point in the history
Add back `GROUP BY` support
  • Loading branch information
CDThomas authored Nov 5, 2024
2 parents 24a3d7f + 6d1a55b commit e44b9a2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions sql/010-core.sql
Original file line number Diff line number Diff line change
Expand Up @@ -351,3 +351,17 @@ CREATE FUNCTION cs_ore_64_8_v1(val jsonb)
BEGIN ATOMIC
RETURN cs_ore_64_8_v1_v0_0(val);
END;

DROP FUNCTION IF EXISTS _cs_first_grouped_value(jsonb, jsonb);

CREATE FUNCTION _cs_first_grouped_value(jsonb, jsonb)
RETURNS jsonb AS $$
SELECT COALESCE($1, $2);
$$ LANGUAGE sql IMMUTABLE;

DROP AGGREGATE IF EXISTS cs_grouped_value_v1(jsonb);

CREATE AGGREGATE cs_grouped_value_v1(jsonb) (
SFUNC = _cs_first_grouped_value,
STYPE = jsonb
);

0 comments on commit e44b9a2

Please sign in to comment.