summaryrefslogtreecommitdiff
path: root/ShareGuardDB/User.hs
diff options
context:
space:
mode:
Diffstat (limited to 'ShareGuardDB/User.hs')
-rw-r--r--ShareGuardDB/User.hs63
1 files changed, 63 insertions, 0 deletions
diff --git a/ShareGuardDB/User.hs b/ShareGuardDB/User.hs
new file mode 100644
index 0000000..682e5fe
--- /dev/null
+++ b/ShareGuardDB/User.hs
@@ -0,0 +1,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