summaryrefslogtreecommitdiff
path: root/ShareGuardDB/Directory.hs
blob: 1e51b1066d1109ee5d3792723b7fb7ea1f83e8bc (plain)
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
58
59
60
61
62
63
{-# OPTIONS_GHC -fcontext-stack43 #-}
-- NOTE: use GHC flag -fcontext-stack43 with this module if GHC < 6.8.1
---------------------------------------------------------------------------
-- Generated by DB/Direct
---------------------------------------------------------------------------
module ShareGuardDB.Directory where

import Database.HaskellDB.DBLayout

---------------------------------------------------------------------------
-- Table type
---------------------------------------------------------------------------

type Directory =
    (RecCons Id (Expr Integer)
     (RecCons Name (Expr String)
      (RecCons Owner_id (Expr Integer) RecNil)))

---------------------------------------------------------------------------
-- Table
---------------------------------------------------------------------------
directory :: Table Directory

directory = baseTable "directory" $
            hdbMakeEntry Id #
            hdbMakeEntry Name #
            hdbMakeEntry Owner_id

---------------------------------------------------------------------------
-- Fields
---------------------------------------------------------------------------
---------------------------------------------------------------------------
-- Id Field
---------------------------------------------------------------------------

data Id = Id

instance FieldTag Id where fieldName _ = "id"

xid :: Attr Id Integer
xid = mkAttr Id

---------------------------------------------------------------------------
-- Name Field
---------------------------------------------------------------------------

data Name = Name

instance FieldTag Name where fieldName _ = "name"

name :: Attr Name String
name = mkAttr Name

---------------------------------------------------------------------------
-- Owner_id Field
---------------------------------------------------------------------------

data Owner_id = Owner_id

instance FieldTag Owner_id where fieldName _ = "owner_id"

owner_id :: Attr Owner_id Integer
owner_id = mkAttr Owner_id