HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleselda-0.5.2.1Haskell2010

Database.Selda.SqlType

Types representable as columns in Selda's subset of SQL.

  • 7 types
  • 2 classes
  • 16 values
  • Packageselda-0.5.2.1
  • Exports25
  • LanguageHaskell2010
  • LicenceMIT
  • SourceSqlType.hs
classclass Typeable a => SqlType a where
#

Any datatype representable in (Selda's subset of) SQL.

Methods

Instances19SqlType, …
classclass (Typeable a, Bounded a, Enum a) => SqlEnum a where
#

Any type that's bounded, enumerable and has a text representation, and thus representable as a Selda enumerable.

While it would be more efficient to store enumerables as integers, this makes hand-rolled SQL touching the values inscrutable, and will break if the user a) derives Enum and b) changes the order of their constructors. Long-term, this should be implemented in PostgreSQL as a proper enum anyway, which mostly renders the performance argument moot.

Methods

Instances1SqlEnum
datadata Lit a where
#

An SQL literal.

Instances3Eq, Ord, Show
  • Eq (Lit a)Defined in selda-0.5.2.1 · Database.Selda.SqlType
  • Ord (Lit a)Defined in selda-0.5.2.1 · Database.Selda.SqlType
  • Show (Lit a)Defined in selda-0.5.2.1 · Database.Selda.SqlType
datadata UUID
#

Type representing Universally Unique Identifiers (UUID) as specified in RFC 4122.

Instances14Eq, Data, Ord, Read, Show, Storable, …
  • Eq UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal
  • Data UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal
  • Ord UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal
  • Read UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal
  • Show UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal

    Pretty prints a UUID (without quotation marks). See also toString.

    Example1 expression
    show nil"00000000-0000-0000-0000-000000000000"
  • Storable UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal

    This Storable instance uses the memory layout as described in RFC 4122, but in contrast to the Binary instance, the fields are stored in host byte order.

  • NFData UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal
  • Random UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal

    This Random instance produces insecure version 4 UUIDs as specified in RFC 4122.

  • Uniform UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal
  • Binary UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal

    This Binary instance is compatible with RFC 4122, storing the fields in network order as 16 bytes.

  • Hashable UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal
  • IsUUID UUIDDefined in selda-0.5.2.1 · Database.Selda
  • SqlType UUIDDefined in selda-0.5.2.1 · Database.Selda.SqlType

    defaultValue for UUIDs is the all-zero RFC4122 nil UUID.

  • Lift UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal
newtypenewtype UUID' a
#

An UUID identifying a database row.

Instances7Eq, Ord, Show, Generic, IsUUID, SqlType, …
newtypenewtype RowID
#

A row identifier for some table. This is the type of auto-incrementing primary keys.

Instances7Eq, Ord, Show, Generic, SqlOrd, SqlType, …
newtypenewtype ID a
#

A typed row identifier. Generic tables should use this instead of RowID. Use untyped to erase the type of a row identifier, and cast from the Database.Selda.Unsafe module if you for some reason need to add a type to a row identifier.

Instances7Eq, Ord, Show, Generic, SqlOrd, SqlType, …
valueinvalidRowId :: RowID
#

A row identifier which is guaranteed to not match any row in any table.

valueisInvalidRowId :: RowID -> Bool
#

Is the given row identifier invalid? I.e. is it guaranteed to not match any row in any table?

valuetoRowId :: Int64 -> RowID
#

Create a row identifier from an integer. Use with caution, preferably only when reading user input.

valuefromId :: ID a -> Int64
#

Create a typed row identifier from an integer. Use with caution, preferably only when reading user input.

valuetoId :: Int64 -> ID a
#

Create a typed row identifier from an integer. Use with caution, preferably only when reading user input.

valueinvalidId :: ID a
#

A typed row identifier which is guaranteed to not match any row in any table.

valueisInvalidId :: ID a -> Bool
#

Is the given typed row identifier invalid? I.e. is it guaranteed to not match any row in any table?

valuesqlDateFormat :: String
#

Format string used to represent date when representing dates as text. If at all possible, use SqlDate instead.

valuesqlTimeFormat :: String
#

Format string used to represent time of day when representing time as text. If at all possible, use SqlTime instead.

valuetypedUuid :: UUID -> UUID' a
#

Convert an untyped UUID to a typed one. Use sparingly, preferably only during deserialization.