HDBC-2.4.0.4: Haskell Database Connectivity

Copyright | Copyright (C) 2006-2011 John Goerzen
License | BSD3
Maintainer | John Goerzen <jgoerzen@complete.org>
Stability | provisional
Portability | portable
Safe Haskell | Safe-Inferred
Language | Haskell2010

Database.HDBC.ColTypes

Description

Definitions of, and utilities for, specifying what type of data is represented by a column.

Written by John Goerzen, jgoerzen@complete.org

Synopsis

- data SqlColDesc = SqlColDesc {
  - colType :: SqlTypeId
  - colSize :: Maybe Int
  - colOctetLength :: Maybe Int
  - colDecDigits :: Maybe Int
  - colNullable :: Maybe Bool
  }
- data SqlTypeId
  - = SqlCharT
  - | SqlVarCharT
  - | SqlLongVarCharT
  - | SqlWCharT
  - | SqlWVarCharT
  - | SqlWLongVarCharT
  - | SqlDecimalT
  - | SqlNumericT
  - | SqlSmallIntT
  - | SqlIntegerT
  - | SqlRealT
  - | SqlFloatT
  - | SqlDoubleT
  - | SqlBitT
  - | SqlTinyIntT
  - | SqlBigIntT
  - | SqlBinaryT
  - | SqlVarBinaryT
  - | SqlLongVarBinaryT
  - | SqlDateT
  - | SqlTimeT
  - | SqlTimeWithZoneT
  - | SqlTimestampT
  - | SqlTimestampWithZoneT
  - | SqlUTCDateTimeT
  - | SqlUTCTimeT
  - | SqlIntervalT SqlInterval
  - | SqlGUIDT
  - | SqlUnknownT String
- data SqlInterval
  - = SqlIntervalMonthT
  - | SqlIntervalYearT
  - | SqlIntervalYearToMonthT
  - | SqlIntervalDayT
  - | SqlIntervalHourT
  - | SqlIntervalMinuteT
  - | SqlIntervalSecondT
  - | SqlIntervalDayToHourT
  - | SqlIntervalDayToMinuteT
  - | SqlIntervalDayToSecondT
  - | SqlIntervalHourToMinuteT
  - | SqlIntervalHourToSecondT
  - | SqlIntervalMinuteToSecondT

# Documentation

data SqlColDesc Source #

The description of a column.

Fields are Nothing if the database backend cannot supply the requested information.

The colSize field works like this:

For character types, the maximum width of the column. For numeric types, the total number of digits allowed. See the ODBC manual for more.

The colOctetLength field is defined for character and binary types, and gives the number of bytes the column requires, regardless of encoding.

Constructors

SqlColDesc |

Fields

- colType :: SqlTypeId

  Type of data stored here

- colSize :: Maybe Int

  The size of a column

- colOctetLength :: Maybe Int

  The maximum size in octets

- colDecDigits :: Maybe Int

  Digits to the right of the period

- colNullable :: Maybe Bool

  Whether NULL is acceptable

#### Instances

Instances details

Read SqlColDesc Source # |
Instance details Defined in Database.HDBC.ColTypes Methods readsPrec :: Int -> ReadS SqlColDesc Source # readList :: ReadS [SqlColDesc] Source # readPrec :: ReadPrec SqlColDesc Source # readListPrec :: ReadPrec [SqlColDesc] Source #
Show SqlColDesc Source # |
Instance details Defined in Database.HDBC.ColTypes Methods showsPrec :: Int -> SqlColDesc -> ShowS Source # show :: SqlColDesc -> String Source # showList :: [SqlColDesc] -> ShowS Source #
Eq SqlColDesc Source # |
Instance details Defined in Database.HDBC.ColTypes Methods (==) :: SqlColDesc -> SqlColDesc -> Bool Source # (/=) :: SqlColDesc -> SqlColDesc -> Bool Source #

data SqlTypeId Source #

The type identifier for a given column.

This represents the type of data stored in the column in the underlying SQL engine. It does not form the entire column type; see `SqlColDesc` for that.

