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

Copyright | (c) 2013 Leon P Smith
License | BSD3
Maintainer | Leon P Smith <leon@melding-monads.com>
Stability | experimental
Safe Haskell | None
Language | Haskell2010

Database.PostgreSQL.Simple.HStore

Description

Parsers and printers for hstore, a extended type bundled with PostgreSQL providing finite maps from text strings to text strings. See https://www.postgresql.org/docs/9.5/static/hstore.html for more information.

Note that in order to use this type, a database superuser must install it by running a sql script in the share directory. This can be done on PostgreSQL 9.1 and later with the command `CREATE EXTENSION hstore`. See https://www.postgresql.org/docs/9.5/static/contrib.html for more information.

Synopsis

- newtype HStoreList = HStoreList {
  - fromHStoreList :: [(Text, Text)]
  }
- newtype HStoreMap = HStoreMap {
  - fromHStoreMap :: Map Text Text
  }
- class ToHStore a where
  - toHStore :: a -> HStoreBuilder
- data HStoreBuilder
- toBuilder :: HStoreBuilder -> Builder
- toLazyByteString :: HStoreBuilder -> ByteString
- hstore :: (ToHStoreText a, ToHStoreText b) => a -> b -> HStoreBuilder
- parseHStoreList :: ByteString -> Either String HStoreList
- class ToHStoreText a where
  - toHStoreText :: a -> HStoreText
- data HStoreText

# Documentation

newtype HStoreList Source #

Constructors

HStoreList |

Fields

- fromHStoreList :: [(Text, Text)]

#### Instances

Instances details

Show HStoreList Source # |
Instance details Defined in Database.PostgreSQL.Simple.HStore.Implementation Methods showsPrec :: Int -> HStoreList -> ShowS Source # show :: HStoreList -> String Source # showList :: [HStoreList] -> ShowS Source #
FromField HStoreList Source # | hstore
Instance details Defined in Database.PostgreSQL.Simple.HStore.Implementation Methods fromField :: FieldParser HStoreList Source #
ToHStore HStoreList Source # | hstore
Instance details Defined in Database.PostgreSQL.Simple.HStore.Implementation Methods toHStore :: HStoreList -> HStoreBuilder Source #
ToField HStoreList Source # |
Instance details Defined in Database.PostgreSQL.Simple.HStore.Implementation Methods toField :: HStoreList -> Action Source #

newtype HStoreMap Source #

Constructors

HStoreMap |

Fields

- fromHStoreMap :: Map Text Text

#### Instances

Instances details

Show HStoreMap Source # |
Instance details Defined in Database.PostgreSQL.Simple.HStore.Implementation Methods showsPrec :: Int -> HStoreMap -> ShowS Source # show :: HStoreMap -> String Source # showList :: [HStoreMap] -> ShowS Source #
Eq HStoreMap Source # |
Instance details Defined in Database.PostgreSQL.Simple.HStore.Implementation Methods (==) :: HStoreMap -> HStoreMap -> Bool Source # (/=) :: HStoreMap -> HStoreMap -> Bool Source #
Ord HStoreMap Source # |

Instance details

Defined in Database.PostgreSQL.Simple.HStore.Implementation

Methods

compare :: HStoreMap -> HStoreMap -> Ordering Source #

(<) :: HStoreMap -> HStoreMap -> Bool Source #

(<=) :: HStoreMap -> HStoreMap -> Bool Source #

(>) :: HStoreMap -> HStoreMap -> Bool Source #

(>=) :: HStoreMap -> HStoreMap -> Bool Source #

max :: HStoreMap -> HStoreMap -> HStoreMap Source #

min :: HStoreMap -> HStoreMap -> HStoreMap Source #

FromField HStoreMap Source # |
Instance details Defined in Database.PostgreSQL.Simple.HStore.Implementation Methods fromField :: FieldParser HStoreMap Source #
ToHStore HStoreMap Source # |
Instance details Defined in Database.PostgreSQL.Simple.HStore.Implementation Methods toHStore :: HStoreMap -> HStoreBuilder Source #
ToField HStoreMap Source # |
Instance details Defined in Database.PostgreSQL.Simple.HStore.Implementation Methods toField :: HStoreMap -> Action Source #

