opaleye-0.9.6.1: An SQL-generating DSL targeting PostgreSQL
Safe HaskellSafe-Inferred
LanguageHaskell2010

Opaleye.SqlTypes

Description

SQL types and functions to create Field_s of those types. To create fields you may find it more convenient to use Opaleye.ToFields instead.

Synopsis

Numeric

Creating values

Types

data SqlInt4 Source #

Instances

Instances details
SqlIntegral SqlInt4 Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

SqlNum SqlInt4 Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

IsSqlType SqlInt4 Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy SqlInt4 -> String Source #

IsRangeType SqlInt4 Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showRangeType :: proxy SqlInt4 -> String Source #

SqlJsonIndex SqlInt4 Source # 
Instance details

Defined in Opaleye.Operators

SqlOrd SqlInt4 Source # 
Instance details

Defined in Opaleye.Order

DefaultFromField SqlInt4 Int32 Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

DefaultFromField SqlInt4 Int Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

Default ToFields Int32 (Field SqlInt4) Source # 
Instance details

Defined in Opaleye.Internal.Constant

Default ToFields Int (Field SqlInt4) Source # 
Instance details

Defined in Opaleye.Internal.Constant

Default ToFields (PGRange Int) (Field (SqlRange SqlInt4)) Source # 
Instance details

Defined in Opaleye.Internal.Constant

int ~ Int => Default (Inferrable FromField) SqlInt4 int Source # 
Instance details

Defined in Opaleye.Internal.Inferrable

data SqlInt2 Source #

Instances

Instances details
SqlIntegral SqlInt2 Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

IsSqlType SqlInt2 Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy SqlInt2 -> String Source #

SqlOrd SqlInt2 Source # 
Instance details

Defined in Opaleye.Order

data SqlFloat4 Source #

Instances

Instances details
IsSqlType SqlFloat4 Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy SqlFloat4 -> String Source #

SqlOrd SqlFloat4 Source # 
Instance details

Defined in Opaleye.Order

Type classes

class SqlIntegral a Source #

A dummy typeclass whose instances support integral operations.

Instances

Instances details
SqlIntegral SqlInt2 Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

SqlIntegral SqlInt4 Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

SqlIntegral SqlInt8 Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

SqlIntegral SqlNumeric Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

class SqlFractional a Source #

Minimal complete definition

sqlFromRational

Date and time

Creating values

Types

data SqlDate Source #

Instances

Instances details
IsSqlType SqlDate Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy SqlDate -> String Source #

IsRangeType SqlDate Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showRangeType :: proxy SqlDate -> String Source #

SqlOrd SqlDate Source # 
Instance details

Defined in Opaleye.Order

DefaultFromField SqlDate Day Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

IntervalNum SqlDate SqlTimestamp Source # 
Instance details

Defined in Opaleye.Operators

Default ToFields Day (Field SqlDate) Source # 
Instance details

Defined in Opaleye.Internal.Constant

Default ToFields (PGRange Day) (Field (SqlRange SqlDate)) Source # 
Instance details

Defined in Opaleye.Internal.Constant

day ~ Day => Default (Inferrable FromField) SqlDate day Source # 
Instance details

Defined in Opaleye.Internal.Inferrable

data SqlTime Source #

Instances

Instances details
IsSqlType SqlTime Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy SqlTime -> String Source #

SqlOrd SqlTime Source # 
Instance details

Defined in Opaleye.Order

DefaultFromField SqlTime TimeOfDay Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

IntervalNum SqlTime SqlTime Source # 
Instance details

Defined in Opaleye.Operators

Default ToFields TimeOfDay (Field SqlTime) Source # 
Instance details

Defined in Opaleye.Internal.Constant

timeofday ~ TimeOfDay => Default (Inferrable FromField) SqlTime timeofday Source # 
Instance details

Defined in Opaleye.Internal.Inferrable

Methods

def :: Inferrable FromField SqlTime timeofday #

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.

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;.

JSON

Creating values

Types

data SqlJson Source #

Instances

Instances details
IsSqlType SqlJson Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy SqlJson -> String Source #

SqlIsJson SqlJson Source # 
Instance details

Defined in Opaleye.Operators

DefaultFromField SqlJson Value Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

DefaultFromField SqlJson ByteString Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

DefaultFromField SqlJson ByteString Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

DefaultFromField SqlJson Text Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

DefaultFromField SqlJson Text Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

DefaultFromField SqlJson String Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

Default ToFields Value (Field SqlJson) Source # 
Instance details

Defined in Opaleye.Internal.Constant

