-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | PostgreSQL backend for the groundhog library.
--   
--   This package uses postgresql-simple and postgresql-libpq.
@package groundhog-postgresql
@version 0.8.0.3

module Database.Groundhog.Postgresql
withPostgresqlPool :: (MonadBaseControl IO m, MonadIO m) => String -> Int -> (Pool Postgresql -> m a) -> m a
withPostgresqlConn :: (MonadBaseControl IO m, MonadIO m) => String -> (Postgresql -> m a) -> m a
createPostgresqlPool :: MonadIO m => String -> Int -> m (Pool Postgresql)

-- | Runs action within connection. It can handle a simple connection, a
--   pool of them, etc.
runDbConn :: (MonadIO m, MonadBaseControl IO m, ConnectionManager conn, ExtractConnection cm conn) => Action conn a -> cm -> m a
newtype Postgresql
Postgresql :: Connection -> Postgresql

-- | Put explicit type for expression. It is useful for values which are
--   defaulted to a wrong type. For example, a literal Int from a 64bit
--   machine can be defaulted to a 32bit int by Postgresql. Also a value
--   entered as an external string (geometry, arrays and other complex
--   types have this representation) may need an explicit type.
explicitType :: (Expression Postgresql r a, PersistField a) => a -> Expr Postgresql r a

-- | Casts expression to a type. <tt>castType value "INT"</tt> results in
--   <tt>value::INT</tt>.
castType :: Expression Postgresql r a => a -> String -> Expr Postgresql r a

-- | Distinct only on certain fields or expressions. For example,
--   <tt>select $ CondEmpty <a>distinctOn</a> (lower EmailField,
--   IpField)</tt>.
distinctOn :: (db ~ Postgresql, HasSelectOptions a db r, HasDistinct a ~ HFalse, Projection' p db r p') => a -> p -> SelectOptions db r (HasLimit a) (HasOffset a) (HasOrder a) HTrue
showSqlType :: DbTypePrimitive -> String
instance Database.PostgreSQL.Simple.ToField.ToField Database.Groundhog.Postgresql.P
instance Database.Groundhog.Core.DbDescriptor Database.Groundhog.Postgresql.Postgresql
instance Database.Groundhog.Generic.Sql.SqlDb Database.Groundhog.Postgresql.Postgresql
instance Database.Groundhog.Generic.Sql.FloatingSqlDb Database.Groundhog.Postgresql.Postgresql
instance Database.Groundhog.Core.PersistBackendConn Database.Groundhog.Postgresql.Postgresql
instance Database.Groundhog.Generic.Migration.SchemaAnalyzer Database.Groundhog.Postgresql.Postgresql
instance Database.Groundhog.Core.Savepoint Database.Groundhog.Postgresql.Postgresql
instance Database.Groundhog.Core.ConnectionManager Database.Groundhog.Postgresql.Postgresql
instance Database.Groundhog.Core.TryConnectionManager Database.Groundhog.Postgresql.Postgresql
instance Database.Groundhog.Core.ExtractConnection Database.Groundhog.Postgresql.Postgresql Database.Groundhog.Postgresql.Postgresql
instance Database.Groundhog.Core.ExtractConnection (Data.Pool.Pool Database.Groundhog.Postgresql.Postgresql) Database.Groundhog.Postgresql.Postgresql


-- | See detailed documentation for PostgreSQL arrays at
--   <a>http://www.postgresql.org/docs/9.2/static/arrays.html</a> and
--   <a>http://www.postgresql.org/docs/9.2/static/functions-array.html</a>
module Database.Groundhog.Postgresql.Array

-- | Represents PostgreSQL arrays
newtype Array a
Array :: [a] -> Array a
(!) :: (ExpressionOf Postgresql r a (Array elem), ExpressionOf Postgresql r b Int) => a -> b -> Expr Postgresql r elem
(!:) :: (ExpressionOf Postgresql r a (Array elem), ExpressionOf Postgresql r i1 Int, ExpressionOf Postgresql r i2 Int) => a -> (i1, i2) -> Expr Postgresql r (Array elem)
append :: (ExpressionOf Postgresql r a (Array elem), ExpressionOf Postgresql r b elem) => a -> b -> Expr Postgresql r (Array elem)
prepend :: (ExpressionOf Postgresql r a elem, ExpressionOf Postgresql r b (Array elem)) => a -> b -> Expr Postgresql r (Array elem)
arrayCat :: (ExpressionOf Postgresql r a (Array elem), ExpressionOf Postgresql r b (Array elem)) => a -> b -> Expr Postgresql r (Array elem)
arrayDims :: (ExpressionOf Postgresql r a (Array elem)) => a -> Expr Postgresql r String
arrayNDims :: (ExpressionOf Postgresql r a (Array elem)) => a -> Expr Postgresql r Int
arrayLower :: (ExpressionOf Postgresql r a (Array elem)) => a -> Int -> Expr Postgresql r Int
arrayUpper :: (ExpressionOf Postgresql r a (Array elem)) => a -> Int -> Expr Postgresql r Int
arrayLength :: (ExpressionOf Postgresql r a (Array elem)) => a -> Int -> Expr Postgresql r Int

