X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=blackboard-dns.git;a=blobdiff_plain;f=DDNS%2FDB%2FRecords.hs;fp=DDNS%2FDB%2FRecords.hs;h=9b2872a8fd7db2db46436dda4abf796e75c2e93c;hp=0000000000000000000000000000000000000000;hb=f46e263327d20c700179b2d3a5896be82d3b4aca;hpb=23aa8a3221ebacf5891def22006b9850497437de diff --git a/DDNS/DB/Records.hs b/DDNS/DB/Records.hs new file mode 100644 index 0000000..9b2872a --- /dev/null +++ b/DDNS/DB/Records.hs @@ -0,0 +1,76 @@ +{-# OPTIONS_GHC -fcontext-stack44 #-} +-- NOTE: use GHC flag -fcontext-stack44 with this module if GHC < 6.8.1 +--------------------------------------------------------------------------- +-- Generated by DB/Direct +--------------------------------------------------------------------------- +module DDNS.DB.Records where + +import Database.HaskellDB.DBLayout + +--------------------------------------------------------------------------- +-- Table type +--------------------------------------------------------------------------- + +type Records = + (RecCons Name (Expr String) + (RecCons Zone (Expr String) + (RecCons RecType (Expr String) + (RecCons RecData (Expr String) RecNil)))) + +--------------------------------------------------------------------------- +-- Table +--------------------------------------------------------------------------- +records :: Table Records + +records = baseTable "records" $ + hdbMakeEntry Name # + hdbMakeEntry Zone # + hdbMakeEntry RecType # + hdbMakeEntry RecData + +--------------------------------------------------------------------------- +-- Fields +--------------------------------------------------------------------------- +--------------------------------------------------------------------------- +-- Name Field +--------------------------------------------------------------------------- + +data Name = Name + +instance FieldTag Name where fieldName _ = "name" + +name :: Attr Name String +name = mkAttr Name + +--------------------------------------------------------------------------- +-- Zone Field +--------------------------------------------------------------------------- + +data Zone = Zone + +instance FieldTag Zone where fieldName _ = "zone" + +zone :: Attr Zone String +zone = mkAttr Zone + +--------------------------------------------------------------------------- +-- RecType Field +--------------------------------------------------------------------------- + +data RecType = RecType + +instance FieldTag RecType where fieldName _ = "recType" + +recType :: Attr RecType String +recType = mkAttr RecType + +--------------------------------------------------------------------------- +-- RecData Field +--------------------------------------------------------------------------- + +data RecData = RecData + +instance FieldTag RecData where fieldName _ = "recData" + +recData :: Attr RecData String +recData = mkAttr RecData