beam-core-0.9.0.0: Type-safe, feature-complete SQL query and manipulation interface for Haskell

Safe HaskellNone
LanguageHaskell2010

Database.Beam.Query.DataTypes

Contents

Synopsis

Documentation

newtype DataType be a Source #

A data type in a given IsSql92DataTypeSyntax which describes a SQL type mapping to the Haskell type a

Instances
Eq (BeamSqlBackendCastTargetSyntax be) => Eq (DataType be a) Source # 
Instance details

Defined in Database.Beam.Query.DataTypes

Methods

(==) :: DataType be a -> DataType be a -> Bool #

(/=) :: DataType be a -> DataType be a -> Bool #

Sql92DisplaySyntax (BeamSqlBackendCastTargetSyntax be) => Show (DataType be a) Source # 
Instance details

Defined in Database.Beam.Query.DataTypes

Methods

showsPrec :: Int -> DataType be a -> ShowS #

show :: DataType be a -> String #

showList :: [DataType be a] -> ShowS #

cast_ :: BeamSqlBackend be => QGenExpr ctxt be s a -> DataType be b -> QGenExpr ctxt be s b Source #

Cast a value to a specific data type, specified using DataType.

Note: this may fail at run-time if the cast is invalid for a particular value

Data types

int :: (BeamSqlBackend be, Integral a) => DataType be a Source #

SQL92 INTEGER data type

smallint :: (BeamSqlBackend be, Integral a) => DataType be a Source #

SQL92 SMALLINT data type

bigint :: (BeamSqlBackend be, BeamSqlT071Backend be, Integral a) => DataType be a Source #

SQL2008 Optional BIGINT data type

binary :: (BeamSqlBackend be, BeamSqlT021Backend be) => Maybe Word -> DataType be Integer Source #

SQL2003 Optional BINARY data type

varbinary :: (BeamSqlBackend be, BeamSqlT021Backend be) => Maybe Word -> DataType be Integer Source #

SQL2003 Optional VARBINARY data type

date :: BeamSqlBackend be => DataType be Day Source #

SQL92 DATE data type

char :: BeamSqlBackend be => Maybe Word -> DataType be Text Source #

SQL92 CHAR data type

varchar :: BeamSqlBackend be => Maybe Word -> DataType be Text Source #

SQL92 VARCHAR data type

nationalVarchar :: BeamSqlBackend be => Maybe Word -> DataType be Text Source #

SQL92 NATIONAL CHARACTER VARYING data type

nationalChar :: BeamSqlBackend be => Maybe Word -> DataType be Text Source #

SQL92 NATIONAL CHARACTER data type

double :: BeamSqlBackend be => DataType be Double Source #

SQL92 DOUBLE data type

numeric :: BeamSqlBackend be => Maybe (Word, Maybe Word) -> DataType be Scientific Source #

SQL92 NUMERIC data type

timestamptz :: BeamSqlBackend be => DataType be LocalTime Source #

SQL92 TIMESTAMP WITH TIME ZONE data type

timestamp :: BeamSqlBackend be => DataType be LocalTime Source #

SQL92 TIMESTAMP WITHOUT TIME ZONE data type

time :: BeamSqlBackend be => Maybe Word -> DataType be TimeOfDay Source #

SQL92 TIME data type

boolean :: BeamSql99DataTypeBackend be => DataType be Bool Source #

SQL99 BOOLEAN data type

array :: (Typeable a, BeamSql99DataTypeBackend be) => DataType be a -> Int -> DataType be (Vector a) Source #

SQL99 array data types

maybeType :: DataType be a -> DataType be (Maybe a) Source #

Haskell requires DataTypes to match exactly. Use this function to convert a DataType that expects a concrete value to one expecting a Maybe