| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Hmssql.SqlValue
Description
A value of any SQL Server type, for code that handles columns and parameters whose types are only known at runtime: serving any table, copying rows between tables, a REPL.
Decoding: SqlValue is a FromSqlField that accepts
any column (sqlValueDecoder), and SqlRow a whole row
with its columns (sqlRowDecoder,
sqlRowDecoderFor); queryMulti and
callProcedure return every result set as SqlRows. A
sql_variant decodes as its base type.
Encoding: SqlValue is a ToSqlField sent as the type
its constructor names, so SELECT @p1 gives the same value back;
SqlNull is an nvarchar(max) NULL, which the server converts to most
types but not to binary or sql_variant.
Synopsis
- data SqlValue
- = SqlNull
- | SqlBool !Bool
- | SqlWord8 !Word8
- | SqlInt16 !Int16
- | SqlInt32 !Int32
- | SqlInt64 !Int64
- | SqlFloat !Float
- | SqlDouble !Double
- | SqlDecimal !Decimal
- | SqlMoney !Money
- | SqlGuid !UUID
- | SqlDateTime !LocalTime
- | SqlDate !Day
- | SqlTime !TimeOfDay
- | SqlDateTimeOffset !DateTimeOffset
- | SqlText !Text
- | SqlBinary !ByteString
- | SqlXml !Text
- data SqlRow = SqlRow {
- sqlRowColumns :: ![ColumnInfo]
- sqlRowValues :: ![SqlValue]
Documentation
One constructor per family of SQL Server types.
Constructors
| SqlNull | |
| SqlBool !Bool | bit |
| SqlWord8 !Word8 |
|
| SqlInt16 !Int16 | smallint |
| SqlInt32 !Int32 | int |
| SqlInt64 !Int64 | bigint |
| SqlFloat !Float | real |
| SqlDouble !Double | float |
| SqlDecimal !Decimal |
|
| SqlMoney !Money |
|
| SqlGuid !UUID | uniqueidentifier |
| SqlDateTime !LocalTime |
|
| SqlDate !Day | date |
| SqlTime !TimeOfDay | time |
| SqlDateTimeOffset !DateTimeOffset | datetimeoffset |
| SqlText !Text | The character types: |
| SqlBinary !ByteString |
|
| SqlXml !Text | xml |
Instances
| Show SqlValue Source # | |
| Eq SqlValue Source # | |
| FromSqlField SqlValue Source # | |
Defined in Hmssql.Decoding Methods fieldDecoder :: FieldDecoder SqlValue Source # fieldRowDecoder :: RowDecoder SqlValue Source # nullableRowDecoder :: RowDecoder (Maybe SqlValue) rowDecoderWith :: Nulls SqlValue b -> RowDecoder b | |
| ToSqlField SqlValue Source # | Each constructor is sent as the wire type |
Defined in Hmssql.Encoding Methods fieldEncoder :: FieldEncoder SqlValue Source # fieldParam :: SqlValue -> FieldParams -> FieldParams | |
A row of SqlValues with the columns they came from.
Constructors
| SqlRow | |
Fields
| |