Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog.d/20260322_223524_shane.obrien_range.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Added

- Added preliminary support for PostgreSQL ranges.
7 changes: 7 additions & 0 deletions rel8.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ library
, hasql >= 1.8 && < 1.10
, iproute ^>= 1.7
, opaleye ^>= 0.10.2.1
, postgresql-binary ^>= 0.14.2
, pretty
, profunctors
, product-profunctors
Expand Down Expand Up @@ -70,13 +71,15 @@ library
Rel8.Expr.Num
Rel8.Expr.Text
Rel8.Expr.Time
Rel8.Range
Rel8.Table.Verify
Rel8.Tabulate

other-modules:
Rel8.Aggregate
Rel8.Aggregate.Fold
Rel8.Aggregate.Function
Rel8.Aggregate.Range

Rel8.Column
Rel8.Column.ADT
Expand All @@ -88,6 +91,8 @@ library
Rel8.Column.Null
Rel8.Column.These

Rel8.Data.Range

Rel8.Expr
Rel8.Expr.Aggregate
Rel8.Expr.Array
Expand All @@ -101,6 +106,7 @@ library
Rel8.Expr.Opaleye
Rel8.Expr.Ord
Rel8.Expr.Order
Rel8.Expr.Range
Rel8.Expr.Read
Rel8.Expr.Sequence
Rel8.Expr.Serialize
Expand Down Expand Up @@ -239,6 +245,7 @@ library
Rel8.Type.Parser
Rel8.Type.Parser.ByteString
Rel8.Type.Parser.Time
Rel8.Type.Range
Rel8.Type.ReadShow
Rel8.Type.Semigroup
Rel8.Type.String
Expand Down
21 changes: 21 additions & 0 deletions src/Rel8/Aggregate/Range.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{-# LANGUAGE OverloadedStrings #-}

module Rel8.Aggregate.Range (
rangeAgg,
) where

-- base
import Prelude

-- rel8
import Rel8.Aggregate (Aggregator', toAggregator)
import Rel8.Aggregate.Function (aggregateFunction)
import Rel8.Data.Range (Multirange, Range)
import Rel8.Expr (Expr)
import Rel8.Type.Range (DBRange)


rangeAgg ::
DBRange a =>
Aggregator' fold (Expr (Range a)) (Expr (Multirange a))
rangeAgg = toAggregator mempty $ aggregateFunction "range_agg"
Loading
Loading