diff options
author | Clint Adams <clint@debian.org> | 2011-06-30 16:55:54 -0400 |
---|---|---|
committer | Clint Adams <clint@debian.org> | 2011-06-30 16:55:54 -0400 |
commit | 20a15553fa0fa4138c468d2892cd07d6baa061d2 (patch) | |
tree | a51ecbc9517e347b0f0538b7c23ecb0c73a84b26 /ShareGuardDB/User.hs |
Initial checkin of non-Python components.
Diffstat (limited to 'ShareGuardDB/User.hs')
-rw-r--r-- | ShareGuardDB/User.hs | 63 |
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 |