postgresql-simple-0.5.2.0: Mid-Level PostgreSQL client library

MaintainerLeon P Smith <leon@melding-monads.com>
Safe HaskellNone

Database.PostgreSQL.Simple.Range

Description

 

Synopsis

Documentation

data RangeBound a Source

Represents boundary of a range

isEmpty :: Ord a => PGRange a -> BoolSource

Is a range empty? If this returns True, then the contains predicate will always return False. However, if this returns False, it is not necessarily true that there exists a point for which contains returns True. Consider PGRange (Excludes 2) (Excludes 3) :: PGRange Int, for example.

isEmptyBy :: (a -> a -> Ordering) -> PGRange a -> BoolSource

contains :: Ord a => PGRange a -> a -> BoolSource

Does a range contain a given point? Note that in some cases, this may not correspond exactly with a server-side computation. Consider UTCTime for example, which has a resolution of a picosecond, whereas postgresql's timestamptz types have a resolution of a microsecond. Putting such Haskell values into the database will result in them being rounded, which can change the value of the containment predicate.

containsBy :: (a -> a -> Ordering) -> PGRange a -> a -> BoolSource