hvac-0.1: Http view and controller. A transactional, declarative framework for lightweight web applications.ContentsIndex
Database.StaticRecord
Documentation
newtype IntEx
Constructors
IntEx Int
show/hide Instances
Bounded IntEx
Enum IntEx
Eq IntEx
Num IntEx
Show IntEx
Typeable IntEx
class OneVal a b | a -> b where
Methods
getOne :: a -> b
show/hide Instances
OneVal (Box a) a
data Key a b
Constructors
Key [String] a -> [SqlValue]
takeOne :: MonadState [a] m => m a
sqlNull :: SqlValue -> Bool
geq' :: GenericQ (GenericQ (Maybe SqlValue))
gToSql :: Data d => d -> SqlValue
getNameFromAccessor :: forall a a' b. StaticRecord a a' => (a -> b) -> String
class (Monad m, IConnection c) => MonadDB m c | m -> c where
Methods
getConn :: m c
liftDB :: IO a -> m a
show/hide Instances
class Data a => StaticRecord a b | a -> b where
Methods
tableName :: a -> String
primaryKey :: Key a b
_srFields :: a -> [String]
For internal use. List of names of columns, in order of constructors. Can be overridden to provide other names.
show/hide Instances
class StaticRecord a a' => Has a b a' | a -> a' where
Methods
foreignKey :: StaticRecord b b' => a -> (b -> a')
show/hide Instances
gbuild :: StaticRecord a a' => a -> [SqlValue] -> a
gfindnewvals :: (Data a, StaticRecord a a') => a -> a -> [(String, SqlValue)]
getRecsWhere' :: forall m r r' c. (MonadDB m c, StaticRecord r r') => String -> [String] -> [SqlValue] -> m [r]
runConnT :: (IConnection c, MonadIO m) => IO c -> ReaderT c m () -> m ()
runConn :: IConnection c => IO c -> ReaderT c IO () -> IO ()
mkKey :: (StaticRecord r r', MapFromTuple a (r -> SqlValue), MapFromTuple a String, TupleMatch a b) => a -> Key r b
mkForeign :: (r -> a) -> b -> r -> (Box a)
getRec :: forall m r c a. (Functor m, MonadDB m c, StaticRecord r a, MapFromTuple a SqlValue) => a -> m (Maybe r)
getRecsWhere :: (MonadDB m c, StaticRecord r r') => WhereExpr Bool cl -> m [r]
insertRec :: (MonadDB m c, StaticRecord r r') => r -> m ()
updateRec :: forall r r' m c. (MonadDB m c, StaticRecord r r') => (r -> r) -> r -> m r
updateWhere :: (StaticRecord r r', MonadDB m c) => (r -> r) -> WhereExpr Bool cl -> m ()
getAssociated :: forall a b a' b' a'' m c. (MonadDB m c, Has a b a', StaticRecord b b', OneVal a' a'') => a -> m [b]
getParent :: forall a b a' b' a'' m c. (MonadDB m c, Functor m, Has a b a', StaticRecord a a', StaticRecord b b', OneVal a' a'', SqlType a'') => b -> m (Maybe a)
newtype DbTName
Constructors
DbTName
unDbTName :: String
data CWhere
show/hide Instances
data COrder
show/hide Instances
data CLimit
class WhereOrOrder a
show/hide Instances
data SqlOrder
Constructors
ASC
DESC
data SelClause a
Constructors
SelClause String [String]
show/hide Instances
Show (SelClause a)
data WhereExpr t c
Constructors
WhereExpr String [String] [SqlValue]
show/hide Instances
data SelWhere a
Constructors
SelWhere String [SqlValue]
show/hide Instances
Show (SelWhere a)
class ToExpr a t | a -> t where
Methods
toExpr :: a -> WhereExpr t CWhere
show/hide Instances
stToExpr :: SqlType a => a -> WhereExpr a CWhere
getTuples :: (MapToTuple t SqlValue, MonadDB m c) => SelWhere t -> m [t]
select :: (MapFromTuple a String, MapFromTuple a DbTName, TupleMatch a b) => a -> SelClause b
whre :: SelClause a -> WhereExpr Bool c -> SelWhere a
orderBy :: (MapFromTuple a ([Char], SqlOrder), MapFromTuple a DbTName) => WhereExpr Bool CWhere -> a -> WhereExpr Bool COrder
limit :: WhereOrOrder c => WhereExpr Bool c -> Integer -> WhereExpr Bool CLimit
biOp :: (ToExpr a t, ToExpr b t') => [Char] -> a -> b -> WhereExpr c CWhere
(%=) :: (ToExpr a t, ToExpr b t) => a -> b -> WhereExpr Bool CWhere
(%!=) :: (ToExpr a t, ToExpr b t) => a -> b -> WhereExpr Bool CWhere
(%<) :: (ToExpr a t, ToExpr b t, Ord t) => a -> b -> WhereExpr Bool CWhere
(%>) :: (ToExpr a t, ToExpr b t, Ord t) => a -> b -> WhereExpr Bool CWhere
(%*) :: (ToExpr a t, ToExpr b t, Num t) => a -> b -> WhereExpr t CWhere
(%/) :: (ToExpr a t, ToExpr b t, Num t) => a -> b -> WhereExpr t CWhere
(%-) :: (ToExpr a t, ToExpr b t, Num t) => a -> b -> WhereExpr t CWhere
(%+) :: (ToExpr a t, ToExpr b t, Num t) => a -> b -> WhereExpr t CWhere
(%%) :: (ToExpr a t, ToExpr b t, Integral t) => a -> b -> WhereExpr t CWhere
(%&) :: (ToExpr a Bool, ToExpr b Bool) => a -> b -> WhereExpr Bool CWhere
(%|) :: (ToExpr a Bool, ToExpr b Bool) => a -> b -> WhereExpr Bool CWhere
(%++) :: (ToExpr a Bool, ToExpr b Bool) => a -> b -> WhereExpr Bool CWhere
like :: (ToExpr a [Char], ToExpr b [Char]) => a -> b -> WhereExpr Bool CWhere
isIn :: (ToExpr a t, ToExpr b t) => a -> [b] -> WhereExpr Bool CWhere
isNull :: ToExpr a (Maybe t) => a -> WhereExpr Bool CWhere
notNull :: ToExpr a (Maybe t) => a -> WhereExpr Bool CWhere
data Post
Constructors
Post
pid :: Int
contents :: String
authorId :: Int
show/hide Instances
Data Post
Show Post
Typeable Post
Has Author Post (Box Int)
StaticRecord Post ((,) Int String)
data Author
Constructors
Author
aid :: Int
aname :: String
show/hide Instances
Produced by Haddock version 2.0.0.0