These types correspond mainly to those defined by ODBC.

Constructors

SqlCharT | Fixed-width character strings
SqlVarCharT | Variable-width character strings
SqlLongVarCharT | Variable-width character strings, max length implementation dependant
SqlWCharT | Fixed-width Unicode strings
SqlWVarCharT | Variable-width Unicode strings
SqlWLongVarCharT | Variable-width Unicode strings, max length implementation dependant
SqlDecimalT | Signed exact values
SqlNumericT | Signed exact integer values
SqlSmallIntT | 16-bit integer values
SqlIntegerT | 32-bit integer values
SqlRealT |
SqlFloatT | Signed inexact floating-point values
SqlDoubleT | Signed inexact double-precision values
SqlBitT | A single bit
SqlTinyIntT | 8-bit integer values
SqlBigIntT | 64-bit integer values
SqlBinaryT | Fixed-length binary data
SqlVarBinaryT | Variable-length binary data
SqlLongVarBinaryT | Variable-length binary data, max length implementation dependant
SqlDateT | A date
SqlTimeT | A time, no timezone
SqlTimeWithZoneT | A time, with timezone
SqlTimestampT | Combined date and time, no timezone
SqlTimestampWithZoneT | Combined date and time, with timezone
SqlUTCDateTimeT | UTC date/time
SqlUTCTimeT | UTC time
SqlIntervalT SqlInterval | A time or date difference
SqlGUIDT | Global unique identifier
SqlUnknownT String | A type not represented here; implementation-specific information in the String

#### Instances

Instances details

Read SqlTypeId Source # |
Instance details Defined in Database.HDBC.ColTypes Methods readsPrec :: Int -> ReadS SqlTypeId Source # readList :: ReadS [SqlTypeId] Source # readPrec :: ReadPrec SqlTypeId Source # readListPrec :: ReadPrec [SqlTypeId] Source #
Show SqlTypeId Source # |
Instance details Defined in Database.HDBC.ColTypes Methods showsPrec :: Int -> SqlTypeId -> ShowS Source # show :: SqlTypeId -> String Source # showList :: [SqlTypeId] -> ShowS Source #
Eq SqlTypeId Source # |
Instance details Defined in Database.HDBC.ColTypes Methods (==) :: SqlTypeId -> SqlTypeId -> Bool Source # (/=) :: SqlTypeId -> SqlTypeId -> Bool Source #

data SqlInterval Source #

The different types of intervals in SQL.

Constructors

SqlIntervalMonthT | Difference in months
SqlIntervalYearT | Difference in years
SqlIntervalYearToMonthT | Difference in years+months
SqlIntervalDayT | Difference in days
SqlIntervalHourT | Difference in hours
SqlIntervalMinuteT | Difference in minutes
SqlIntervalSecondT | Difference in seconds
SqlIntervalDayToHourT | Difference in days+hours
SqlIntervalDayToMinuteT | Difference in days+minutes
SqlIntervalDayToSecondT | Difference in days+seconds
SqlIntervalHourToMinuteT | Difference in hours+minutes
SqlIntervalHourToSecondT | Difference in hours+seconds
SqlIntervalMinuteToSecondT | Difference in minutes+seconds

#### Instances

Instances details

Read SqlInterval Source # |
Instance details Defined in Database.HDBC.ColTypes Methods readsPrec :: Int -> ReadS SqlInterval Source # readList :: ReadS [SqlInterval] Source # readPrec :: ReadPrec SqlInterval Source # readListPrec :: ReadPrec [SqlInterval] Source #
Show SqlInterval Source # |
Instance details Defined in Database.HDBC.ColTypes Methods showsPrec :: Int -> SqlInterval -> ShowS Source # show :: SqlInterval -> String Source # showList :: [SqlInterval] -> ShowS Source #
Eq SqlInterval Source # |
Instance details Defined in Database.HDBC.ColTypes Methods (==) :: SqlInterval -> SqlInterval -> Bool Source # (/=) :: SqlInterval -> SqlInterval -> Bool Source #