-- | Concatenates array elements using supplied delimiter.
--   array_to_string(ARRAY[1, 2, 3], <tt>~^~</tt>) = 1~^~2~^~3
arrayToString :: (ExpressionOf Postgresql r a (Array elem)) => a -> String -> Expr Postgresql r String

-- | Splits string into array elements using supplied delimiter.
--   string_to_array('xx~^~yy~^~zz', <tt>~^~</tt>) = {xx,yy,zz}
stringToArray :: (ExpressionOf Postgresql r a String) => a -> String -> Expr Postgresql r (Array String)
any :: (ExpressionOf Postgresql r a elem, ExpressionOf Postgresql r b (Array elem)) => a -> b -> Cond Postgresql r
all :: (ExpressionOf Postgresql r a elem, ExpressionOf Postgresql r b (Array elem)) => a -> b -> Cond Postgresql r

-- | Contains. ARRAY[1,4,3] @&gt; ARRAY[3,1] = t
(@>) :: (ExpressionOf Postgresql r a (Array elem), ExpressionOf Postgresql r b (Array elem)) => a -> b -> Cond Postgresql r

-- | Is contained by. ARRAY[2,7] &lt;@ ARRAY[1,7,4,2,6] = t
(<@) :: (ExpressionOf Postgresql r a (Array elem), ExpressionOf Postgresql r b (Array elem)) => a -> b -> Cond Postgresql r

-- | Overlap (have elements in common). ARRAY[1,4,3] &amp;&amp; ARRAY[2,1]
--   = t
overlaps :: (ExpressionOf Postgresql r a (Array elem), ExpressionOf Postgresql r b (Array elem)) => a -> b -> Cond Postgresql r
instance GHC.Show.Show a => GHC.Show.Show (Database.Groundhog.Postgresql.Array.Array a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Database.Groundhog.Postgresql.Array.Array a)
instance (Database.Groundhog.Postgresql.Array.ArrayElem a, Database.Groundhog.Core.PrimitivePersistField a) => Database.Groundhog.Core.PersistField (Database.Groundhog.Postgresql.Array.Array a)
instance Database.Groundhog.Postgresql.Array.ArrayElem a => Database.Groundhog.Postgresql.Array.ArrayElem (Database.Groundhog.Postgresql.Array.Array a)
instance Database.Groundhog.Core.PrimitivePersistField a => Database.Groundhog.Postgresql.Array.ArrayElem a
instance (Database.Groundhog.Postgresql.Array.ArrayElem a, Database.Groundhog.Core.PrimitivePersistField a) => Database.Groundhog.Core.PrimitivePersistField (Database.Groundhog.Postgresql.Array.Array a)
instance Data.Aeson.Types.ToJSON.ToJSON a => Data.Aeson.Types.ToJSON.ToJSON (Database.Groundhog.Postgresql.Array.Array a)
instance Data.Aeson.Types.FromJSON.FromJSON a => Data.Aeson.Types.FromJSON.FromJSON (Database.Groundhog.Postgresql.Array.Array a)

module Database.Groundhog.Postgresql.Geometry
data Point
Point :: Double -> Double -> Point

-- | It is not fully implemented in PostgreSQL yet. It is kept just to
--   match all geometric types.
data Line
Line :: Point -> Point -> Line
data Lseg
Lseg :: Point -> Point -> Lseg
data Box
Box :: Point -> Point -> Box
data Path
ClosedPath :: [Point] -> Path
OpenPath :: [Point] -> Path
data Polygon
Polygon :: [Point] -> Polygon
data Circle
Circle :: Point -> Double -> Circle

-- | Translation
--   
--   <pre>
--   box '((0,0),(1,1))' + point '(2.0,0)' = box '(3,1),(2,0)'
--   </pre>
(+.) :: (SqlDb db, Plus a b, ExpressionOf db r x a, ExpressionOf db r y b) => x -> y -> Expr db r a
infixl 6 +.

-- | Translation
--   
--   <pre>
--   box '((0,0),(1,1))' - point '(2.0,0)' = box '(-1,1),(-2,0)'
--   </pre>
(-.) :: (SqlDb db, BoxCirclePathPoint a, ExpressionOf db r x a, ExpressionOf db r y Point) => x -> y -> Expr db r a
infixl 6 -.

-- | Scaling/rotation
--   
--   <pre>
--   box '((0,0),(1,1))' * point '(2.0,0)' = box '(2,2),(0,0)'
--   </pre>
(*.) :: (SqlDb db, BoxCirclePathPoint a, ExpressionOf db r x a, ExpressionOf db r y Point) => x -> y -> Expr db r a
infixl 7 *.

-- | Scaling/rotation
--   
--   <pre>
--   box '((0,0),(2,2))' / point '(2.0,0)' = box '(1,1),(0,0)'
--   </pre>
(/.) :: (SqlDb db, BoxCirclePathPoint a, ExpressionOf db r x a, ExpressionOf db r y Point) => x -> y -> Expr db r a
infixl 7 /.

