-
Notifications
You must be signed in to change notification settings - Fork 173
/
Copy pathSchema.hs
57 lines (45 loc) · 1.72 KB
/
Schema.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
-- | Defines type classes for 'Table's and 'Database's.
--
-- All important class methods of these classes can be derived automatically using 'Generic's and GHC's DefaultSignatures extension,
-- but you can override any method if necessary.
--
-- To get started, see 'Table', 'Columnar', and 'Nullable'.
module Database.Beam.Schema
(
-- * Database construction
-- $db-construction
Database
, DatabaseSettings
, DatabaseEntity
-- ** #entities# Database entities
-- $entities
, TableEntity
-- * Table construction
, Table(..), Beamable
, defTblFieldSettings, pk
, Columnar, C, Columnar', Nullable
, TableField, fieldName
, TableSettings, HaskellTable
-- * 'Generic'-deriving mechanisms
, defaultDbSettings
-- ** Modifying the derived schema
, DatabaseModification, EntityModification, FieldModification
, withDbModification, withTableModification
, dbModification, tableModification
, modifyTable, fieldNamed
-- * Types for lens generation
, Lenses, LensFor(..)
-- TODO: does it worth reexporting index stuff here?
, module Database.Beam.Schema.Lenses ) where
import Database.Beam.Schema.Lenses
import Database.Beam.Schema.Tables
-- $db-construction
-- Types and functions to express database types and auto-generate name mappings
-- for them. See the
-- [manual](https://tathougies.github.io/beam/user-guide/databases.md) for more
-- information.
-- $entities
-- Database entities represent things that can go into databases. Each entity in
-- your database that you want to access from Haskell must be given a field in
-- your database type. Each type of entity gets a particular entity tag, such as
-- 'TableEntity' or 'DomainTypeEntity'