postgresql-typed-0.6.2.5: PostgreSQL interface with compile-time SQL type checking, optional HDBC backend
Copyright2015 Dylan Simon
Safe HaskellSafe-Inferred
LanguageHaskell2010

Database.PostgreSQL.Typed.Inet

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

Instances details
Read PGInet Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Inet

Show PGInet Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Inet

Eq PGInet Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Inet

Methods

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

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

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" Source #

PGType "inet" Source # 
Instance details

Associated Types

type PGVal "inet" Source #