Safe Haskell | Safe-Inferred |
---|---|
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
- newtype TableIdentifier = TableIdentifier {}
- tableIdentifierToIdentifier :: TableIdentifier -> Identifier
- identifierToTableIdentifier :: Identifier -> TableIdentifier
- newtype ColumnIdentifier = ColumnIdentifier {}
- pgFmtIdentifier :: Text -> Text
- pgFmtLit :: Text -> Text
- newtype TableName = TableName {
- getTableTxt :: Text
- isView :: TableType -> Bool
- newtype ConstraintName = ConstraintName {}
- newtype FunctionName = FunctionName {}
- 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 {}
- data PGCol
- 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
- 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
- data PGExtraTableMetadata = PGExtraTableMetadata {}
Documentation
newtype Identifier Source #
Instances
class IsIdentifier a where Source #
toIdentifier :: a -> Identifier Source #
Instances
newtype TableIdentifier Source #
The type of identifiers representing tabular values.
While we are transitioning away from Identifier
we provisionally export
the value constructor.
Instances
tableIdentifierToIdentifier :: TableIdentifier -> Identifier Source #
Temporary conversion function, to be removed once Identifier
has been
entirely split into TableIdentifier
and ColumnIdentifier
.
identifierToTableIdentifier :: Identifier -> TableIdentifier Source #
Temporary conversion function, to be removed once Identifier
has been
entirely split into TableIdentifier
and ColumnIdentifier
.
newtype ColumnIdentifier Source #
The type of identifiers representing scalar values
Instances
pgFmtIdentifier :: Text -> Text Source #
Instances
newtype ConstraintName Source #
Instances
newtype FunctionName Source #
Instances
newtype SchemaName Source #
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 #
Instances
Instances
unsafePGCol :: Text -> PGCol Source #
data PGScalarType Source #
Instances
pgScalarTranslations :: [(Text, PGScalarType)] Source #
isNumType :: PGScalarType -> Bool Source #
stringTypes :: [PGScalarType] Source #
isStringType :: PGScalarType -> Bool 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 #
data PGExtraTableMetadata Source #