persistable-record-0.4.1.2: Binding between SQL database values and haskell records.

Copyright2013 Kei Hibino
LicenseBSD3
Maintainerex8k.hibino@gmail.com
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Database.Record

Contents

Description

This is integrated module which contains types to represent table constraints and interfaces to bind between SQL database values and Haskell records.

Synopsis

Concepts

On most drivers for SQL database, we need to write or read untyped SQL value sequence when accessing databases.

This library maps between list of untyped SQL type and Haskell record type using type classes.

Binding between SQL values and Haskell records

You will need to implement instances of FromSql and ToSql class to bind between SQL database values and Haskell records.

You can use Database.Record.TH module in this package to generate instances from SQL database record column names and types.

Constraints used for RecordFromSql inference

You will need to implement instances of HasColumnConstraint NotNull which is a premise to infer RecordFromSql proof object using ToSql q (Maybe a) instance. This proof object cat convert from SQL type into Maybe typed record when dealing with outer joined query.

Modules which provide proof objects

Table constraint specified by keys

Convert between Haskell type and list of SQL type

Convert from list of SQL type

Convert into list of SQL type