|
From: Colin P. A. <co...@co...> - 2009-09-29 13:29:47
|
>>>>> "Colin" == Colin Paul Adams <co...@co...> writes:
>>>>> "Justin" == Justin Bailey <jgb...@gm...> writes:
Justin> Can you send the type definition for ImageTable (aliased
Justin> as IT in your code)? That will help me answer your
Justin> question.
I assumed you meant the DBSpec difinition, but just in case you meant
the generated module, here it is as well:
{-# OPTIONS_GHC -fcontext-stack46 #-}
-- NOTE: use GHC flag -fcontext-stack46 with this module if GHC < 6.8.1
---------------------------------------------------------------------------
-- Generated by DB/Direct
---------------------------------------------------------------------------
module Database.ImageTable where
import Database.HaskellDB.DBLayout
---------------------------------------------------------------------------
-- Table type
---------------------------------------------------------------------------
type ImageTable =
(RecCons IndexNumber (Expr Integer)
(RecCons Caption (Expr String)
(RecCons Thumbnail (Expr String)
(RecCons Preview (Expr String)
(RecCons Original (Expr (Maybe String))
(RecCons UploadTime (Expr CalendarTime) RecNil))))))
---------------------------------------------------------------------------
-- Table
---------------------------------------------------------------------------
imageTable :: Table ImageTable
imageTable = baseTable "imageTable" $
hdbMakeEntry IndexNumber #
hdbMakeEntry Caption #
hdbMakeEntry Thumbnail #
hdbMakeEntry Preview #
hdbMakeEntry Original #
hdbMakeEntry UploadTime
---------------------------------------------------------------------------
-- Fields
---------------------------------------------------------------------------
---------------------------------------------------------------------------
-- IndexNumber Field
---------------------------------------------------------------------------
data IndexNumber = IndexNumber
instance FieldTag IndexNumber where fieldName _ = "indexNumber"
indexNumber :: Attr IndexNumber Integer
indexNumber = mkAttr IndexNumber
---------------------------------------------------------------------------
-- Caption Field
---------------------------------------------------------------------------
data Caption = Caption
instance FieldTag Caption where fieldName _ = "caption"
caption :: Attr Caption String
caption = mkAttr Caption
---------------------------------------------------------------------------
-- Thumbnail Field
---------------------------------------------------------------------------
data Thumbnail = Thumbnail
instance FieldTag Thumbnail where fieldName _ = "thumbnail"
thumbnail :: Attr Thumbnail String
thumbnail = mkAttr Thumbnail
---------------------------------------------------------------------------
-- Preview Field
---------------------------------------------------------------------------
data Preview = Preview
instance FieldTag Preview where fieldName _ = "preview"
preview :: Attr Preview String
preview = mkAttr Preview
---------------------------------------------------------------------------
-- Original Field
---------------------------------------------------------------------------
data Original = Original
instance FieldTag Original where fieldName _ = "original"
original :: Attr Original (Maybe String)
original = mkAttr Original
---------------------------------------------------------------------------
-- UploadTime Field
---------------------------------------------------------------------------
data UploadTime = UploadTime
instance FieldTag UploadTime where fieldName _ = "uploadTime"
uploadTime :: Attr UploadTime CalendarTime
uploadTime = mkAttr UploadTime
--
Colin Adams
Preston Lancashire
|