HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulesqlite-simple-0.4.19.0Haskell2010

Database.SQLite.Simple.Types

Top-level module for sqlite-simple.

  • 4 types
datadata Null
#

A placeholder for the SQL NULL value.

Instances5Eq, Read, Show, ToField, FromField
  • Eq NullDefined in sqlite-simple-0.4.19.0 · Database.SQLite.Simple.Types
  • Read NullDefined in sqlite-simple-0.4.19.0 · Database.SQLite.Simple.Types
  • Show NullDefined in sqlite-simple-0.4.19.0 · Database.SQLite.Simple.Types
  • ToField NullDefined in sqlite-simple-0.4.19.0 · Database.SQLite.Simple.ToField
  • FromField NullDefined in sqlite-simple-0.4.19.0 · Database.SQLite.Simple.FromField
newtypenewtype Only a
#

The 1-tuple type or single-value "collection".

This type is structurally equivalent to the Identity type, but its intent is more about serving as the anonymous 1-tuple type missing from Haskell for attaching typeclass instances.

Parameter usage example:

encodeSomething (Only (42::Int))

Result usage example:

xs <- decodeSomething
forM_ xs $ \(Only id) -> {- ... -}

Constructors

Instances11Functor, Eq, Data, Ord, Read, Show, …
newtypenewtype Query
#

A query string. This type is intended to make it difficult to construct a SQL query by concatenating string fragments, as that is an extremely common way to accidentally introduce SQL injection vulnerabilities into an application.

This type is an instance of IsString, so the easiest way to construct a query is to enable the OverloadedStrings language extension and then simply write the query in double quotes.

{-# LANGUAGE OverloadedStrings #-}

import Database.SQLite.Simple

q :: Query
q = "select ?"

The underlying type is a Text, and literal Haskell strings that contain Unicode characters will be correctly transformed to UTF-8.

Constructors

Instances7Eq, Ord, Read, Show, IsString, Semigroup, …
  • Eq QueryDefined in sqlite-simple-0.4.19.0 · Database.SQLite.Simple.Types
  • Ord QueryDefined in sqlite-simple-0.4.19.0 · Database.SQLite.Simple.Types
  • Read QueryDefined in sqlite-simple-0.4.19.0 · Database.SQLite.Simple.Types
  • Show QueryDefined in sqlite-simple-0.4.19.0 · Database.SQLite.Simple.Types
  • IsString QueryDefined in sqlite-simple-0.4.19.0 · Database.SQLite.Simple.Types
  • Semigroup QueryDefined in sqlite-simple-0.4.19.0 · Database.SQLite.Simple.Types
  • Monoid QueryDefined in sqlite-simple-0.4.19.0 · Database.SQLite.Simple.Types
datadata (:.) h t
#

A composite type to parse your custom data structures without having to define dummy newtype wrappers every time.

instance FromRow MyData where ...
instance FromRow MyData2 where ...

then I can do the following for free:

res <- query' c "..."
forM res $ \(MyData{..} :. MyData2{..}) -> do
  ....

Constructors

  • h :. tinfixr 3
Instances6Eq, Ord, Read, Show, FromRow, ToRow
  • (Eq h, Eq t) => Eq (h :. t)Defined in sqlite-simple-0.4.19.0 · Database.SQLite.Simple.Types
  • (Ord h, Ord t) => Ord (h :. t)Defined in sqlite-simple-0.4.19.0 · Database.SQLite.Simple.Types
  • (Read h, Read t) => Read (h :. t)Defined in sqlite-simple-0.4.19.0 · Database.SQLite.Simple.Types
  • (Show h, Show t) => Show (h :. t)Defined in sqlite-simple-0.4.19.0 · Database.SQLite.Simple.Types
  • (FromRow a, FromRow b) => FromRow (a :. b)Defined in sqlite-simple-0.4.19.0 · Database.SQLite.Simple.FromRow
  • (ToRow a, ToRow b) => ToRow (a :. b)Defined in sqlite-simple-0.4.19.0 · Database.SQLite.Simple.ToRow