Default ToFields ByteString (Field SqlJson) Source # 
Instance details

Defined in Opaleye.Internal.Constant

Default ToFields ByteString (Field SqlJson) Source # 
Instance details

Defined in Opaleye.Internal.Constant

(FromJSON a, Typeable a) => DefaultFromField SqlJson (Aeson a) Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

ToJSON a => Default ToFields (Aeson a) (Field SqlJson) Source # 
Instance details

Defined in Opaleye.Internal.Constant

Methods

def :: ToFields (Aeson a) (Field SqlJson) #

JSONB

Creating values

Types

data SqlJsonb Source #

Instances

Instances details
IsSqlType SqlJsonb Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy SqlJsonb -> String Source #

SqlIsJson SqlJsonb Source # 
Instance details

Defined in Opaleye.Operators

DefaultFromField SqlJsonb Value Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

DefaultFromField SqlJsonb ByteString Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

DefaultFromField SqlJsonb ByteString Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

DefaultFromField SqlJsonb Text Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

DefaultFromField SqlJsonb Text Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

DefaultFromField SqlJsonb String Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

Default ToFields Value (Field SqlJsonb) Source # 
Instance details

Defined in Opaleye.Internal.Constant

Default ToFields ByteString (Field SqlJsonb) Source # 
Instance details

Defined in Opaleye.Internal.Constant

Default ToFields ByteString (Field SqlJsonb) Source # 
Instance details

Defined in Opaleye.Internal.Constant

(FromJSON a, Typeable a) => DefaultFromField SqlJsonb (Aeson a) Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

ToJSON a => Default ToFields (Aeson a) (Field SqlJsonb) Source # 
Instance details

Defined in Opaleye.Internal.Constant

Methods

def :: ToFields (Aeson a) (Field SqlJsonb) #

Text

Creating values

Types

data SqlText Source #

Instances

Instances details
SqlString SqlText Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

IsSqlType SqlText Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy SqlText -> String Source #

SqlJsonIndex SqlText Source # 
Instance details

Defined in Opaleye.Operators

SqlOrd SqlText Source # 
Instance details

Defined in Opaleye.Order

DefaultFromField SqlText Text Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

DefaultFromField SqlText Text Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

DefaultFromField SqlText String Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

Default ToFields Text (Field SqlText) Source # 
Instance details

Defined in Opaleye.Internal.Constant

Default ToFields Text (Field SqlText) Source # 
Instance details

Defined in Opaleye.Internal.Constant

Default ToFields String (Field SqlText) Source # 
Instance details

Defined in Opaleye.Internal.Constant

text ~ Text => Default (Inferrable FromField) SqlText text Source # 
Instance details

Defined in Opaleye.Internal.Inferrable

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 details
SqlString SqlVarcharN Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

IsSqlType SqlVarcharN Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

SqlOrd SqlVarcharN Source # 
Instance details

Defined in Opaleye.Order

DefaultFromField SqlVarcharN Text Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

DefaultFromField SqlVarcharN Text Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

DefaultFromField SqlVarcharN String Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

Default ToFields Text (Field SqlVarcharN) Source # 
Instance details

Defined in Opaleye.Internal.Constant

Default ToFields Text (Field SqlVarcharN) Source # 
Instance details

Defined in Opaleye.Internal.Constant

Default ToFields String (Field SqlVarcharN) Source # 
Instance details

Defined in Opaleye.Internal.Constant

varchar ~ Text => Default (Inferrable FromField) SqlVarcharN varchar Source # 
Instance details

Defined in Opaleye.Internal.Inferrable

Type classes

Array

Creating values

sqlArray :: IsSqlType b => (a -> Field_ n b) -> [a] -> Field (SqlArray_ n b) Source #

Types

data SqlArray_ (n :: Nullability) a Source #

Instances

Instances details
(Default ToFields a (Field_ n b), IsSqlType b) => Default ToFields [a] (Field (SqlArray_ n b)) Source # 
Instance details

Defined in Opaleye.Internal.Constant

Methods

def :: ToFields [a] (Field (SqlArray_ n b)) #

(Typeable h, Default (Inferrable FromField) f h, hs ~ [h]) => Default (Inferrable FromField) (SqlArray f) hs Source # 
Instance details

Defined in Opaleye.Internal.Inferrable

Methods

def :: Inferrable FromField (SqlArray f) hs #

