X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=blackboard-dns.git;a=blobdiff_plain;f=DDNS%2FDB%2FZones.hs;fp=DDNS%2FDB%2FZones.hs;h=69653e45564780a362bea88e1bc9b140469bf03f;hp=0000000000000000000000000000000000000000;hb=f46e263327d20c700179b2d3a5896be82d3b4aca;hpb=23aa8a3221ebacf5891def22006b9850497437de diff --git a/DDNS/DB/Zones.hs b/DDNS/DB/Zones.hs new file mode 100644 index 0000000..69653e4 --- /dev/null +++ b/DDNS/DB/Zones.hs @@ -0,0 +1,128 @@ +{-# OPTIONS_GHC -fcontext-stack48 #-} +-- NOTE: use GHC flag -fcontext-stack48 with this module if GHC < 6.8.1 +--------------------------------------------------------------------------- +-- Generated by DB/Direct +--------------------------------------------------------------------------- +module DDNS.DB.Zones where + +import Database.HaskellDB.DBLayout + +--------------------------------------------------------------------------- +-- Table type +--------------------------------------------------------------------------- + +type Zones = + (RecCons Zone (Expr String) + (RecCons Ns (Expr String) + (RecCons Owner (Expr String) + (RecCons Serial (Expr Int) + (RecCons Refresh (Expr Int) + (RecCons Retry (Expr Int) + (RecCons Expire (Expr Int) + (RecCons MinTTL (Expr Int) RecNil)))))))) + +--------------------------------------------------------------------------- +-- Table +--------------------------------------------------------------------------- +zones :: Table Zones + +zones = baseTable "zones" $ + hdbMakeEntry Zone # + hdbMakeEntry Ns # + hdbMakeEntry Owner # + hdbMakeEntry Serial # + hdbMakeEntry Refresh # + hdbMakeEntry Retry # + hdbMakeEntry Expire # + hdbMakeEntry MinTTL + +--------------------------------------------------------------------------- +-- Fields +--------------------------------------------------------------------------- +--------------------------------------------------------------------------- +-- Zone Field +--------------------------------------------------------------------------- + +data Zone = Zone + +instance FieldTag Zone where fieldName _ = "zone" + +zone :: Attr Zone String +zone = mkAttr Zone + +--------------------------------------------------------------------------- +-- Ns Field +--------------------------------------------------------------------------- + +data Ns = Ns + +instance FieldTag Ns where fieldName _ = "ns" + +ns :: Attr Ns String +ns = mkAttr Ns + +--------------------------------------------------------------------------- +-- Owner Field +--------------------------------------------------------------------------- + +data Owner = Owner + +instance FieldTag Owner where fieldName _ = "owner" + +owner :: Attr Owner String +owner = mkAttr Owner + +--------------------------------------------------------------------------- +-- Serial Field +--------------------------------------------------------------------------- + +data Serial = Serial + +instance FieldTag Serial where fieldName _ = "serial" + +serial :: Attr Serial Int +serial = mkAttr Serial + +--------------------------------------------------------------------------- +-- Refresh Field +--------------------------------------------------------------------------- + +data Refresh = Refresh + +instance FieldTag Refresh where fieldName _ = "refresh" + +refresh :: Attr Refresh Int +refresh = mkAttr Refresh + +--------------------------------------------------------------------------- +-- Retry Field +--------------------------------------------------------------------------- + +data Retry = Retry + +instance FieldTag Retry where fieldName _ = "retry" + +retry :: Attr Retry Int +retry = mkAttr Retry + +--------------------------------------------------------------------------- +-- Expire Field +--------------------------------------------------------------------------- + +data Expire = Expire + +instance FieldTag Expire where fieldName _ = "expire" + +expire :: Attr Expire Int +expire = mkAttr Expire + +--------------------------------------------------------------------------- +-- MinTTL Field +--------------------------------------------------------------------------- + +data MinTTL = MinTTL + +instance FieldTag MinTTL where fieldName _ = "minTTL" + +minTTL :: Attr MinTTL Int +minTTL = mkAttr MinTTL