hpgsql
Safe HaskellNone
LanguageHaskell2010

Hpgsql.TypeInfo

Description

This file has is very similar to a similarly named file from the great postgresql-simple library, more specifically to https://hackage.haskell.org/package/postgresql-simple-0.7.0.0/docs/src/Database.PostgreSQL.Simple.TypeInfo.Static.html We started with that and later came up with our own from scratch, though. We thank them for their great work.

Synopsis

Documentation

newtype EncodingContext Source #

Constructors

EncodingContext 

Fields

  • typeInfoCache :: TypeInfoCache

    A map with all builtin PostgreSQL types plus user-defined types, unless you specify custom connection options.

newtype Oid Source #

Constructors

Oid Int32 

Instances

Instances details
Enum Oid Source # 
Instance details

Defined in Hpgsql.TypeInfo

Methods

succ :: Oid -> Oid #

pred :: Oid -> Oid #

toEnum :: Int -> Oid #

fromEnum :: Oid -> Int #

enumFrom :: Oid -> [Oid] #

enumFromThen :: Oid -> Oid -> [Oid] #

enumFromTo :: Oid -> Oid -> [Oid] #

enumFromThenTo :: Oid -> Oid -> Oid -> [Oid] #

Num Oid Source # 
Instance details

Defined in Hpgsql.TypeInfo

Methods

(+) :: Oid -> Oid -> Oid #

(-) :: Oid -> Oid -> Oid #

(*) :: Oid -> Oid -> Oid #

negate :: Oid -> Oid #

abs :: Oid -> Oid #

signum :: Oid -> Oid #

fromInteger :: Integer -> Oid #

Integral Oid Source # 
Instance details

Defined in Hpgsql.TypeInfo

Methods

quot :: Oid -> Oid -> Oid #

rem :: Oid -> Oid -> Oid #

div :: Oid -> Oid -> Oid #

mod :: Oid -> Oid -> Oid #

quotRem :: Oid -> Oid -> (Oid, Oid) #

divMod :: Oid -> Oid -> (Oid, Oid) #

toInteger :: Oid -> Integer #

Real Oid Source # 
Instance details

Defined in Hpgsql.TypeInfo

Methods

toRational :: Oid -> Rational #

Show Oid Source # 
Instance details

Defined in Hpgsql.TypeInfo

Methods

showsPrec :: Int -> Oid -> ShowS #

show :: Oid -> String #

showList :: [Oid] -> ShowS #

Eq Oid Source # 
Instance details

Defined in Hpgsql.TypeInfo

Methods

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

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

Ord Oid Source # 
Instance details

Defined in Hpgsql.TypeInfo

Methods

compare :: Oid -> Oid -> Ordering #

(<) :: Oid -> Oid -> Bool #

(<=) :: Oid -> Oid -> Bool #

(>) :: Oid -> Oid -> Bool #

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

max :: Oid -> Oid -> Oid #

min :: Oid -> Oid -> Oid #

FromPgField Oid Source # 
Instance details

Defined in Hpgsql.Encoding

ToPgField Oid Source # 
Instance details

Defined in Hpgsql.Encoding

data TypeInfo Source #

Constructors

TypeInfo 

Fields

newtype ArrayTypeDetails Source #

Constructors

ArrayTypeDetails 

Fields

builtinPgTypesMap :: TypeInfoCache Source #

This contains every type that is builtin to PostgreSQL alongside some info about them. User defined types are not available here, but are accessible in EncodingContext in many places where it might be useful.

buildTypeInfoCache :: [TypeInfo] -> TypeInfoCache Source #

lookupTypeByName :: Text -> TypeInfoCache -> Maybe TypeInfo Source #

lookupTypeByOid :: Oid -> TypeInfoCache -> Maybe TypeInfo Source #