Safe Haskell | None |
---|---|
Language | Haskell2010 |
Postgres SQL Types
Combinators and helpers for dealing with Postgres types such as strings, numerals, geography and geometry, etc.
Synopsis
- newtype Identifier = Identifier {
- getIdenTxt :: Text
- class IsIdentifier a where
- toIdentifier :: a -> Identifier
- pgFmtIdentifier :: Text -> Text
- pgFmtLit :: Text -> Text
- trimNullChars :: Text -> Text
- newtype TableName = TableName {
- getTableTxt :: Text
- data TableType
- isView :: TableType -> Bool
- newtype ConstraintName = ConstraintName {
- getConstraintTxt :: Text
- newtype FunctionName = FunctionName {
- getFunctionTxt :: Text
- newtype SchemaName = SchemaName {
- getSchemaTxt :: Text
- publicSchema :: SchemaName
- hdbCatalogSchema :: SchemaName
- data QualifiedObject a = QualifiedObject {
- qSchema :: SchemaName
- qName :: a
- qualifiedObjectToText :: ToTxt a => QualifiedObject a -> Text
- snakeCaseQualifiedObject :: ToTxt a => QualifiedObject a -> Text
- getIdentifierQualifiedObject :: ToTxt a => QualifiedObject a -> Either QErr GQLNameIdentifier
- namingConventionSupport :: SupportedNamingCase
- qualifiedObjectToName :: (ToTxt a, MonadError QErr m) => QualifiedObject a -> m Name
- type QualifiedTable = QualifiedObject TableName
- type QualifiedFunction = QualifiedObject FunctionName
- newtype PGDescription = PGDescription {
- getPGDescription :: Text
- newtype PGCol = PGCol {
- getPGColTxt :: Text
- unsafePGCol :: Text -> PGCol
- showPGCols :: (Foldable t, Functor t) => t PGCol -> Text
- data PGScalarType
- = PGSmallInt
- | PGInteger
- | PGBigInt
- | PGSerial
- | PGBigSerial
- | PGFloat
- | PGDouble
- | PGNumeric
- | PGMoney
- | PGBoolean
- | PGChar
- | PGVarchar
- | PGText
- | PGCitext
- | PGDate
- | PGTimeStamp
- | PGTimeStampTZ
- | PGTimeTZ
- | PGJSON
- | PGJSONB
- | PGGeometry
- | PGGeography
- | PGRaster
- | PGUUID
- | PGLtree
- | PGLquery
- | PGLtxtquery
- | PGArray PGScalarType
- | PGUnknown Text
- | PGCompositeScalar Text
- | PGEnumScalar Text
- pgScalarTypeToText :: PGScalarType -> Text
- textToPGScalarType :: Text -> PGScalarType
- pgScalarTranslations :: [(Text, PGScalarType)]
- isNumType :: PGScalarType -> Bool
- stringTypes :: [PGScalarType]
- isStringType :: PGScalarType -> Bool
- jsonTypes :: [PGScalarType]
- isJSONType :: PGScalarType -> Bool
- isComparableType :: PGScalarType -> Bool
- isBigNum :: PGScalarType -> Bool
- geoTypes :: [PGScalarType]
- isGeoType :: PGScalarType -> Bool
- data PGTypeKind
- data QualifiedPGType = QualifiedPGType {}
- isBaseType :: QualifiedPGType -> Bool
- typeToTable :: QualifiedPGType -> QualifiedTable
- mkFunctionArgScalarType :: QualifiedPGType -> PGScalarType
- data PGRawFunctionInfo = PGRawFunctionInfo {
- rfiOid :: OID
- rfiHasVariadic :: Bool
- rfiFunctionType :: FunctionVolatility
- rfiReturnTypeSchema :: SchemaName
- rfiReturnTypeName :: PGScalarType
- rfiReturnTypeType :: PGTypeKind
- rfiReturnsSet :: Bool
- rfiInputArgTypes :: [QualifiedPGType]
- rfiInputArgNames :: [FunctionArgName]
- rfiDefaultArgs :: Int
- rfiReturnsTable :: Bool
- rfiDescription :: Maybe PGDescription
- mkScalarTypeName :: MonadError QErr m => PGScalarType -> m Name
- pgTypeOid :: PGScalarType -> Oid
Documentation
newtype Identifier Source #
Identifier | |
|
Instances
class IsIdentifier a where Source #
toIdentifier :: a -> Identifier Source #
Instances
pgFmtIdentifier :: Text -> Text Source #
trimNullChars :: Text -> Text Source #
TableName | |
|
Instances
newtype ConstraintName Source #
ConstraintName | |
|
Instances
newtype FunctionName Source #
FunctionName | |
|
Instances
newtype SchemaName Source #
SchemaName | |
|
Instances
data QualifiedObject a Source #
QualifiedObject | |
|
Instances
qualifiedObjectToText :: ToTxt a => QualifiedObject a -> Text Source #
snakeCaseQualifiedObject :: ToTxt a => QualifiedObject a -> Text Source #
getIdentifierQualifiedObject :: ToTxt a => QualifiedObject a -> Either QErr GQLNameIdentifier Source #
qualifiedObjectToName :: (ToTxt a, MonadError QErr m) => QualifiedObject a -> m Name Source #
type QualifiedTable = QualifiedObject TableName Source #
Represents a database table qualified with the schema name.
newtype PGDescription Source #
PGDescription | |
|
Instances
PGCol | |
|
Instances
unsafePGCol :: Text -> PGCol Source #
data PGScalarType Source #
Instances
pgScalarTypeToText :: PGScalarType -> Text Source #
textToPGScalarType :: Text -> PGScalarType Source #
pgScalarTranslations :: [(Text, PGScalarType)] Source #
isNumType :: PGScalarType -> Bool Source #
stringTypes :: [PGScalarType] Source #
isStringType :: PGScalarType -> Bool Source #
jsonTypes :: [PGScalarType] Source #
isJSONType :: PGScalarType -> Bool Source #
isComparableType :: PGScalarType -> Bool Source #
isBigNum :: PGScalarType -> Bool Source #
geoTypes :: [PGScalarType] Source #
isGeoType :: PGScalarType -> Bool Source #
data PGTypeKind Source #
Instances
data QualifiedPGType Source #
Instances
isBaseType :: QualifiedPGType -> Bool Source #
data PGRawFunctionInfo Source #
Metadata describing SQL functions at the DB level, i.e. below the GraphQL layer.
Instances
mkScalarTypeName :: MonadError QErr m => PGScalarType -> m Name Source #
pgTypeOid :: PGScalarType -> Oid Source #