Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type PGArray = SqlArray
- type PGRange = SqlRange
- data SqlBool
- data SqlInt4
- data SqlFloat8
- data SqlNumeric
- data SqlInt8
- data SqlInt2
- data SqlFloat4
- data SqlDate
- data SqlTime
- data SqlTimestamp
- data SqlTimestamptz
- data SqlInterval
- data SqlJson
- data SqlJsonb
- data SqlText
- data SqlVarcharN
- data SqlCitext
- type SqlArray = SqlArray_ NonNullable
- data SqlArray_ (n :: Nullability) a
- data SqlRange a
- data SqlUuid
- data SqlBytea
- class IsSqlType pgType => IsRangeType pgType where
- showRangeType :: proxy pgType -> String
- type PGText = SqlText
- type PGBytea = SqlBytea
- type PGNumeric = SqlNumeric
- type PGInt4 = SqlInt4
- type PGInt8 = SqlInt8
- type PGFloat8 = SqlFloat8
- type PGBool = SqlBool
- type PGUuid = SqlUuid
- type PGDate = SqlDate
- type PGTimestamptz = SqlTimestamptz
- type PGTimestamp = SqlTimestamp
- type PGTime = SqlTime
- type PGInterval = SqlInterval
- type PGCitext = SqlCitext
- type PGJson = SqlJson
- type PGJsonb = SqlJsonb
- type PGFloat4 = SqlFloat4
- type PGInt2 = SqlInt2
- sqlInterval :: CalendarDiffTime -> Field PGInterval
- sqlStringVarcharN :: String -> Field SqlVarcharN
- sqlStrictTextVarcharN :: Text -> Field SqlVarcharN
- sqlLazyTextVarcharN :: Text -> Field SqlVarcharN
- pgBool :: Bool -> Field PGBool
- pgDouble :: Double -> Field PGFloat8
- pgInt4 :: Int -> Field PGInt4
- pgInt8 :: Int64 -> Field PGInt8
- pgNumeric :: Scientific -> Field PGNumeric
- pgString :: String -> Field PGText
- pgCiLazyText :: CI Text -> Field PGCitext
- pgLazyByteString :: ByteString -> Field PGBytea
- pgStrictByteString :: ByteString -> Field PGBytea
- pgStrictText :: Text -> Field PGText
- pgLazyText :: Text -> Field PGText
- pgUUID :: UUID -> Field PGUuid
- pgDay :: Day -> Field PGDate
- pgUTCTime :: UTCTime -> Field PGTimestamptz
- pgLocalTime :: LocalTime -> Field PGTimestamp
- pgZonedTime :: ZonedTime -> Field PGTimestamptz
- pgTimeOfDay :: TimeOfDay -> Field PGTime
- pgCiStrictText :: CI Text -> Field PGCitext
- pgJSON :: String -> Field PGJson
- pgStrictJSON :: ByteString -> Field PGJson
- pgLazyJSON :: ByteString -> Field PGJson
- pgValueJSON :: ToJSON a => a -> Field PGJson
- pgJSONB :: String -> Field PGJsonb
- pgStrictJSONB :: ByteString -> Field PGJsonb
- pgLazyJSONB :: ByteString -> Field PGJsonb
- pgValueJSONB :: ToJSON a => a -> Field PGJsonb
- pgArray :: forall a b n. IsSqlType b => (a -> Field_ n b) -> [a] -> Field (SqlArray_ n b)
- pgRange :: forall a b n n'. IsRangeType b => (a -> Field_ n b) -> RangeBound a -> RangeBound a -> Field_ n' (SqlRange b)
- class IsSqlType sqlType where
- showSqlType :: proxy sqlType -> String
Documentation
Instances
IsSqlType SqlBool Source # | |
Defined in Opaleye.Internal.PGTypesExternal showSqlType :: proxy SqlBool -> String Source # | |
SqlOrd SqlBool Source # | |
Defined in Opaleye.Order | |
DefaultFromField SqlBool Bool Source # | |
Defined in Opaleye.Internal.RunQuery | |
Default ToFields Bool (Field SqlBool) Source # | |
bool ~ Bool => Default (Inferrable FromField) SqlBool bool Source # | |
Defined in Opaleye.Internal.Inferrable def :: Inferrable FromField SqlBool bool # |
Instances
SqlIntegral SqlInt4 Source # | |
Defined in Opaleye.Internal.PGTypesExternal | |
SqlNum SqlInt4 Source # | |
Defined in Opaleye.Internal.PGTypesExternal | |
IsSqlType SqlInt4 Source # | |
Defined in Opaleye.Internal.PGTypesExternal showSqlType :: proxy SqlInt4 -> String Source # | |
IsRangeType SqlInt4 Source # | |
Defined in Opaleye.Internal.PGTypesExternal showRangeType :: proxy SqlInt4 -> String Source # | |
SqlJsonIndex SqlInt4 Source # | |
Defined in Opaleye.Operators | |
SqlOrd SqlInt4 Source # | |
Defined in Opaleye.Order | |
DefaultFromField SqlInt4 Int32 Source # | |
Defined in Opaleye.Internal.RunQuery | |
DefaultFromField SqlInt4 Int Source # | |
Defined in Opaleye.Internal.RunQuery | |
Default ToFields Int32 (Field SqlInt4) Source # | |
Default ToFields Int (Field SqlInt4) Source # | |
Default ToFields (PGRange Int) (Field (SqlRange SqlInt4)) Source # | |
int ~ Int => Default (Inferrable FromField) SqlInt4 int Source # | |
Defined in Opaleye.Internal.Inferrable def :: Inferrable FromField SqlInt4 int # |
Instances
SqlFractional SqlFloat8 Source # | |
Defined in Opaleye.Internal.PGTypesExternal | |
SqlNum SqlFloat8 Source # | |
Defined in Opaleye.Internal.PGTypesExternal | |
IsSqlType SqlFloat8 Source # | |
Defined in Opaleye.Internal.PGTypesExternal showSqlType :: proxy SqlFloat8 -> String Source # | |
SqlOrd SqlFloat8 Source # | |
Defined in Opaleye.Order | |
DefaultFromField SqlFloat8 Double Source # | |
Defined in Opaleye.Internal.RunQuery | |
Default ToFields Double (Field SqlFloat8) Source # | |
double ~ Double => Default (Inferrable FromField) SqlFloat8 double Source # | |
Defined in Opaleye.Internal.Inferrable def :: Inferrable FromField SqlFloat8 double # |
data SqlNumeric Source #
Instances
Instances
SqlIntegral SqlInt8 Source # | |
Defined in Opaleye.Internal.PGTypesExternal | |
SqlNum SqlInt8 Source # | |
Defined in Opaleye.Internal.PGTypesExternal | |
IsSqlType SqlInt8 Source # | |
Defined in Opaleye.Internal.PGTypesExternal showSqlType :: proxy SqlInt8 -> String Source # | |
IsRangeType SqlInt8 Source # | |
Defined in Opaleye.Internal.PGTypesExternal showRangeType :: proxy SqlInt8 -> String Source # | |
SqlJsonIndex SqlInt8 Source # | |
Defined in Opaleye.Operators | |
SqlOrd SqlInt8 Source # | |
Defined in Opaleye.Order | |
DefaultFromField SqlInt8 Int64 Source # | |
Defined in Opaleye.Internal.RunQuery | |
Default ToFields Int64 (Field SqlInt8) Source # | |
Default ToFields (PGRange Int64) (Field (SqlRange SqlInt8)) Source # | |
int64 ~ Int64 => Default (Inferrable FromField) SqlInt8 int64 Source # | |
Defined in Opaleye.Internal.Inferrable def :: Inferrable FromField SqlInt8 int64 # |
Instances
SqlIntegral SqlInt2 Source # | |
Defined in Opaleye.Internal.PGTypesExternal | |
IsSqlType SqlInt2 Source # | |
Defined in Opaleye.Internal.PGTypesExternal showSqlType :: proxy SqlInt2 -> String Source # | |
SqlOrd SqlInt2 Source # | |
Defined in Opaleye.Order |
Instances
IsSqlType SqlFloat4 Source # | |
Defined in Opaleye.Internal.PGTypesExternal showSqlType :: proxy SqlFloat4 -> String Source # | |
SqlOrd SqlFloat4 Source # | |
Defined in Opaleye.Order |
Instances
IsSqlType SqlDate Source # | |
Defined in Opaleye.Internal.PGTypesExternal showSqlType :: proxy SqlDate -> String Source # | |
IsRangeType SqlDate Source # | |
Defined in Opaleye.Internal.PGTypesExternal showRangeType :: proxy SqlDate -> String Source # | |
SqlOrd SqlDate Source # | |
Defined in Opaleye.Order | |
DefaultFromField SqlDate Day Source # | |
Defined in Opaleye.Internal.RunQuery | |
IntervalNum SqlDate SqlTimestamp Source # | |
Defined in Opaleye.Operators | |
Default ToFields Day (Field SqlDate) Source # | |
Default ToFields (PGRange Day) (Field (SqlRange SqlDate)) Source # | |
day ~ Day => Default (Inferrable FromField) SqlDate day Source # | |
Defined in Opaleye.Internal.Inferrable def :: Inferrable FromField SqlDate day # |
Instances
IsSqlType SqlTime Source # | |
Defined in Opaleye.Internal.PGTypesExternal showSqlType :: proxy SqlTime -> String Source # | |
SqlOrd SqlTime Source # | |
Defined in Opaleye.Order | |
DefaultFromField SqlTime TimeOfDay Source # | |
Defined in Opaleye.Internal.RunQuery | |
IntervalNum SqlTime SqlTime Source # | |
Defined in Opaleye.Operators | |
Default ToFields TimeOfDay (Field SqlTime) Source # | |
timeofday ~ TimeOfDay => Default (Inferrable FromField) SqlTime timeofday Source # | |
Defined in Opaleye.Internal.Inferrable def :: Inferrable FromField SqlTime timeofday # |
data SqlTimestamp Source #
Instances
IsSqlType SqlTimestamp Source # | |
Defined in Opaleye.Internal.PGTypesExternal showSqlType :: proxy SqlTimestamp -> String Source # | |
IsRangeType SqlTimestamp Source # | |
Defined in Opaleye.Internal.PGTypesExternal showRangeType :: proxy SqlTimestamp -> String Source # | |
SqlOrd SqlTimestamp Source # | |
Defined in Opaleye.Order | |
DefaultFromField SqlTimestamp LocalTime Source # | |
Defined in Opaleye.Internal.RunQuery | |
IntervalNum SqlDate SqlTimestamp Source # | |
Defined in Opaleye.Operators | |
IntervalNum SqlTimestamp SqlTimestamp Source # | |
Defined in Opaleye.Operators | |
Default ToFields LocalTime (Field SqlTimestamp) Source # | |
Defined in Opaleye.Internal.Constant | |
Default ToFields (PGRange LocalTime) (Field (SqlRange SqlTimestamp)) Source # | |
Defined in Opaleye.Internal.Constant | |
localtime ~ LocalTime => Default (Inferrable FromField) SqlTimestamp localtime Source # | |
Defined in Opaleye.Internal.Inferrable def :: Inferrable FromField SqlTimestamp localtime # |
data SqlTimestamptz Source #
Be careful if you use Haskell's ZonedTime
with
SqlTimestamptz
. A Postgres timestamptz
does not actually
contain any time zone. It is just a UTC time that is automatically
converted to or from local time on certain occasions, according to
the timezone setting of the
server.
Therefore, although when you roundtrip an input ZonedTime
to
obtain an output ZonedTime
they each refer to the same
instant in time, the time zone attached to the output will not
necessarily the same as the time zone attached to the input.
Instances
IsSqlType SqlTimestamptz Source # | |
Defined in Opaleye.Internal.PGTypesExternal showSqlType :: proxy SqlTimestamptz -> String Source # | |
IsRangeType SqlTimestamptz Source # | |
Defined in Opaleye.Internal.PGTypesExternal showRangeType :: proxy SqlTimestamptz -> String Source # | |
SqlOrd SqlTimestamptz Source # | |
Defined in Opaleye.Order | |
DefaultFromField SqlTimestamptz UTCTime Source # | |
Defined in Opaleye.Internal.RunQuery | |
DefaultFromField SqlTimestamptz ZonedTime Source # | |
Defined in Opaleye.Internal.RunQuery | |
IntervalNum SqlTimestamptz SqlTimestamptz Source # | |
Defined in Opaleye.Operators | |
Default ToFields UTCTime (Field SqlTimestamptz) Source # | |
Defined in Opaleye.Internal.Constant | |
Default ToFields ZonedTime (Field SqlTimestamptz) Source # | |
Defined in Opaleye.Internal.Constant | |
Default ToFields (PGRange UTCTime) (Field (SqlRange SqlTimestamptz)) Source # | |
Defined in Opaleye.Internal.Constant |
data SqlInterval Source #
Requires you to configure intervalstyle
as iso_8601
.
You can configure intervalstyle
on every connection with a SET
command,
but for better performance you may want to configure it permanently in the
file found with SHOW config_file;
.
Instances
IsSqlType SqlInterval Source # | |
Defined in Opaleye.Internal.PGTypesExternal showSqlType :: proxy SqlInterval -> String Source # | |
DefaultFromField SqlInterval CalendarDiffTime Source # | |
IntervalNum SqlInterval SqlInterval Source # | |
Defined in Opaleye.Operators | |
Default ToFields CalendarDiffTime (Field SqlInterval) Source # | |
Defined in Opaleye.Internal.Constant | |
calendardifftime ~ CalendarDiffTime => Default (Inferrable FromField) SqlInterval calendardifftime Source # | |
Defined in Opaleye.Internal.Inferrable def :: Inferrable FromField SqlInterval calendardifftime # |
Instances
Instances
Instances
SqlString SqlText Source # | |
Defined in Opaleye.Internal.PGTypesExternal | |
IsSqlType SqlText Source # | |
Defined in Opaleye.Internal.PGTypesExternal showSqlType :: proxy SqlText -> String Source # | |
SqlJsonIndex SqlText Source # | |
Defined in Opaleye.Operators | |
SqlOrd SqlText Source # | |
Defined in Opaleye.Order | |
DefaultFromField SqlText Text Source # | |
Defined in Opaleye.Internal.RunQuery | |
DefaultFromField SqlText Text Source # | |
Defined in Opaleye.Internal.RunQuery | |
DefaultFromField SqlText String Source # | |
Defined in Opaleye.Internal.RunQuery | |
Default ToFields Text (Field SqlText) Source # | |
Default ToFields Text (Field SqlText) Source # | |
Default ToFields String (Field SqlText) Source # | |
text ~ Text => Default (Inferrable FromField) SqlText text Source # | |
Defined in Opaleye.Internal.Inferrable def :: Inferrable FromField SqlText text # |
data SqlVarcharN Source #
VARCHAR(n)
for any n
. Opaleye does not do anything to check
that the n
you choose is correctly adhered to!
Instances
Instances
SqlString SqlCitext Source # | |
Defined in Opaleye.Internal.PGTypesExternal | |
IsSqlType SqlCitext Source # | |
Defined in Opaleye.Internal.PGTypesExternal showSqlType :: proxy SqlCitext -> String Source # | |
SqlOrd SqlCitext Source # | |
Defined in Opaleye.Order | |
DefaultFromField SqlCitext (CI Text) Source # | |
Defined in Opaleye.Internal.RunQuery | |
DefaultFromField SqlCitext (CI Text) Source # | |
Defined in Opaleye.Internal.RunQuery | |
Default ToFields (CI Text) (Field SqlCitext) Source # | |
Default ToFields (CI Text) (Field SqlCitext) Source # | |
cttext ~ CI Text => Default (Inferrable FromField) SqlCitext cttext Source # | |
Defined in Opaleye.Internal.Inferrable def :: Inferrable FromField SqlCitext cttext # |
type SqlArray = SqlArray_ NonNullable Source #
data SqlArray_ (n :: Nullability) a Source #
Instances
(Default ToFields a (Field_ n b), IsSqlType b) => Default ToFields [a] (Field (SqlArray_ n b)) Source # | |
(Typeable h, Default (Inferrable FromField) f h, hs ~ [h]) => Default (Inferrable FromField) (SqlArray f) hs Source # | |
Defined in Opaleye.Internal.Inferrable def :: Inferrable FromField (SqlArray f) hs # | |
(Typeable h, Default (Inferrable FromField) f h, hs ~ [Maybe h]) => Default (Inferrable FromField) (SqlArray_ 'Nullable f) hs Source # | |
Defined in Opaleye.Internal.Inferrable | |
IsSqlType a => IsSqlType (SqlArray_ n a) Source # | |
Defined in Opaleye.Internal.PGTypesExternal showSqlType :: proxy (SqlArray_ n a) -> String Source # | |
(Typeable b, DefaultFromField a b) => DefaultFromField (SqlArray_ 'NonNullable a) [b] Source # | |
Defined in Opaleye.Internal.RunQuery defaultFromField :: FromField (SqlArray_ 'NonNullable a) [b] Source # | |
(Typeable b, DefaultFromField a b) => DefaultFromField (SqlArray_ 'Nullable a) [Maybe b] Source # | |
Defined in Opaleye.Internal.RunQuery |
Instances
Default ToFields (PGRange Int64) (Field (SqlRange SqlInt8)) Source # | |
Default ToFields (PGRange Scientific) (Field (SqlRange SqlNumeric)) Source # | |
Defined in Opaleye.Internal.Constant def :: ToFields (PGRange Scientific) (Field (SqlRange SqlNumeric)) # | |
Default ToFields (PGRange Day) (Field (SqlRange SqlDate)) Source # | |
Default ToFields (PGRange UTCTime) (Field (SqlRange SqlTimestamptz)) Source # | |
Defined in Opaleye.Internal.Constant | |
Default ToFields (PGRange LocalTime) (Field (SqlRange SqlTimestamp)) Source # | |
Defined in Opaleye.Internal.Constant | |
Default ToFields (PGRange Int) (Field (SqlRange SqlInt4)) Source # | |
IsRangeType a => IsSqlType (SqlRange a) Source # | |
Defined in Opaleye.Internal.PGTypesExternal showSqlType :: proxy (SqlRange a) -> String Source # | |
(Typeable b, DefaultFromField a b) => DefaultFromField (SqlRange a) (PGRange b) Source # | |
Defined in Opaleye.Internal.RunQuery |
Instances
IsSqlType SqlUuid Source # | |
Defined in Opaleye.Internal.PGTypesExternal showSqlType :: proxy SqlUuid -> String Source # | |
SqlOrd SqlUuid Source # | |
Defined in Opaleye.Order | |
DefaultFromField SqlUuid UUID Source # | |
Defined in Opaleye.Internal.RunQuery | |
Default ToFields UUID (Field SqlUuid) Source # | |
uuid ~ UUID => Default (Inferrable FromField) SqlUuid uuid Source # | |
Defined in Opaleye.Internal.Inferrable def :: Inferrable FromField SqlUuid uuid # |
Instances
IsSqlType SqlBytea Source # | |
Defined in Opaleye.Internal.PGTypesExternal showSqlType :: proxy SqlBytea -> String Source # | |
DefaultFromField SqlBytea ByteString Source # | |
Defined in Opaleye.Internal.RunQuery | |
DefaultFromField SqlBytea ByteString Source # | |
Defined in Opaleye.Internal.RunQuery | |
Default ToFields ByteString (Field SqlBytea) Source # | |
Defined in Opaleye.Internal.Constant | |
Default ToFields ByteString (Field SqlBytea) Source # | |
Defined in Opaleye.Internal.Constant | |
bytestring ~ ByteString => Default (Inferrable FromField) SqlBytea bytestring Source # | |
Defined in Opaleye.Internal.Inferrable def :: Inferrable FromField SqlBytea bytestring # |
class IsSqlType pgType => IsRangeType pgType where Source #
showRangeType :: proxy pgType -> String Source #
Instances
IsRangeType SqlDate Source # | |
Defined in Opaleye.Internal.PGTypesExternal showRangeType :: proxy SqlDate -> String Source # | |
IsRangeType SqlInt4 Source # | |
Defined in Opaleye.Internal.PGTypesExternal showRangeType :: proxy SqlInt4 -> String Source # | |
IsRangeType SqlInt8 Source # | |
Defined in Opaleye.Internal.PGTypesExternal showRangeType :: proxy SqlInt8 -> String Source # | |
IsRangeType SqlNumeric Source # | |
Defined in Opaleye.Internal.PGTypesExternal showRangeType :: proxy SqlNumeric -> String Source # | |
IsRangeType SqlTimestamp Source # | |
Defined in Opaleye.Internal.PGTypesExternal showRangeType :: proxy SqlTimestamp -> String Source # | |
IsRangeType SqlTimestamptz Source # | |
Defined in Opaleye.Internal.PGTypesExternal showRangeType :: proxy SqlTimestamptz -> String Source # |
type PGNumeric = SqlNumeric Source #
type PGTimestamptz = SqlTimestamptz Source #
type PGTimestamp = SqlTimestamp Source #
type PGInterval = SqlInterval Source #
pgLocalTime :: LocalTime -> Field PGTimestamp Source #
pgStrictJSON :: ByteString -> Field PGJson Source #
pgLazyJSON :: ByteString -> Field PGJson Source #
pgStrictJSONB :: ByteString -> Field PGJsonb Source #
pgLazyJSONB :: ByteString -> Field PGJsonb Source #
pgRange :: forall a b n n'. IsRangeType b => (a -> Field_ n b) -> RangeBound a -> RangeBound a -> Field_ n' (SqlRange b) Source #
class IsSqlType sqlType where Source #
showSqlType :: proxy sqlType -> String Source #