(Typeable h, Default (Inferrable FromField) f h, hs ~ [Maybe h]) => Default (Inferrable FromField) (SqlArray_ 'Nullable f) hs Source # 
Instance details

Defined in Opaleye.Internal.Inferrable

IsSqlType a => IsSqlType (SqlArray_ n a) Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy (SqlArray_ n a) -> String Source #

(Typeable b, DefaultFromField a b) => DefaultFromField (SqlArray_ 'NonNullable a) [b] Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

(Typeable b, DefaultFromField a b) => DefaultFromField (SqlArray_ 'Nullable a) [Maybe b] Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

Range

Creating values

Types

data SqlRange a Source #

Instances

Instances details
Default ToFields (PGRange Int64) (Field (SqlRange SqlInt8)) Source # 
Instance details

Defined in Opaleye.Internal.Constant

Default ToFields (PGRange Scientific) (Field (SqlRange SqlNumeric)) Source # 
Instance details

Defined in Opaleye.Internal.Constant

Default ToFields (PGRange Day) (Field (SqlRange SqlDate)) Source # 
Instance details

Defined in Opaleye.Internal.Constant

Default ToFields (PGRange UTCTime) (Field (SqlRange SqlTimestamptz)) Source # 
Instance details

Defined in Opaleye.Internal.Constant

Default ToFields (PGRange LocalTime) (Field (SqlRange SqlTimestamp)) Source # 
Instance details

Defined in Opaleye.Internal.Constant

Default ToFields (PGRange Int) (Field (SqlRange SqlInt4)) Source # 
Instance details

Defined in Opaleye.Internal.Constant

IsRangeType a => IsSqlType (SqlRange a) Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy (SqlRange a) -> String Source #

(Typeable b, DefaultFromField a b) => DefaultFromField (SqlRange a) (PGRange b) Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

class IsSqlType pgType => IsRangeType pgType Source #

Minimal complete definition

showRangeType

Other

Creating values

Types

data SqlBool Source #

Instances

Instances details
IsSqlType SqlBool Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy SqlBool -> String Source #

SqlOrd SqlBool Source # 
Instance details

Defined in Opaleye.Order

DefaultFromField SqlBool Bool Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

Default ToFields Bool (Field SqlBool) Source # 
Instance details

Defined in Opaleye.Internal.Constant

bool ~ Bool => Default (Inferrable FromField) SqlBool bool Source # 
Instance details

Defined in Opaleye.Internal.Inferrable

data SqlUuid Source #

Instances

Instances details
IsSqlType SqlUuid Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy SqlUuid -> String Source #

SqlOrd SqlUuid Source # 
Instance details

Defined in Opaleye.Order

DefaultFromField SqlUuid UUID Source # 
Instance details

Defined in Opaleye.Internal.RunQuery

Default ToFields UUID (Field SqlUuid) Source # 
Instance details

Defined in Opaleye.Internal.Constant

uuid ~ UUID => Default (Inferrable FromField) SqlUuid uuid Source # 
Instance details

Defined in Opaleye.Internal.Inferrable

IsSqlType

class IsSqlType sqlType where Source #

Methods

showSqlType :: proxy sqlType -> String Source #

Instances

Instances details
IsSqlType SqlBool Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy SqlBool -> String Source #

IsSqlType SqlBytea Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy SqlBytea -> String Source #

IsSqlType SqlCitext Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy SqlCitext -> String Source #

IsSqlType SqlDate Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy SqlDate -> String Source #

IsSqlType SqlFloat4 Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy SqlFloat4 -> String Source #

IsSqlType SqlFloat8 Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy SqlFloat8 -> String Source #

IsSqlType SqlInt2 Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy SqlInt2 -> String Source #

IsSqlType SqlInt4 Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy SqlInt4 -> String Source #

IsSqlType SqlInt8 Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy SqlInt8 -> String Source #

IsSqlType SqlInterval Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

IsSqlType SqlJson Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy SqlJson -> String Source #

IsSqlType SqlJsonb Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy SqlJsonb -> String Source #

IsSqlType SqlNumeric Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy SqlNumeric -> String Source #

IsSqlType SqlText Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy SqlText -> String Source #

IsSqlType SqlTime Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy SqlTime -> String Source #

IsSqlType SqlTimestamp Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

IsSqlType SqlTimestamptz Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

IsSqlType SqlUuid Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy SqlUuid -> String Source #

IsSqlType SqlVarcharN Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

IsRangeType a => IsSqlType (SqlRange a) Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy (SqlRange a) -> String Source #

IsSqlType a => IsSqlType (SqlArray_ n a) Source # 
Instance details

Defined in Opaleye.Internal.PGTypesExternal

Methods

showSqlType :: proxy (SqlArray_ n a) -> String Source #