-- | Point or box of intersection
--   
--   <pre>
--   lseg '((1,-1),(-1,1))' # '((1,1),(-1,-1))' = point '(0,0)'
--   </pre>
--   
--   <pre>
--   box '((1,-1),(-1,1))' # '((1,1),(-1,-1))' = box '(1,1),(-1,-1)'
--   </pre>
(#) :: (SqlDb db, BoxLineLseg a, ExpressionOf db r x a, ExpressionOf db r y a) => x -> y -> Expr db r a

-- | Closest point to first operand on second operand
--   
--   <pre>
--   point '(0,0)' ## lseg '((2,0),(0,2))' = point '(1,1)'
--   </pre>
(##) :: (SqlDb db, Closest a b, ExpressionOf db r x a, ExpressionOf db r y b) => x -> y -> Expr db r Point

-- | Distance between
--   
--   <pre>
--   circle '((0,0),1)' <a>-</a> circle '((5,0),1)' = 3
--   </pre>
(<->) :: (SqlDb db, Distance a b, ExpressionOf db r x a, ExpressionOf db r y b) => x -> y -> Expr db r Double

-- | Overlaps?
--   
--   <pre>
--   box '((0,0),(1,1))' &amp;&amp; box '((0,0),(2,2))' = true
--   </pre>
(&&) :: (SqlDb db, BoxCirclePolygon a, ExpressionOf db r x a, ExpressionOf db r y a) => x -> y -> Cond db r

-- | Is strictly left of?
--   
--   <pre>
--   circle '((0,0),1)' &lt;&lt; circle '((5,0),1)' = true
--   </pre>
(<<) :: (SqlDb db, BoxCirclePointPolygon a, ExpressionOf db r x a, ExpressionOf db r y a) => x -> y -> Cond db r

-- | Is strictly right of?
--   
--   <pre>
--   circle '((5,0),1)' &gt;&gt; circle '((0,0),1)' = true
--   </pre>
(>>) :: (SqlDb db, BoxCirclePointPolygon a, ExpressionOf db r x a, ExpressionOf db r y a) => x -> y -> Cond db r

-- | Does not extend to the right of? box '((0,0),(1,1))' &amp;&lt; box
--   '((0,0),(2,2))' = t
(&<) :: (SqlDb db, BoxCirclePolygon a, ExpressionOf db r x a, ExpressionOf db r y a) => x -> y -> Cond db r

-- | Does not extend to the left of?
--   
--   <pre>
--   box '((0,0),(3,3))' &amp;&gt; box '((0,0),(2,2))' = true
--   </pre>
(&>) :: (SqlDb db, BoxCirclePolygon a, ExpressionOf db r x a, ExpressionOf db r y a) => x -> y -> Cond db r

-- | Is strictly below?
--   
--   <pre>
--   box '((0,0),(3,3))' &lt;&lt;| box '((3,4),(5,5))' = true
--   </pre>
(<<|) :: (SqlDb db, BoxCirclePolygon a, ExpressionOf db r x a, ExpressionOf db r y a) => x -> y -> Cond db r

-- | Is strictly above?
--   
--   <pre>
--   box '((3,4),(5,5))' |&gt;&gt; box '((0,0),(3,3))'
--   </pre>
(|>>) :: (SqlDb db, BoxCirclePolygon a, ExpressionOf db r x a, ExpressionOf db r y a) => x -> y -> Cond db r

-- | Does not extend above?
--   
--   <pre>
--   box '((0,0),(1,1))' &amp;&lt;| box '((0,0),(2,2))' = true
--   </pre>
(&<|) :: (SqlDb db, BoxCirclePolygon a, ExpressionOf db r x a, ExpressionOf db r y a) => x -> y -> Cond db r

-- | Does not extend below?
--   
--   <pre>
--   box '((0,0),(3,3))' |&amp;&gt; box '((0,0),(2,2))' = true
--   </pre>
(|&>) :: (SqlDb db, BoxCirclePolygon a, ExpressionOf db r x a, ExpressionOf db r y a) => x -> y -> Cond db r

-- | Is below (allows touching)?
--   
--   <pre>
--   circle '((0,0),1)' &lt;^ circle '((0,5),1)' = true
--   </pre>
(<^) :: (SqlDb db, BoxPoint a, ExpressionOf db r x a, ExpressionOf db r y a) => x -> y -> Cond db r

-- | Is above (allows touching)?
--   
--   <pre>
--   circle '((0,5),1)' &gt;^ circle '((0,0),1)' = true
--   </pre>
(>^) :: (SqlDb db, BoxPoint a, ExpressionOf db r x a, ExpressionOf db r y a) => x -> y -> Cond db r

-- | Intersects?
--   
--   <pre>
--   lseg '((-1,0),(1,0))' ?# box '((-2,-2),(2,2))' = true
--   </pre>
(?#) :: (SqlDb db, Intersects a b, ExpressionOf db r x a, ExpressionOf db r y b) => x -> y -> Cond db r

-- | Are horizontally aligned?
--   
--   <pre>
--   point '(1,0)' ?- point '(0,0)' = true
--   </pre>
(?-) :: (SqlDb db, ExpressionOf db r x Point, ExpressionOf db r y Point) => x -> y -> Cond db r

-- | Are vertically aligned?
--   
--   <pre>
--   point '(0,1)' ?| point '(0,0)' = true
--   </pre>
(?|) :: (SqlDb db, ExpressionOf db r x Point, ExpressionOf db r y Point) => x -> y -> Cond db r

-- | Is perpendicular?
--   
--   <pre>
--   lseg '((0,0),(0,1))' ?-| lseg '((0,0),(1,0))' = true
--   </pre>
(?-|) :: (SqlDb db, LineLseg a, ExpressionOf db r x a, ExpressionOf db r y a) => x -> y -> Cond db r

-- | Are parallel?
--   
--   <pre>
--   lseg '((-1,0),(1,0))' ?|| lseg '((-1,2),(1,2))' = true
--   </pre>
(?||) :: (SqlDb db, LineLseg a, ExpressionOf db r x a, ExpressionOf db r y a) => x -> y -> Cond db r

-- | Contains?
--   
--   <pre>
--   circle '((0,0),2)' @&gt; point '(1,1)' = true
--   </pre>
(@>) :: (SqlDb db, Contains a b, ExpressionOf db r x a, ExpressionOf db r y b) => x -> y -> Cond db r

-- | Contained in or on?
--   
--   <pre>
--   point '(1,1)' &lt;@ circle '((0,0),2)' = true
--   </pre>
(<@) :: (SqlDb db, Contained a b, ExpressionOf db r x a, ExpressionOf db r y b) => x -> y -> Cond db r

-- | Same as?
--   
--   <pre>
--   polygon '((0,0),(1,1))' ~= polygon '((1,1),(0,0))' = true
--   </pre>
(~=) :: (SqlDb db, BoxCirclePointPolygon a, ExpressionOf db r x a, ExpressionOf db r y a) => x -> y -> Cond db r
instance GHC.Show.Show Database.Groundhog.Postgresql.Geometry.Circle
instance GHC.Classes.Eq Database.Groundhog.Postgresql.Geometry.Circle
instance GHC.Show.Show Database.Groundhog.Postgresql.Geometry.Polygon
instance GHC.Classes.Eq Database.Groundhog.Postgresql.Geometry.Polygon
instance GHC.Show.Show Database.Groundhog.Postgresql.Geometry.Path
instance GHC.Classes.Eq Database.Groundhog.Postgresql.Geometry.Path
instance GHC.Show.Show Database.Groundhog.Postgresql.Geometry.Box
instance GHC.Classes.Eq Database.Groundhog.Postgresql.Geometry.Box
instance GHC.Show.Show Database.Groundhog.Postgresql.Geometry.Lseg
instance GHC.Classes.Eq Database.Groundhog.Postgresql.Geometry.Lseg
instance GHC.Show.Show Database.Groundhog.Postgresql.Geometry.Line
instance GHC.Classes.Eq Database.Groundhog.Postgresql.Geometry.Line
instance GHC.Show.Show Database.Groundhog.Postgresql.Geometry.Point
instance GHC.Classes.Eq Database.Groundhog.Postgresql.Geometry.Point
instance Database.Groundhog.Postgresql.Geometry.Intersects Database.Groundhog.Postgresql.Geometry.Box Database.Groundhog.Postgresql.Geometry.Box
instance Database.Groundhog.Postgresql.Geometry.Intersects Database.Groundhog.Postgresql.Geometry.Line Database.Groundhog.Postgresql.Geometry.Line
instance Database.Groundhog.Postgresql.Geometry.Intersects Database.Groundhog.Postgresql.Geometry.Line Database.Groundhog.Postgresql.Geometry.Box
instance Database.Groundhog.Postgresql.Geometry.Intersects Database.Groundhog.Postgresql.Geometry.Lseg Database.Groundhog.Postgresql.Geometry.Box
instance Database.Groundhog.Postgresql.Geometry.Intersects Database.Groundhog.Postgresql.Geometry.Lseg Database.Groundhog.Postgresql.Geometry.Line
instance Database.Groundhog.Postgresql.Geometry.Intersects Database.Groundhog.Postgresql.Geometry.Lseg Database.Groundhog.Postgresql.Geometry.Lseg
instance Database.Groundhog.Postgresql.Geometry.Intersects Database.Groundhog.Postgresql.Geometry.Path Database.Groundhog.Postgresql.Geometry.Path
instance Database.Groundhog.Postgresql.Geometry.Closest Database.Groundhog.Postgresql.Geometry.Line Database.Groundhog.Postgresql.Geometry.Box
instance Database.Groundhog.Postgresql.Geometry.Closest Database.Groundhog.Postgresql.Geometry.Line Database.Groundhog.Postgresql.Geometry.Lseg
instance Database.Groundhog.Postgresql.Geometry.Closest Database.Groundhog.Postgresql.Geometry.Lseg Database.Groundhog.Postgresql.Geometry.Box
instance Database.Groundhog.Postgresql.Geometry.Closest Database.Groundhog.Postgresql.Geometry.Lseg Database.Groundhog.Postgresql.Geometry.Line
instance Database.Groundhog.Postgresql.Geometry.Closest Database.Groundhog.Postgresql.Geometry.Lseg Database.Groundhog.Postgresql.Geometry.Lseg
instance Database.Groundhog.Postgresql.Geometry.Closest Database.Groundhog.Postgresql.Geometry.Point Database.Groundhog.Postgresql.Geometry.Line
instance Database.Groundhog.Postgresql.Geometry.Closest Database.Groundhog.Postgresql.Geometry.Point Database.Groundhog.Postgresql.Geometry.Box
instance Database.Groundhog.Postgresql.Geometry.Closest Database.Groundhog.Postgresql.Geometry.Point Database.Groundhog.Postgresql.Geometry.Lseg
instance Database.Groundhog.Postgresql.Geometry.Contained Database.Groundhog.Postgresql.Geometry.Box Database.Groundhog.Postgresql.Geometry.Box
instance Database.Groundhog.Postgresql.Geometry.Contained Database.Groundhog.Postgresql.Geometry.Circle Database.Groundhog.Postgresql.Geometry.Circle
instance Database.Groundhog.Postgresql.Geometry.Contained Database.Groundhog.Postgresql.Geometry.Lseg Database.Groundhog.Postgresql.Geometry.Box
instance Database.Groundhog.Postgresql.Geometry.Contained Database.Groundhog.Postgresql.Geometry.Lseg Database.Groundhog.Postgresql.Geometry.Line
instance Database.Groundhog.Postgresql.Geometry.Contained Database.Groundhog.Postgresql.Geometry.Point Database.Groundhog.Postgresql.Geometry.Lseg
instance Database.Groundhog.Postgresql.Geometry.Contained Database.Groundhog.Postgresql.Geometry.Point Database.Groundhog.Postgresql.Geometry.Box
instance Database.Groundhog.Postgresql.Geometry.Contained Database.Groundhog.Postgresql.Geometry.Point Database.Groundhog.Postgresql.Geometry.Line
instance Database.Groundhog.Postgresql.Geometry.Contained Database.Groundhog.Postgresql.Geometry.Point Database.Groundhog.Postgresql.Geometry.Path
instance Database.Groundhog.Postgresql.Geometry.Contained Database.Groundhog.Postgresql.Geometry.Point Database.Groundhog.Postgresql.Geometry.Polygon
instance Database.Groundhog.Postgresql.Geometry.Contained Database.Groundhog.Postgresql.Geometry.Point Database.Groundhog.Postgresql.Geometry.Circle
instance Database.Groundhog.Postgresql.Geometry.Contained Database.Groundhog.Postgresql.Geometry.Polygon Database.Groundhog.Postgresql.Geometry.Polygon
instance Database.Groundhog.Postgresql.Geometry.Contains Database.Groundhog.Postgresql.Geometry.Box Database.Groundhog.Postgresql.Geometry.Box
instance Database.Groundhog.Postgresql.Geometry.Contains Database.Groundhog.Postgresql.Geometry.Box Database.Groundhog.Postgresql.Geometry.Point
instance Database.Groundhog.Postgresql.Geometry.Contains Database.Groundhog.Postgresql.Geometry.Circle Database.Groundhog.Postgresql.Geometry.Circle
instance Database.Groundhog.Postgresql.Geometry.Contains Database.Groundhog.Postgresql.Geometry.Circle Database.Groundhog.Postgresql.Geometry.Point
instance Database.Groundhog.Postgresql.Geometry.Contains Database.Groundhog.Postgresql.Geometry.Path Database.Groundhog.Postgresql.Geometry.Point
instance Database.Groundhog.Postgresql.Geometry.Contains Database.Groundhog.Postgresql.Geometry.Polygon Database.Groundhog.Postgresql.Geometry.Polygon
instance Database.Groundhog.Postgresql.Geometry.Contains Database.Groundhog.Postgresql.Geometry.Polygon Database.Groundhog.Postgresql.Geometry.Point
instance Database.Groundhog.Postgresql.Geometry.Distance Database.Groundhog.Postgresql.Geometry.Box Database.Groundhog.Postgresql.Geometry.Box
instance Database.Groundhog.Postgresql.Geometry.Distance Database.Groundhog.Postgresql.Geometry.Circle Database.Groundhog.Postgresql.Geometry.Circle
instance Database.Groundhog.Postgresql.Geometry.Distance Database.Groundhog.Postgresql.Geometry.Circle Database.Groundhog.Postgresql.Geometry.Polygon
instance Database.Groundhog.Postgresql.Geometry.Distance Database.Groundhog.Postgresql.Geometry.Line Database.Groundhog.Postgresql.Geometry.Line
instance Database.Groundhog.Postgresql.Geometry.Distance Database.Groundhog.Postgresql.Geometry.Line Database.Groundhog.Postgresql.Geometry.Box
instance Database.Groundhog.Postgresql.Geometry.Distance Database.Groundhog.Postgresql.Geometry.Lseg Database.Groundhog.Postgresql.Geometry.Line
instance Database.Groundhog.Postgresql.Geometry.Distance Database.Groundhog.Postgresql.Geometry.Lseg Database.Groundhog.Postgresql.Geometry.Lseg
instance Database.Groundhog.Postgresql.Geometry.Distance Database.Groundhog.Postgresql.Geometry.Lseg Database.Groundhog.Postgresql.Geometry.Box
instance Database.Groundhog.Postgresql.Geometry.Distance Database.Groundhog.Postgresql.Geometry.Path Database.Groundhog.Postgresql.Geometry.Path
instance Database.Groundhog.Postgresql.Geometry.Distance Database.Groundhog.Postgresql.Geometry.Point Database.Groundhog.Postgresql.Geometry.Path
instance Database.Groundhog.Postgresql.Geometry.Distance Database.Groundhog.Postgresql.Geometry.Point Database.Groundhog.Postgresql.Geometry.Point
instance Database.Groundhog.Postgresql.Geometry.Distance Database.Groundhog.Postgresql.Geometry.Point Database.Groundhog.Postgresql.Geometry.Circle
instance Database.Groundhog.Postgresql.Geometry.Distance Database.Groundhog.Postgresql.Geometry.Point Database.Groundhog.Postgresql.Geometry.Line
instance Database.Groundhog.Postgresql.Geometry.Distance Database.Groundhog.Postgresql.Geometry.Point Database.Groundhog.Postgresql.Geometry.Box
instance Database.Groundhog.Postgresql.Geometry.Distance Database.Groundhog.Postgresql.Geometry.Point Database.Groundhog.Postgresql.Geometry.Lseg
instance Database.Groundhog.Postgresql.Geometry.Distance Database.Groundhog.Postgresql.Geometry.Polygon Database.Groundhog.Postgresql.Geometry.Polygon
instance Database.Groundhog.Postgresql.Geometry.Plus Database.Groundhog.Postgresql.Geometry.Box Database.Groundhog.Postgresql.Geometry.Point
instance Database.Groundhog.Postgresql.Geometry.Plus Database.Groundhog.Postgresql.Geometry.Circle Database.Groundhog.Postgresql.Geometry.Point
instance Database.Groundhog.Postgresql.Geometry.Plus Database.Groundhog.Postgresql.Geometry.Path Database.Groundhog.Postgresql.Geometry.Point
instance Database.Groundhog.Postgresql.Geometry.Plus Database.Groundhog.Postgresql.Geometry.Path Database.Groundhog.Postgresql.Geometry.Path
instance Database.Groundhog.Postgresql.Geometry.Plus Database.Groundhog.Postgresql.Geometry.Point Database.Groundhog.Postgresql.Geometry.Point
instance Database.Groundhog.Postgresql.Geometry.LineLseg Database.Groundhog.Postgresql.Geometry.Line
instance Database.Groundhog.Postgresql.Geometry.LineLseg Database.Groundhog.Postgresql.Geometry.Lseg
instance Database.Groundhog.Postgresql.Geometry.BoxPoint Database.Groundhog.Postgresql.Geometry.Box
instance Database.Groundhog.Postgresql.Geometry.BoxPoint Database.Groundhog.Postgresql.Geometry.Point
instance Database.Groundhog.Postgresql.Geometry.BoxCirclePointPolygon Database.Groundhog.Postgresql.Geometry.Box
instance Database.Groundhog.Postgresql.Geometry.BoxCirclePointPolygon Database.Groundhog.Postgresql.Geometry.Circle
instance Database.Groundhog.Postgresql.Geometry.BoxCirclePointPolygon Database.Groundhog.Postgresql.Geometry.Point
instance Database.Groundhog.Postgresql.Geometry.BoxCirclePointPolygon Database.Groundhog.Postgresql.Geometry.Polygon
instance Database.Groundhog.Postgresql.Geometry.BoxCirclePathPoint Database.Groundhog.Postgresql.Geometry.Box
instance Database.Groundhog.Postgresql.Geometry.BoxCirclePathPoint Database.Groundhog.Postgresql.Geometry.Circle
instance Database.Groundhog.Postgresql.Geometry.BoxCirclePathPoint Database.Groundhog.Postgresql.Geometry.Path
instance Database.Groundhog.Postgresql.Geometry.BoxCirclePathPoint Database.Groundhog.Postgresql.Geometry.Point
instance Database.Groundhog.Postgresql.Geometry.BoxCirclePolygon Database.Groundhog.Postgresql.Geometry.Box
instance Database.Groundhog.Postgresql.Geometry.BoxCirclePolygon Database.Groundhog.Postgresql.Geometry.Circle
instance Database.Groundhog.Postgresql.Geometry.BoxCirclePolygon Database.Groundhog.Postgresql.Geometry.Polygon
instance Database.Groundhog.Postgresql.Geometry.BoxLineLseg Database.Groundhog.Postgresql.Geometry.Box
instance Database.Groundhog.Postgresql.Geometry.BoxLineLseg Database.Groundhog.Postgresql.Geometry.Line
instance Database.Groundhog.Postgresql.Geometry.BoxLineLseg Database.Groundhog.Postgresql.Geometry.Lseg
instance Database.Groundhog.Core.PrimitivePersistField Database.Groundhog.Postgresql.Geometry.Circle
instance Database.Groundhog.Core.PersistField Database.Groundhog.Postgresql.Geometry.Circle
instance Database.Groundhog.Core.PrimitivePersistField Database.Groundhog.Postgresql.Geometry.Polygon
instance Database.Groundhog.Core.PersistField Database.Groundhog.Postgresql.Geometry.Polygon
instance Database.Groundhog.Core.PrimitivePersistField Database.Groundhog.Postgresql.Geometry.Path
instance Database.Groundhog.Core.PersistField Database.Groundhog.Postgresql.Geometry.Path
instance Database.Groundhog.Core.PrimitivePersistField Database.Groundhog.Postgresql.Geometry.Box
instance Database.Groundhog.Core.PersistField Database.Groundhog.Postgresql.Geometry.Box
instance Database.Groundhog.Core.PrimitivePersistField Database.Groundhog.Postgresql.Geometry.Lseg
instance Database.Groundhog.Core.PersistField Database.Groundhog.Postgresql.Geometry.Lseg
instance Database.Groundhog.Core.PrimitivePersistField Database.Groundhog.Postgresql.Geometry.Line
instance Database.Groundhog.Core.PersistField Database.Groundhog.Postgresql.Geometry.Line
instance Database.Groundhog.Core.PrimitivePersistField Database.Groundhog.Postgresql.Geometry.Point
instance Database.Groundhog.Core.PersistField Database.Groundhog.Postgresql.Geometry.Point


-- | See detailed documentation for PostgreSQL HStore at
--   <a>http://www.postgresql.org/docs/9.3/static/hstore.html</a>
module Database.Groundhog.Postgresql.HStore
newtype HStore
HStore :: (Map Text Text) -> HStore

-- | Get value for key (NULL if not present)
--   
--   <pre>
--   'a=&gt;x, b=&gt;y'::hstore -&gt; <tt>a</tt> == x
--   </pre>
(->.) :: (db ~ Postgresql, ExpressionOf db r hstore HStore, ExpressionOf db r key key', IsString key') => hstore -> key -> Expr db r (Maybe Text)

-- | Get values for keys array (NULL if not present)
--   
--   <pre>
--   'a=&gt;x, b=&gt;y, c=&gt;z'::hstore == ARRAY[<tt>c</tt>,<tt>a</tt>]  {"z","x"}
--   </pre>
lookupArr :: (db ~ Postgresql, ExpressionOf db r hstore HStore, ExpressionOf db r keys (Array Text)) => hstore -> keys -> Expr db r (Array Text)

-- | Concatenate hstores
--   
--   <pre>
--   'a=&gt;b, c=&gt;d'::hstore || 'c=&gt;x, d=&gt;q'::hstore == "a"=&gt;"b", "c"=&gt;"x", "d"=&gt;"q"
--   </pre>
hstoreConcat :: (db ~ Postgresql, ExpressionOf db r hstore1 HStore, ExpressionOf db r hstore2 HStore) => hstore1 -> hstore2 -> Expr db r HStore

-- | Delete key from left operand
--   
--   <pre>
--   'a=&gt;1, b=&gt;2, c=&gt;3'::hstore - <tt>b</tt>::text == "a"=&gt;"1", "c"=&gt;"3"
--   </pre>
deleteKey :: (db ~ Postgresql, ExpressionOf db r hstore HStore, ExpressionOf db r key key', IsString key') => hstore -> key -> Expr db r HStore

-- | Delete keys from left operand
--   
--   <pre>
--   'a=&gt;1, b=&gt;2, c=&gt;3'::hstore - ARRAY[<tt>a</tt>,<tt>b</tt>] == "c"=&gt;"3"
--   </pre>
deleteKeys :: (db ~ Postgresql, ExpressionOf db r hstore HStore, ExpressionOf db r keys (Array Text)) => hstore -> keys -> Expr db r HStore

-- | Delete matching pairs from left operand
--   
--   <pre>
--   'a=&gt;1, b=&gt;2, c=&gt;3'::hstore - 'a=&gt;4, b=&gt;2'::hstore == "a"=&gt;"1", "c"=&gt;"3"
--   </pre>
difference :: (db ~ Postgresql, ExpressionOf db r hstore1 HStore, ExpressionOf db r hstore2 HStore) => hstore1 -> hstore2 -> Expr db r HStore

-- | Convert hstore to array of alternating keys and values. Same as prefix
--   operator %%.
--   
--   <pre>
--   hstore_to_array('a=&gt;1,b=&gt;2') == {a,1,b,2}
--   </pre>
hstore_to_array :: (db ~ Postgresql, ExpressionOf db r hstore HStore) => hstore -> Expr db r (Array Text)

-- | Convert hstore to two-dimensional key/value array. Same as prefix
--   operator %#.
--   
--   <pre>
--   hstore_to_matrix('a=&gt;1,b=&gt;2') == {{a,1},{b,2}}
--   </pre>
hstore_to_matrix :: (db ~ Postgresql, ExpressionOf db r hstore HStore) => hstore -> Expr db r (Array (Array Text))

-- | Get hstore's keys as an array
--   
--   <pre>
--   akeys('a=&gt;1,b=&gt;2') == {a,b}
--   </pre>
akeys :: (db ~ Postgresql, ExpressionOf db r hstore HStore) => hstore -> Expr db r (Array Text)

-- | Get hstore's values as an array
--   
--   <pre>
--   avals('a=&gt;1,b=&gt;2') == {1,2}
--   </pre>
avals :: (db ~ Postgresql, ExpressionOf db r hstore HStore) => hstore -> Expr db r (Array Text)

-- | Extract a subset of an hstore
--   
--   <pre>
--   slice('a=&gt;1,b=&gt;2,c=&gt;3'::hstore, ARRAY[<tt>b</tt>,<tt>c</tt>,<tt>x</tt>]) =="b"=&gt;"2", "c"=&gt;"3"
--   </pre>
slice :: (db ~ Postgresql, ExpressionOf db r hstore HStore, ExpressionOf db r keys (Array Text)) => hstore -> keys -> Expr db r HStore

-- | Get hstore as a json value
--   
--   <pre>
--   hstore_to_json('"a key"=&gt;1, b=&gt;t, c=&gt;null, d=&gt;12345, e=&gt;012345, f=&gt;1.234, g=&gt;2.345e+4') 
--    == {"a key": "1", "b": "t", "c": null, "d": "12345", "e": "012345", "f": "1.234", "g": "2.345e+4"}
--   </pre>
hstore_to_json :: (db ~ Postgresql, ExpressionOf db r hstore HStore) => hstore -> Expr db r Value

-- | Get hstore as a json value, but attempting to distinguish numerical
--   and Boolean values so they are unquoted in the JSON
--   
--   <pre>
--   hstore_to_json_loose('"a key"=&gt;1, b=&gt;t, c=&gt;null, d=&gt;12345, e=&gt;012345, f=&gt;1.234, g=&gt;2.345e+4')
--    == {"a key": 1, "b": true, "c": null, "d": 12345, "e": "012345", "f": 1.234, "g": 2.345e+4}
--   </pre>
hstore_to_json_loose :: (db ~ Postgresql, ExpressionOf db r hstore HStore) => hstore -> Expr db r Value

-- | Does hstore contain key? Same as postgresql operator ?.
--   
--   <pre>
--   'a=&gt;1'::hstore ? <tt>a</tt> == True
--   </pre>
exist :: (db ~ Postgresql, ExpressionOf db r hstore HStore, ExpressionOf db r key key', IsString key') => hstore -> key -> Cond db r

-- | Does hstore contain non-NULL value for key?
--   
--   <pre>
--   defined('a=&gt;NULL',<tt>a</tt>) == f
--   </pre>
defined :: (db ~ Postgresql, ExpressionOf db r hstore HStore, ExpressionOf db r key key', IsString key') => hstore -> key -> Cond db r

-- | Does hstore contain all specified keys?
--   
--   <pre>
--   'a=&gt;1,b=&gt;2'::hstore ?&amp; ARRAY[<tt>a</tt>,<tt>b</tt>] == True
--   </pre>
(?&) :: (db ~ Postgresql, ExpressionOf db r hstore HStore, ExpressionOf db r keys (Array Text)) => hstore -> keys -> Cond db r

-- | Does hstore contain any of the specified keys?
--   
--   <pre>
--   'a=&gt;1,b=&gt;2'::hstore ?| ARRAY[<tt>b</tt>,<tt>c</tt>] == True
--   </pre>
(?|) :: (db ~ Postgresql, ExpressionOf db r hstore HStore, ExpressionOf db r keys (Array Text)) => hstore -> keys -> Cond db r

-- | Does left operand contain right?
--   
--   <tt>'a=&gt;b, b=&gt;1, c=&gt;NULL'::hstore </tt>&gt; 'b=&gt;1' ==
--   True@
(@>) :: (db ~ Postgresql, ExpressionOf db r hstore1 HStore, ExpressionOf db r hstore2 HStore) => hstore1 -> hstore2 -> Cond db r

-- | Is left operand contained in right?
--   
--   <tt>'a=&gt;c'::hstore &lt;</tt> 'a=&gt;b, b=&gt;1, c=&gt;NULL' ==
--   False@
(<@) :: (db ~ Postgresql, ExpressionOf db r hstore1 HStore, ExpressionOf db r hstore2 HStore) => hstore1 -> hstore2 -> Cond db r
instance GHC.Show.Show Database.Groundhog.Postgresql.HStore.HStore
instance GHC.Classes.Ord Database.Groundhog.Postgresql.HStore.HStore
instance GHC.Classes.Eq Database.Groundhog.Postgresql.HStore.HStore
instance Database.Groundhog.Core.PersistField Database.Groundhog.Postgresql.HStore.HStore
instance Database.Groundhog.Core.PrimitivePersistField Database.Groundhog.Postgresql.HStore.HStore
