-- 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.10 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. castType value "INT" results in -- value::INT. castType :: (Expression Postgresql r a, PersistField a) => a -> String -> Expr Postgresql r a -- | Distinct only on certain fields or expressions. For example, -- select $ CondEmpty distinctOn (lower EmailField, -- IpField). 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 -- http://www.postgresql.org/docs/9.2/static/arrays.html and -- http://www.postgresql.org/docs/9.2/static/functions-array.html 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, PersistField elem) => 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], ~^~) = 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', ~^~) = {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] @> 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] <@ 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] && 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 -- --
-- box '((0,0),(1,1))' + point '(2.0,0)' = box '(3,1),(2,0)' --(+.) :: (SqlDb db, Plus a b, ExpressionOf db r x a, ExpressionOf db r y b) => x -> y -> Expr db r a infixl 6 +. -- | Translation -- --
-- box '((0,0),(1,1))' - point '(2.0,0)' = box '(-1,1),(-2,0)' --(-.) :: (SqlDb db, BoxCirclePathPoint a, ExpressionOf db r x a, ExpressionOf db r y Point) => x -> y -> Expr db r a infixl 6 -. -- | Scaling/rotation -- --
-- box '((0,0),(1,1))' * point '(2.0,0)' = box '(2,2),(0,0)' --(*.) :: (SqlDb db, BoxCirclePathPoint a, ExpressionOf db r x a, ExpressionOf db r y Point) => x -> y -> Expr db r a infixl 7 *. -- | Scaling/rotation -- --
-- box '((0,0),(2,2))' / point '(2.0,0)' = box '(1,1),(0,0)' --(/.) :: (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 -- --
-- lseg '((1,-1),(-1,1))' # '((1,1),(-1,-1))' = point '(0,0)' ---- --
-- box '((1,-1),(-1,1))' # '((1,1),(-1,-1))' = box '(1,1),(-1,-1)' --(#) :: (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 -- --
-- point '(0,0)' ## lseg '((2,0),(0,2))' = point '(1,1)' --(##) :: (SqlDb db, Closest a b, ExpressionOf db r x a, ExpressionOf db r y b) => x -> y -> Expr db r Point -- | Distance between -- --
-- circle '((0,0),1)' - circle '((5,0),1)' = 3 --(<->) :: (SqlDb db, Distance a b, ExpressionOf db r x a, ExpressionOf db r y b) => x -> y -> Expr db r Double -- | Overlaps? -- --
-- box '((0,0),(1,1))' && box '((0,0),(2,2))' = true --(&&) :: (SqlDb db, BoxCirclePolygon a, ExpressionOf db r x a, ExpressionOf db r y a) => x -> y -> Cond db r -- | Is strictly left of? -- --
-- circle '((0,0),1)' << circle '((5,0),1)' = true --(<<) :: (SqlDb db, BoxCirclePointPolygon a, ExpressionOf db r x a, ExpressionOf db r y a) => x -> y -> Cond db r -- | Is strictly right of? -- --
-- circle '((5,0),1)' >> circle '((0,0),1)' = true --(>>) :: (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))' &< 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? -- --
-- box '((0,0),(3,3))' &> box '((0,0),(2,2))' = true --(&>) :: (SqlDb db, BoxCirclePolygon a, ExpressionOf db r x a, ExpressionOf db r y a) => x -> y -> Cond db r -- | Is strictly below? -- --
-- box '((0,0),(3,3))' <<| box '((3,4),(5,5))' = true --(<<|) :: (SqlDb db, BoxCirclePolygon a, ExpressionOf db r x a, ExpressionOf db r y a) => x -> y -> Cond db r -- | Is strictly above? -- --
-- box '((3,4),(5,5))' |>> box '((0,0),(3,3))' --(|>>) :: (SqlDb db, BoxCirclePolygon a, ExpressionOf db r x a, ExpressionOf db r y a) => x -> y -> Cond db r -- | Does not extend above? -- --
-- box '((0,0),(1,1))' &<| box '((0,0),(2,2))' = true --(&<|) :: (SqlDb db, BoxCirclePolygon a, ExpressionOf db r x a, ExpressionOf db r y a) => x -> y -> Cond db r -- | Does not extend below? -- --
-- box '((0,0),(3,3))' |&> box '((0,0),(2,2))' = true --(|&>) :: (SqlDb db, BoxCirclePolygon a, ExpressionOf db r x a, ExpressionOf db r y a) => x -> y -> Cond db r -- | Is below (allows touching)? -- --
-- circle '((0,0),1)' <^ circle '((0,5),1)' = true --(<^) :: (SqlDb db, BoxPoint a, ExpressionOf db r x a, ExpressionOf db r y a) => x -> y -> Cond db r -- | Is above (allows touching)? -- --
-- circle '((0,5),1)' >^ circle '((0,0),1)' = true --(>^) :: (SqlDb db, BoxPoint a, ExpressionOf db r x a, ExpressionOf db r y a) => x -> y -> Cond db r -- | Intersects? -- --
-- lseg '((-1,0),(1,0))' ?# box '((-2,-2),(2,2))' = true --(?#) :: (SqlDb db, Intersects a b, ExpressionOf db r x a, ExpressionOf db r y b) => x -> y -> Cond db r -- | Are horizontally aligned? -- --
-- point '(1,0)' ?- point '(0,0)' = true --(?-) :: (SqlDb db, ExpressionOf db r x Point, ExpressionOf db r y Point) => x -> y -> Cond db r -- | Are vertically aligned? -- --
-- point '(0,1)' ?| point '(0,0)' = true --(?|) :: (SqlDb db, ExpressionOf db r x Point, ExpressionOf db r y Point) => x -> y -> Cond db r -- | Is perpendicular? -- --
-- lseg '((0,0),(0,1))' ?-| lseg '((0,0),(1,0))' = true --(?-|) :: (SqlDb db, LineLseg a, ExpressionOf db r x a, ExpressionOf db r y a) => x -> y -> Cond db r -- | Are parallel? -- --
-- lseg '((-1,0),(1,0))' ?|| lseg '((-1,2),(1,2))' = true --(?||) :: (SqlDb db, LineLseg a, ExpressionOf db r x a, ExpressionOf db r y a) => x -> y -> Cond db r -- | Contains? -- --
-- circle '((0,0),2)' @> point '(1,1)' = true --(@>) :: (SqlDb db, Contains a b, ExpressionOf db r x a, ExpressionOf db r y b) => x -> y -> Cond db r -- | Contained in or on? -- --
-- point '(1,1)' <@ circle '((0,0),2)' = true --(<@) :: (SqlDb db, Contained a b, ExpressionOf db r x a, ExpressionOf db r y b) => x -> y -> Cond db r -- | Same as? -- --
-- polygon '((0,0),(1,1))' ~= polygon '((1,1),(0,0))' = true --(~=) :: (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 -- http://www.postgresql.org/docs/9.3/static/hstore.html module Database.Groundhog.Postgresql.HStore newtype HStore HStore :: Map Text Text -> HStore -- | Get value for key (NULL if not present) -- --
-- 'a=>x, b=>y'::hstore -> a == x --(->.) :: (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) -- --
-- 'a=>x, b=>y, c=>z'::hstore == ARRAY[c,a] {"z","x"}
--
lookupArr :: (db ~ Postgresql, ExpressionOf db r hstore HStore, ExpressionOf db r keys (Array Text)) => hstore -> keys -> Expr db r (Array Text)
-- | Concatenate hstores
--
-- -- 'a=>b, c=>d'::hstore || 'c=>x, d=>q'::hstore == "a"=>"b", "c"=>"x", "d"=>"q" --hstoreConcat :: (db ~ Postgresql, ExpressionOf db r hstore1 HStore, ExpressionOf db r hstore2 HStore) => hstore1 -> hstore2 -> Expr db r HStore -- | Delete key from left operand -- --
-- 'a=>1, b=>2, c=>3'::hstore - b::text == "a"=>"1", "c"=>"3" --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 -- --
-- 'a=>1, b=>2, c=>3'::hstore - ARRAY[a,b] == "c"=>"3" --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 -- --
-- 'a=>1, b=>2, c=>3'::hstore - 'a=>4, b=>2'::hstore == "a"=>"1", "c"=>"3" --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 %%. -- --
-- hstore_to_array('a=>1,b=>2') == {a,1,b,2}
--
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 %#.
--
--
-- hstore_to_matrix('a=>1,b=>2') == {{a,1},{b,2}}
--
hstore_to_matrix :: (db ~ Postgresql, ExpressionOf db r hstore HStore) => hstore -> Expr db r (Array (Array Text))
-- | Get hstore's keys as an array
--
--
-- akeys('a=>1,b=>2') == {a,b}
--
akeys :: (db ~ Postgresql, ExpressionOf db r hstore HStore) => hstore -> Expr db r (Array Text)
-- | Get hstore's values as an array
--
--
-- avals('a=>1,b=>2') == {1,2}
--
avals :: (db ~ Postgresql, ExpressionOf db r hstore HStore) => hstore -> Expr db r (Array Text)
-- | Extract a subset of an hstore
--
--
-- slice('a=>1,b=>2,c=>3'::hstore, ARRAY[b,c,x]) =="b"=>"2", "c"=>"3"
--
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
--
--
-- hstore_to_json('"a key"=>1, b=>t, c=>null, d=>12345, e=>012345, f=>1.234, g=>2.345e+4')
-- == {"a key": "1", "b": "t", "c": null, "d": "12345", "e": "012345", "f": "1.234", "g": "2.345e+4"}
--
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
--
--
-- hstore_to_json_loose('"a key"=>1, b=>t, c=>null, d=>12345, e=>012345, f=>1.234, g=>2.345e+4')
-- == {"a key": 1, "b": true, "c": null, "d": 12345, "e": "012345", "f": 1.234, "g": 2.345e+4}
--
hstore_to_json_loose :: (db ~ Postgresql, ExpressionOf db r hstore HStore) => hstore -> Expr db r Value
-- | Does hstore contain key? Same as postgresql operator ?.
--
-- -- 'a=>1'::hstore ? a == True --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? -- --
-- defined('a=>NULL',a) == f
--
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?
--
-- -- 'a=>1,b=>2'::hstore ?& ARRAY[a,b] == True --(?&) :: (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? -- --
-- 'a=>1,b=>2'::hstore ?| ARRAY[b,c] == True --(?|) :: (db ~ Postgresql, ExpressionOf db r hstore HStore, ExpressionOf db r keys (Array Text)) => hstore -> keys -> Cond db r -- | Does left operand contain right? -- -- 'a=>b, b=>1, c=>NULL'::hstore > 'b=>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? -- -- 'a=>c'::hstore < 'a=>b, b=>1, c=>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