class ToHStore a where Source #

Methods

toHStore :: a -> HStoreBuilder Source #

#### Instances

Instances details

ToHStore HStoreBuilder Source # |
Instance details Defined in Database.PostgreSQL.Simple.HStore.Implementation Methods toHStore :: HStoreBuilder -> HStoreBuilder Source #
ToHStore HStoreList Source # | hstore
Instance details Defined in Database.PostgreSQL.Simple.HStore.Implementation Methods toHStore :: HStoreList -> HStoreBuilder Source #
ToHStore HStoreMap Source # |
Instance details Defined in Database.PostgreSQL.Simple.HStore.Implementation Methods toHStore :: HStoreMap -> HStoreBuilder Source #

data HStoreBuilder Source #

Represents valid hstore syntax.

#### Instances

Instances details

Monoid HStoreBuilder Source # |
Instance details Defined in Database.PostgreSQL.Simple.HStore.Implementation Methods mempty :: HStoreBuilder Source # mappend :: HStoreBuilder -> HStoreBuilder -> HStoreBuilder Source # mconcat :: [HStoreBuilder] -> HStoreBuilder Source #
Semigroup HStoreBuilder Source # |
Instance details Defined in Database.PostgreSQL.Simple.HStore.Implementation Methods (<>) :: HStoreBuilder -> HStoreBuilder -> HStoreBuilder Source # sconcat :: NonEmpty HStoreBuilder -> HStoreBuilder Source # stimes :: Integral b => b -> HStoreBuilder -> HStoreBuilder Source #
ToHStore HStoreBuilder Source # |
Instance details Defined in Database.PostgreSQL.Simple.HStore.Implementation Methods toHStore :: HStoreBuilder -> HStoreBuilder Source #
ToField HStoreBuilder Source # |
Instance details Defined in Database.PostgreSQL.Simple.HStore.Implementation Methods toField :: HStoreBuilder -> Action Source #

toBuilder :: HStoreBuilder -> Builder Source #

toLazyByteString :: HStoreBuilder -> ByteString Source #

hstore :: (ToHStoreText a, ToHStoreText b) => a -> b -> HStoreBuilder Source #

parseHStoreList :: ByteString -> Either String HStoreList Source #

class ToHStoreText a where Source #

Methods

toHStoreText :: a -> HStoreText Source #

#### Instances

Instances details

ToHStoreText ByteString Source # | Assumed to be UTF-8 encoded
Instance details Defined in Database.PostgreSQL.Simple.HStore.Implementation Methods toHStoreText :: ByteString -> HStoreText Source #
ToHStoreText ByteString Source # | Assumed to be UTF-8 encoded
Instance details Defined in Database.PostgreSQL.Simple.HStore.Implementation Methods toHStoreText :: ByteString -> HStoreText Source #
ToHStoreText HStoreText Source # |
Instance details Defined in Database.PostgreSQL.Simple.HStore.Implementation Methods toHStoreText :: HStoreText -> HStoreText Source #
ToHStoreText Text Source # |
Instance details Defined in Database.PostgreSQL.Simple.HStore.Implementation Methods toHStoreText :: Text -> HStoreText Source #
ToHStoreText Text Source # |
Instance details Defined in Database.PostgreSQL.Simple.HStore.Implementation Methods toHStoreText :: Text -> HStoreText Source #

data HStoreText Source #

Represents escape text, ready to be the key or value to a hstore value

#### Instances

Instances details

Monoid HStoreText Source # |
Instance details Defined in Database.PostgreSQL.Simple.HStore.Implementation Methods mempty :: HStoreText Source # mappend :: HStoreText -> HStoreText -> HStoreText Source # mconcat :: [HStoreText] -> HStoreText Source #
Semigroup HStoreText Source # |
Instance details Defined in Database.PostgreSQL.Simple.HStore.Implementation Methods (<>) :: HStoreText -> HStoreText -> HStoreText Source # sconcat :: NonEmpty HStoreText -> HStoreText Source # stimes :: Integral b => b -> HStoreText -> HStoreText Source #
ToHStoreText HStoreText Source # |
Instance details Defined in Database.PostgreSQL.Simple.HStore.Implementation Methods toHStoreText :: HStoreText -> HStoreText Source #