Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Q db s a
- data QExpr t
- type family QExprToIdentity x
- data TopLevelQ db s a
- class IsQuery q
- class Projectible a where
- data Aggregation a
- queryToSQL' :: Projectible a => Q db s a -> (a, SQLSelect)
- allExprOpts :: Applicative f => SQLExpr -> f (Maybe SQLExpr)
- mkSqlField :: QField -> SQLFieldName
- optimizeExpr :: QExpr a -> SQLExpr
- optimizeExpr' :: SQLExpr' QField -> SQLExpr
- all_ :: Database db => DatabaseTable db table -> Q db s (table QExpr)
- join_ :: Database db => DatabaseTable db table -> QExpr Bool -> Q db s (table QExpr)
- guard_ :: QExpr Bool -> Q db s ()
- related_ :: (Database db, Table rel) => DatabaseTable db rel -> PrimaryKey rel QExpr -> Q db s (rel QExpr)
- lookup_ :: (Database db, Table rel) => DatabaseTable db rel -> PrimaryKey rel QExpr -> Q db s (rel QExpr)
- references_ :: Table tbl => PrimaryKey tbl QExpr -> tbl QExpr -> QExpr Bool
- limit_ :: IsQuery q => Integer -> q db s a -> TopLevelQ db s a
- offset_ :: IsQuery q => Integer -> q db s a -> TopLevelQ db s a
- (<.) :: QExpr a -> QExpr a -> QExpr Bool
- (>.) :: QExpr a -> QExpr a -> QExpr Bool
- (<=.) :: QExpr a -> QExpr a -> QExpr Bool
- (>=.) :: QExpr a -> QExpr a -> QExpr Bool
- (==.), (/=.) :: SqlOrd a => a -> a -> QExpr Bool
- (&&.) :: QExpr Bool -> QExpr Bool -> QExpr Bool
- (||.) :: QExpr Bool -> QExpr Bool -> QExpr Bool
- not_ :: QExpr Bool -> QExpr Bool
- div_ :: Integral a => QExpr a -> QExpr a -> QExpr a
- mod_ :: Integral a => QExpr a -> QExpr a -> QExpr a
- type family HaskellLiteralForQExpr x
- class SqlValable a where
- val_ :: HaskellLiteralForQExpr a -> a
- enum_ :: Show a => a -> QExpr (BeamEnum a)
- aggregate :: (Projectible a, Aggregating agg) => (a -> agg) -> (forall s. Q db s a) -> Q db s (LiftAggregationsToQExpr agg)
- group_ :: QExpr a -> Aggregation a
- sum_ :: Num a => QExpr a -> Aggregation a
- count_ :: QExpr a -> Aggregation Int
- orderBy :: (SqlOrderable ordering, IsQuery q) => (a -> ordering) -> q db s a -> TopLevelQ db s a
- asc_ :: QExpr a -> SQLOrdering
- desc_ :: QExpr a -> SQLOrdering
- subquery_ :: (IsQuery q, Projectible a, Subqueryable a) => (forall s. q db s a) -> Q db s a
- beamTxn :: MonadIO m => Beam db m -> (DatabaseSettings db -> BeamT e db m a) -> m (BeamResult e a)
- insertInto :: (MonadIO m, Functor m, Table table, FromSqlValues (table Identity)) => DatabaseTable db table -> table Identity -> BeamT e db m (table Identity)
- query :: (IsQuery q, MonadIO m, Functor m, FromSqlValues (QExprToIdentity a), Projectible a) => (forall s. q db s a) -> BeamT e db m (Source (BeamT e db m) (QExprToIdentity a))
- queryList :: (IsQuery q, MonadIO m, Functor m, FromSqlValues (QExprToIdentity a), Projectible a) => (forall s. q db s a) -> BeamT e db m [QExprToIdentity a]
- getOne :: (IsQuery q, MonadIO m, Functor m, FromSqlValues (QExprToIdentity a), Projectible a) => (forall s. q db s a) -> BeamT e db m (Maybe (QExprToIdentity a))
- updateWhere :: (MonadIO m, Table tbl) => DatabaseTable db tbl -> (tbl QExpr -> tbl QExpr) -> (tbl QExpr -> QExpr Bool) -> BeamT e db m ()
- saveTo :: (MonadIO m, Table tbl) => DatabaseTable db tbl -> tbl Identity -> BeamT e db m ()
- deleteWhere :: (MonadIO m, Table tbl) => DatabaseTable db tbl -> (tbl QExpr -> QExpr Bool) -> BeamT e db m ()
- deleteFrom :: (MonadIO m, Table tbl) => DatabaseTable db tbl -> PrimaryKey tbl Identity -> BeamT e db m ()
Documentation
Eq (QExpr t) Source | |
Show (QExpr t) Source | |
Table t => Projectible (t QExpr) Source | |
Typeable * a => Projectible (QExpr a) Source | |
Table tbl => SqlValable (tbl QExpr) Source | |
Convertible a SqlValue => SqlValable (QExpr a) Source | |
Table tbl => SqlValable (PrimaryKey tbl QExpr) Source | |
type QExprToIdentity (table QExpr) = table Identity Source | |
type QExprToIdentity (QExpr a) = a Source | |
type HaskellLiteralForQExpr (table QExpr) = table Identity Source | |
type HaskellLiteralForQExpr (QExpr a) = a Source |
type family QExprToIdentity x Source
type QExprToIdentity (table QExpr) = table Identity Source | |
type QExprToIdentity (QExpr a) = a Source | |
type QExprToIdentity (a, b) = (QExprToIdentity a, QExprToIdentity b) Source | |
type QExprToIdentity (a, b, c) = (QExprToIdentity a, QExprToIdentity b, QExprToIdentity c) Source |
class Projectible a where Source
Table t => Projectible (t QExpr) Source | |
Typeable * a => Projectible (QExpr a) Source | |
(Projectible a, Projectible b) => Projectible (a, b) Source | |
(Projectible a, Projectible b, Projectible c) => Projectible (a, b, c) Source | |
(Projectible a, Projectible b, Projectible c, Projectible d) => Projectible (a, b, c, d) Source | |
(Projectible a, Projectible b, Projectible c, Projectible d, Projectible e) => Projectible (a, b, c, d, e) Source |
data Aggregation a Source
queryToSQL' :: Projectible a => Q db s a -> (a, SQLSelect) Source
allExprOpts :: Applicative f => SQLExpr -> f (Maybe SQLExpr) Source
mkSqlField :: QField -> SQLFieldName Source
optimizeExpr :: QExpr a -> SQLExpr Source
optimizeExpr' :: SQLExpr' QField -> SQLExpr Source
all_ :: Database db => DatabaseTable db table -> Q db s (table QExpr) Source
Introduce all entries of a table into the Q
monad
join_ :: Database db => DatabaseTable db table -> QExpr Bool -> Q db s (table QExpr) Source
Introduce all entries of a table into the Q
monad based on the given SQLExpr
related_ :: (Database db, Table rel) => DatabaseTable db rel -> PrimaryKey rel QExpr -> Q db s (rel QExpr) Source
Introduce all entries of the given table which are referenced by the given ForeignKey
lookup_ :: (Database db, Table rel) => DatabaseTable db rel -> PrimaryKey rel QExpr -> Q db s (rel QExpr) Source
references_ :: Table tbl => PrimaryKey tbl QExpr -> tbl QExpr -> QExpr Bool Source
type family HaskellLiteralForQExpr x Source
type HaskellLiteralForQExpr (table QExpr) = table Identity Source | |
type HaskellLiteralForQExpr (QExpr a) = a Source |
class SqlValable a where Source
val_ :: HaskellLiteralForQExpr a -> a Source
Table tbl => SqlValable (tbl QExpr) Source | |
Convertible a SqlValue => SqlValable (QExpr a) Source | |
Table tbl => SqlValable (PrimaryKey tbl QExpr) Source |
aggregate :: (Projectible a, Aggregating agg) => (a -> agg) -> (forall s. Q db s a) -> Q db s (LiftAggregationsToQExpr agg) Source
group_ :: QExpr a -> Aggregation a Source
sum_ :: Num a => QExpr a -> Aggregation a Source
count_ :: QExpr a -> Aggregation Int Source
orderBy :: (SqlOrderable ordering, IsQuery q) => (a -> ordering) -> q db s a -> TopLevelQ db s a Source
asc_ :: QExpr a -> SQLOrdering Source
desc_ :: QExpr a -> SQLOrdering Source
subquery_ :: (IsQuery q, Projectible a, Subqueryable a) => (forall s. q db s a) -> Q db s a Source
beamTxn :: MonadIO m => Beam db m -> (DatabaseSettings db -> BeamT e db m a) -> m (BeamResult e a) Source
insertInto :: (MonadIO m, Functor m, Table table, FromSqlValues (table Identity)) => DatabaseTable db table -> table Identity -> BeamT e db m (table Identity) Source
query :: (IsQuery q, MonadIO m, Functor m, FromSqlValues (QExprToIdentity a), Projectible a) => (forall s. q db s a) -> BeamT e db m (Source (BeamT e db m) (QExprToIdentity a)) Source
queryList :: (IsQuery q, MonadIO m, Functor m, FromSqlValues (QExprToIdentity a), Projectible a) => (forall s. q db s a) -> BeamT e db m [QExprToIdentity a] Source
getOne :: (IsQuery q, MonadIO m, Functor m, FromSqlValues (QExprToIdentity a), Projectible a) => (forall s. q db s a) -> BeamT e db m (Maybe (QExprToIdentity a)) Source
updateWhere :: (MonadIO m, Table tbl) => DatabaseTable db tbl -> (tbl QExpr -> tbl QExpr) -> (tbl QExpr -> QExpr Bool) -> BeamT e db m () Source
deleteWhere :: (MonadIO m, Table tbl) => DatabaseTable db tbl -> (tbl QExpr -> QExpr Bool) -> BeamT e db m () Source
deleteFrom :: (MonadIO m, Table tbl) => DatabaseTable db tbl -> PrimaryKey tbl Identity -> BeamT e db m () Source