groundhog-postgresql-0.4.2.2: PostgreSQL backend for the groundhog library.

Safe HaskellNone

Database.Groundhog.Postgresql.Array

Description

See detailed documentation for PostgreSQL arrays at http:www.postgresql.orgdocs9.2staticarrays.html and http:www.postgresql.orgdocs9.2staticfunctions-array.html

Synopsis

Documentation

newtype Array a Source

Represents PostgreSQL arrays

Constructors

Array [a] 

Instances

Eq a => Eq (Array a) 
Show a => Show (Array a) 
(ArrayElem a, PersistField a) => PersistField (Array a) 
(ArrayElem a, PersistField a) => PrimitivePersistField (Array a) 

append :: (ExpressionOf Postgresql r a (Array elem), ExpressionOf Postgresql r b elem) => a -> b -> Expr Postgresql r (Array elem)Source

prepend :: (ExpressionOf Postgresql r a elem, ExpressionOf Postgresql r b (Array elem)) => a -> b -> Expr Postgresql r (Array elem)Source

arrayCat :: (ExpressionOf Postgresql r a (Array elem), ExpressionOf Postgresql r b (Array elem)) => a -> b -> Expr Postgresql r (Array elem)Source

arrayToString :: ExpressionOf Postgresql r a (Array elem) => a -> String -> Expr Postgresql r StringSource

Concatenates array elements using supplied delimiter. array_to_string(ARRAY[1, 2, 3], ~^~) = 1~^~2~^~3

stringToArray :: ExpressionOf Postgresql r a String => a -> String -> Expr Postgresql r (Array String)Source

Splits string into array elements using supplied delimiter. string_to_array('xx~^~yy~^~zz', ~^~) = {xx,yy,zz}

any :: (ExpressionOf Postgresql r a elem, ExpressionOf Postgresql r b (Array elem)) => a -> b -> Cond Postgresql rSource

all :: (ExpressionOf Postgresql r a elem, ExpressionOf Postgresql r b (Array elem)) => a -> b -> Cond Postgresql rSource

(@>) :: (ExpressionOf Postgresql r a (Array elem), ExpressionOf Postgresql r b (Array elem)) => a -> b -> Cond Postgresql rSource

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 rSource

Is contained by. ARRAY[2,7] <@ ARRAY[1,7,4,2,6] = t

overlaps :: (ExpressionOf Postgresql r a (Array elem), ExpressionOf Postgresql r b (Array elem)) => a -> b -> Cond Postgresql rSource

Overlap (have elements in common). ARRAY[1,4,3] && ARRAY[2,1] = t