sqlite-simple-0.4.19.0: Mid-Level SQLite client library

Copyright | (c) 2011 MailRank Inc. (c) 2011-2012 Leon P Smith (c) 2012-2013 Janne Hellsten
License | BSD3
Maintainer | Janne Hellsten <jjhellst@gmail.com>
Portability | portable
Safe Haskell | None
Language | Haskell2010

Database.SQLite.Simple.ToRow

Description

The `ToRow` typeclass, for rendering a collection of parameters to a SQL query.

Predefined instances are provided for tuples containing up to ten elements.

Synopsis

- class GToRow (f :: Type -> Type) where
  - gtoRow :: f a -> [SQLData]
- class ToRow a where
  - toRow :: a -> [SQLData]

# Documentation

class GToRow (f :: Type -> Type) where #

Generic derivation of `ToRow`. For details about what can be derived refer to `GFromRow`.

Since: 0.4.18.1

Methods

gtoRow :: f a -> [SQLData] #

#### Instances

Instances details

GToRow (U1 :: Type -> Type) # |
Instance details Defined in Database.SQLite.Simple.ToRow Methods gtoRow :: U1 a -> [SQLData] #
(GToRow a, GToRow b) => GToRow (a :*: b) # |
Instance details Defined in Database.SQLite.Simple.ToRow Methods gtoRow :: (a :*: b) a0 -> [SQLData] #
ToField a => GToRow (K1 i a :: Type -> Type) # |
Instance details Defined in Database.SQLite.Simple.ToRow Methods gtoRow :: K1 i a a0 -> [SQLData] #
GToRow a => GToRow (M1 i c a) # |
Instance details Defined in Database.SQLite.Simple.ToRow Methods gtoRow :: M1 i c a a0 -> [SQLData] #

class ToRow a where #

A collection type that can be turned into a list of `SQLData` elements.

Since version 0.4.18.1 it is possible in some cases to derive a generic implementation for `ToRow`. Refer to the documentation for `FromRow` to see how this can be done.

Minimal complete definition

Nothing

Methods

toRow :: a -> [SQLData] #

`ToField` a collection of values.

default toRow :: (Generic a, GToRow (Rep a)) => a -> [SQLData] #

#### Instances

Instances details

ToRow () # |
Instance details Defined in Database.SQLite.Simple.ToRow Methods toRow :: () -> [SQLData] #
ToField a => ToRow (Only a) # |
Instance details Defined in Database.SQLite.Simple.ToRow Methods toRow :: Only a -> [SQLData] #
ToField a => ToRow [a] # |
Instance details Defined in Database.SQLite.Simple.ToRow Methods toRow :: [a] -> [SQLData] #
(ToRow a, ToRow b) => ToRow (a :. b) # |
Instance details Defined in Database.SQLite.Simple.ToRow Methods toRow :: (a :. b) -> [SQLData] #
(ToField a, ToField b) => ToRow (a, b) # |
Instance details Defined in Database.SQLite.Simple.ToRow Methods toRow :: (a, b) -> [SQLData] #
(ToField a, ToField b, ToField c) => ToRow (a, b, c) # |
Instance details Defined in Database.SQLite.Simple.ToRow Methods toRow :: (a, b, c) -> [SQLData] #
(ToField a, ToField b, ToField c, ToField d) => ToRow (a, b, c, d) # |
Instance details Defined in Database.SQLite.Simple.ToRow Methods toRow :: (a, b, c, d) -> [SQLData] #
(ToField a, ToField b, ToField c, ToField d, ToField e) => ToRow (a, b, c, d, e) # |
Instance details Defined in Database.SQLite.Simple.ToRow Methods toRow :: (a, b, c, d, e) -> [SQLData] #
(ToField a, ToField b, ToField c, ToField d, ToField e, ToField f) => ToRow (a, b, c, d, e, f) # |
Instance details Defined in Database.SQLite.Simple.ToRow Methods toRow :: (a, b, c, d, e, f) -> [SQLData] #
(ToField a, ToField b, ToField c, ToField d, ToField e, ToField f, ToField g) => ToRow (a, b, c, d, e, f, g) # |
Instance details Defined in Database.SQLite.Simple.ToRow Methods toRow :: (a, b, c, d, e, f, g) -> [SQLData] #
(ToField a, ToField b, ToField c, ToField d, ToField e, ToField f, ToField g, ToField h) => ToRow (a, b, c, d, e, f, g, h) # |
Instance details Defined in Database.SQLite.Simple.ToRow Methods toRow :: (a, b, c, d, e, f, g, h) -> [SQLData] #
(ToField a, ToField b, ToField c, ToField d, ToField e, ToField f, ToField g, ToField h, ToField i) => ToRow (a, b, c, d, e, f, g, h, i) # |
Instance details Defined in Database.SQLite.Simple.ToRow Methods toRow :: (a, b, c, d, e, f, g, h, i) -> [SQLData] #
(ToField a, ToField b, ToField c, ToField d, ToField e, ToField f, ToField g, ToField h, ToField i, ToField j) => ToRow (a, b, c, d, e, f, g, h, i, j) # |
Instance details Defined in Database.SQLite.Simple.ToRow Methods toRow :: (a, b, c, d, e, f, g, h, i, j) -> [SQLData] #