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

Copyright2015 Dylan Simon
Safe HaskellNone
LanguageHaskell98

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 #

Instances

Eq PGInet # 

Methods

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

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

Read PGInet # 
Show PGInet # 
PGColumn "cidr" PGInet # 

Methods

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

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

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

PGColumn "inet" PGInet # 

Methods

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

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

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

PGParameter "cidr" PGInet # 

Methods

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

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

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

PGParameter "inet" PGInet # 

Methods

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

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

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

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

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

Associated Types

type PGVal ("cidr" :: Symbol) :: * #

Methods

pgTypeName :: PGTypeID "cidr" -> PGName #

pgBinaryColumn :: PGTypeEnv -> PGTypeID "cidr" -> Bool #

PGType "inet" # 

Associated Types

type PGVal ("inet" :: Symbol) :: * #

Methods

pgTypeName :: PGTypeID "inet" -> PGName #

pgBinaryColumn :: PGTypeEnv -> PGTypeID "inet" -> Bool #