postgresql-typed-0.6.1.1: PostgreSQL interface with compile-time SQL type checking, optional HDBC backend

Copyright2015 Dylan Simon
Safe HaskellNone
LanguageHaskell2010

Database.PostgreSQL.Typed.Inet

Contents

Description

Representaion of PostgreSQL's inet/cidr types using Network.Socket. We don't (yet) supply PGColumn (parsing) instances.

Synopsis

Documentation

data PGInet Source #

Instances
Eq PGInet Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Inet

Methods

(==) :: PGInet -> PGInet -> Bool #

(/=) :: PGInet -> PGInet -> Bool #

Read PGInet Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Inet

Show PGInet Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Inet

PGColumn "cidr" PGInet Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Inet

Methods

pgDecode :: PGTypeID "cidr" -> PGTextValue -> PGInet Source #

pgDecodeBinary :: PGTypeEnv -> PGTypeID "cidr" -> PGBinaryValue -> PGInet Source #

pgDecodeValue :: PGTypeEnv -> PGTypeID "cidr" -> PGValue -> PGInet Source #

PGColumn "inet" PGInet Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Inet

Methods

pgDecode :: PGTypeID "inet" -> PGTextValue -> PGInet Source #

pgDecodeBinary :: PGTypeEnv -> PGTypeID "inet" -> PGBinaryValue -> PGInet Source #

pgDecodeValue :: PGTypeEnv -> PGTypeID "inet" -> PGValue -> PGInet Source #

PGParameter "cidr" PGInet Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Inet

Methods

pgEncode :: PGTypeID "cidr" -> PGInet -> PGTextValue Source #

pgLiteral :: PGTypeID "cidr" -> PGInet -> ByteString Source #

pgEncodeValue :: PGTypeEnv -> PGTypeID "cidr" -> PGInet -> PGValue Source #

PGParameter "inet" PGInet Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Inet

Methods

pgEncode :: PGTypeID "inet" -> PGInet -> PGTextValue Source #

pgLiteral :: PGTypeID "inet" -> PGInet -> ByteString Source #

pgEncodeValue :: PGTypeEnv -> PGTypeID "inet" -> PGInet -> PGValue Source #

bton32 :: (Word8, Word8, Word8, Word8) -> Word32 Source #

Convert four bytes to network byte order, using unsafe casting. byteSwap32 would be better, but I couldn't find a good way to determine host byte order.

Orphan instances

PGType "cidr" Source # 
Instance details

Associated Types

type PGVal "cidr" :: Type Source #

PGType "inet" Source # 
Instance details

Associated Types

type PGVal "inet" :: Type Source #