blob: 682e5fe33d8b3c30cfcd77e6d79d5ca5eef5cbb2 (
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.User where
import Database.HaskellDB.DBLayout
---------------------------------------------------------------------------
-- Table type
---------------------------------------------------------------------------
type User =
(RecCons Id (Expr Integer)
(RecCons Username (Expr String)
(RecCons Password (Expr String) RecNil)))
---------------------------------------------------------------------------
-- Table
---------------------------------------------------------------------------
user :: Table User
user = baseTable "user" $
hdbMakeEntry Id #
hdbMakeEntry Username #
hdbMakeEntry Password
---------------------------------------------------------------------------
-- Fields
---------------------------------------------------------------------------
---------------------------------------------------------------------------
-- Id Field
---------------------------------------------------------------------------
data Id = Id
instance FieldTag Id where fieldName _ = "id"
xid :: Attr Id Integer
xid = mkAttr Id
---------------------------------------------------------------------------
-- Username Field
---------------------------------------------------------------------------
data Username = Username
instance FieldTag Username where fieldName _ = "username"
username :: Attr Username String
username = mkAttr Username
---------------------------------------------------------------------------
-- Password Field
---------------------------------------------------------------------------
data Password = Password
instance FieldTag Password where fieldName _ = "password"
password :: Attr Password String
password = mkAttr Password
|