-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Meta package of Relational Record
--   
--   Meta package to install Relational Record quickly
@package relational-record
@version 0.2.2.0


-- | This module is documentation module for relational-record. The project
--   page of relational-record is
--   <a>http://khibino.github.io/haskell-relational-record/</a> .
module Database.Relational.Documentation
query :: (MonadQualify ConfigureQuery m, MonadQuery m) => Relation () r -> m (Record Flat r)
queryMaybe :: (MonadQualify ConfigureQuery m, MonadQuery m) => Relation () r -> m (Record Flat (Maybe r))
on :: MonadQuery m => Predicate Flat -> m ()
wheres :: MonadRestrict Flat m => Predicate Flat -> m ()
groupBy :: MonadAggregate m => Record Flat r -> m (Record Aggregated r)
having :: MonadRestrict Aggregated m => Predicate Aggregated -> m ()
distinct :: MonadQuery m => m ()
all' :: MonadQuery m => m ()
(<-#) :: forall (m :: Type -> Type) r v. Monad m => AssignTarget r v -> Record Flat v -> Assignings r m ()
inner :: Relation () a -> Relation () b -> [JoinRestriction a b] -> Relation () (a, b)
left :: Relation () a -> Relation () b -> [JoinRestriction a (Maybe b)] -> Relation () (a, Maybe b)
right :: Relation () a -> Relation () b -> [JoinRestriction (Maybe a) b] -> Relation () (Maybe a, b)
full :: Relation () a -> Relation () b -> [JoinRestriction (Maybe a) (Maybe b)] -> Relation () (Maybe a, Maybe b)
on' :: ([JoinRestriction a b] -> Relation pc (a, b)) -> [JoinRestriction a b] -> Relation pc (a, b)
type JoinRestriction a b = Record Flat a -> Record Flat b -> Predicate Flat
data Relation p r
relation :: QuerySimple (Record Flat r) -> Relation () r
aggregateRelation :: QueryAggregate (Record Aggregated r) -> Relation () r
type UpdateTarget p r = Record Flat r -> Assign r PlaceHolders p
updateTarget :: (Record Flat r -> Assign r ()) -> UpdateTarget () r
type Restriction p r = Record Flat r -> Restrict PlaceHolders p
restriction :: (Record Flat r -> Restrict ()) -> Restriction () r
data Record c t
data Flat
data Aggregated
data Exists
data OverWindow
data Pi r0 r1
(!) :: PersistableWidth a => Record c a -> Pi a b -> Record c b
(<.>) :: Pi a b -> Pi b c -> Pi a c
type ShowConstantTermsSQL = LiteralSQL
value :: (LiteralSQL t, OperatorContext c) => t -> Record c t
values :: (LiteralSQL t, OperatorContext c) => [t] -> RecordList (Record c) t
(.=.) :: OperatorContext c => Record c ft -> Record c ft -> Record c (Maybe Bool)
(.<.) :: OperatorContext c => Record c ft -> Record c ft -> Record c (Maybe Bool)
(.<=.) :: OperatorContext c => Record c ft -> Record c ft -> Record c (Maybe Bool)
(.>.) :: OperatorContext c => Record c ft -> Record c ft -> Record c (Maybe Bool)
(.>=.) :: OperatorContext c => Record c ft -> Record c ft -> Record c (Maybe Bool)
(.<>.) :: OperatorContext c => Record c ft -> Record c ft -> Record c (Maybe Bool)
and' :: OperatorContext c => Record c (Maybe Bool) -> Record c (Maybe Bool) -> Record c (Maybe Bool)
or' :: OperatorContext c => Record c (Maybe Bool) -> Record c (Maybe Bool) -> Record c (Maybe Bool)
in' :: OperatorContext c => Record c t -> RecordList (Record c) t -> Record c (Maybe Bool)
(.||.) :: OperatorContext c => Record c a -> Record c a -> Record c a
like :: (OperatorContext c, IsString a, LiteralSQL a) => Record c a -> a -> Record c (Maybe Bool)
like' :: (OperatorContext c, IsString a) => Record c a -> Record c a -> Record c (Maybe Bool)
(.+.) :: (OperatorContext c, Num a) => Record c a -> Record c a -> Record c a
(.-.) :: (OperatorContext c, Num a) => Record c a -> Record c a -> Record c a
(.*.) :: (OperatorContext c, Num a) => Record c a -> Record c a -> Record c a
(./.) :: (OperatorContext c, Num a) => Record c a -> Record c a -> Record c a
isNothing :: (OperatorContext c, HasColumnConstraint NotNull r) => Record c (Maybe r) -> Predicate c
isJust :: (OperatorContext c, HasColumnConstraint NotNull r) => Record c (Maybe r) -> Predicate c
fromMaybe :: (OperatorContext c, HasColumnConstraint NotNull r) => Record c r -> Record c (Maybe r) -> Record c r
not' :: OperatorContext c => Record c (Maybe Bool) -> Record c (Maybe Bool)
exists :: OperatorContext c => RecordList (Record Exists) r -> Record c (Maybe Bool)
negate' :: (OperatorContext c, Num a) => Record c a -> Record c a
fromIntegral' :: (SqlContext c, Integral a, Num b) => Record c a -> Record c b
showNum :: (SqlContext c, Num a, IsString b) => Record c a -> Record c b
casesOrElse :: OperatorContext c => [(Predicate c, Record c a)] -> Record c a -> Record c a
case' :: OperatorContext c => Record c a -> [(Record c a, Record c b)] -> Record c b -> Record c b
count :: (Integral b, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac b
sum' :: (Num a, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac (Maybe a)
avg :: (Num a, Fractional b, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac (Maybe b)
max' :: (Ord a, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac (Maybe a)
min' :: (Ord a, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac (Maybe a)
every :: (AggregatedContext ac, SqlContext ac) => Predicate Flat -> Record ac (Maybe Bool)
any' :: (AggregatedContext ac, SqlContext ac) => Predicate Flat -> Record ac (Maybe Bool)
some' :: (AggregatedContext ac, SqlContext ac) => Predicate Flat -> Record ac (Maybe Bool)
over :: SqlContext c => Record OverWindow a -> Window c () -> Record c a
rank :: Integral a => Record OverWindow a
denseRank :: Integral a => Record OverWindow a
rowNumber :: Integral a => Record OverWindow a
percentRank :: Record OverWindow Double
cumeDist :: Record OverWindow Double
union :: Relation () a -> Relation () a -> Relation () a
except :: Relation () a -> Relation () a -> Relation () a
intersect :: Relation () a -> Relation () a -> Relation () a
just :: ProjectableMaybe p => p a -> p (Maybe a)
flattenMaybe :: ProjectableMaybe p => p (Maybe (Maybe a)) -> p (Maybe a)
(?!) :: PersistableWidth a => Record c (Maybe a) -> Pi a b -> Record c (Maybe b)
(?!?) :: PersistableWidth a => Record c (Maybe a) -> Pi a (Maybe b) -> Record c (Maybe b)
(<?.>) :: Pi a (Maybe b) -> Pi b c -> Pi a (Maybe c)
(<?.?>) :: Pi a (Maybe b) -> Pi b (Maybe c) -> Pi a (Maybe c)
(?+?) :: (OperatorContext c, Num a) => Record c (Maybe a) -> Record c (Maybe a) -> Record c (Maybe a)
negateMaybe :: (OperatorContext c, Num a) => Record c (Maybe a) -> Record c (Maybe a)
sumMaybe :: (Num a, AggregatedContext ac, SqlContext ac) => Record Flat (Maybe a) -> Record ac (Maybe a)
placeholder :: (PersistableWidth t, SqlContext c, Monad m) => (Record c t -> m a) -> m (PlaceHolders t, a)
query' :: MonadQuery m => Relation p r -> m (PlaceHolders p, Record Flat r)
left' :: Relation pa a -> Relation pb b -> [JoinRestriction a (Maybe b)] -> Relation (pa, pb) (a, Maybe b)
relation' :: SimpleQuery p r -> Relation p r
updateTarget' :: (Record Flat r -> Assign r (PlaceHolders p)) -> UpdateTarget p r
restriction' :: (Record Flat r -> Restrict (PlaceHolders p)) -> Restriction p r
union' :: Relation p a -> Relation q a -> Relation (p, q) a

-- | Define product isomorphic inference rule to specify record constructor
class ProductConstructor c

-- | Restricted functor on products.
class ProductIsoFunctor (f :: Type -> Type)
(|$|) :: (ProductIsoFunctor f, ProductConstructor (a -> b)) => (a -> b) -> f a -> f b
infixl 4 |$|

-- | Restricted applicative functor on products.
class ProductIsoFunctor f => ProductIsoApplicative (f :: Type -> Type)
pureP :: (ProductIsoApplicative f, ProductConstructor a) => a -> f a
(|*|) :: ProductIsoApplicative f => f (a -> b) -> f a -> f b
infixl 4 |*|
(><) :: ProductIsoApplicative p => p a -> p b -> p (a, b)
relationalQuery :: Relation p r -> Query p r
typedInsert :: PersistableWidth r => Table r -> Pi r r' -> Insert r'
typedInsertQuery :: Table r -> Pi r r' -> Relation p r' -> InsertQuery p
typedUpdate :: Table r -> (Record Flat r -> Assign r (PlaceHolders p)) -> Update p
typedDelete :: Table r -> (Record Flat r -> Restrict (PlaceHolders p)) -> Delete p
typedKeyUpdate :: Table a -> Pi a p -> KeyUpdate p a
derivedInsert :: (PersistableWidth r, TableDerivable r) => Pi r r' -> Insert r'
derivedInsertQuery :: TableDerivable r => Pi r r' -> Relation p r' -> InsertQuery p
derivedUpdate :: TableDerivable r => (Record Flat r -> Assign r (PlaceHolders p)) -> Update p
derivedDelete :: TableDerivable r => (Record Flat r -> Restrict (PlaceHolders p)) -> Delete p

-- | <a>FromSql</a> <tt>q</tt> <tt>a</tt> is implicit rule to derive
--   <a>RecordFromSql</a> <tt>q</tt> <tt>a</tt> record parser function
--   against type <tt>a</tt>.
--   
--   Generic programming
--   (<a>https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#generic-programming</a>)
--   with default signature is available for <a>FromSql</a> class, so you
--   can make instance like below:
--   
--   <pre>
--   {-# LANGUAGE DeriveGeneric #-}
--   import GHC.Generics (Generic)
--   import Database.HDBC (SqlValue)
--   --
--   data Foo = Foo { ... } deriving Generic
--   instance FromSql SqlValue Foo
--   </pre>
class FromSql q a

-- | <a>ToSql</a> <tt>q</tt> <tt>a</tt> is implicit rule to derive
--   <a>RecordToSql</a> <tt>q</tt> <tt>a</tt> record printer function for
--   type <tt>a</tt>.
--   
--   Generic programming
--   (<a>https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#generic-programming</a>)
--   with default signature is available for <a>ToSql</a> class, so you can
--   make instance like below:
--   
--   <pre>
--   {-# LANGUAGE DeriveGeneric #-}
--   import GHC.Generics (Generic)
--   import Database.HDBC (SqlValue)
--   --
--   data Foo = Foo { ... } deriving Generic
--   instance ToSql SqlValue Foo
--   </pre>
--   
--   To make instances of <a>ToSql</a> manually, <a>ToSql</a> <tt>q</tt>
--   <tt>a</tt> and <a>RecordToSql</a> 'q <tt>a</tt> are composable with
--   monadic context. When, you have data constructor and objects like
--   below.
--   
--   <pre>
--   data MyRecord = MyRecord Foo Bar Baz
--   </pre>
--   
--   <pre>
--   instance ToSql SqlValue Foo where
--     ...
--   instance ToSql SqlValue Bar where
--     ...
--   instance ToSql SqlValue Baz where
--     ...
--   </pre>
--   
--   You can get composed <a>ToSql</a> implicit rule like below.
--   
--   <pre>
--   instance ToSql SqlValue MyRecord where
--     recordToSql =
--     recordToSql = wrapToSql $ \ (MyRecord x y z) -&gt; do
--       putRecord x
--       putRecord y
--       putRecord z
--   </pre>
class PersistableWidth a => ToSql q a

-- | <a>RecordFromSql</a> <tt>q</tt> <tt>a</tt> is data-type wrapping
--   function to convert from list of database value type (to receive from
--   database) [<tt>q</tt>] into Haskell type <tt>a</tt>
--   
--   This structure is similar to parser. While running
--   <a>RecordFromSql</a> behavior is the same as non-fail-able parser
--   which parse list of database value type [<tt>q</tt>] stream.
--   
--   So, <a>RecordFromSql</a> <tt>q</tt> is <a>Monad</a> and
--   <a>Applicative</a> instance like parser monad. When, you have data
--   constructor and objects like below.
--   
--   <pre>
--   data MyRecord = MyRecord Foo Bar Baz
--   </pre>
--   
--   <pre>
--   foo :: <a>RecordFromSql</a> SqlValue Foo
--   foo =  ...
--   bar :: <a>RecordFromSql</a> SqlValue Bar
--   bar =  ...
--   baz :: <a>RecordFromSql</a> SqlValue Baz
--   baz =  ...
--   </pre>
--   
--   You can get composed <a>RecordFromSql</a> like below.
--   
--   <pre>
--   myRecord :: RecordFromSql SqlValue MyRecord
--   myRecord =  MyRecord &lt;$&gt; foo &lt;*&gt; bar &lt;*&gt; baz
--   </pre>
data RecordFromSql q a

-- | <a>RecordToSql</a> <tt>q</tt> <tt>a</tt> is data-type wrapping
--   function to convert from Haskell type <tt>a</tt> into list of database
--   value type (to send to database) [<tt>q</tt>].
--   
--   This structure is similar to printer. While running <a>RecordToSql</a>
--   behavior is the same as list printer. which appends list of database
--   value type [<tt>q</tt>] stream.
data RecordToSql q a
prepareNoFetch :: (UntypeableNoFetch s, IConnection conn) => conn -> s p -> IO (PreparedStatement p ())
bind :: ToSql SqlValue p => PreparedStatement p a -> p -> BoundStatement a
execute :: ToSql SqlValue p => PreparedStatement p a -> p -> IO (ExecutedStatement a)
executeNoFetch :: ToSql SqlValue a => PreparedStatement a () -> a -> IO Integer
prepareQuery :: IConnection conn => conn -> Query p a -> IO (PreparedQuery p a)
fetch :: FromSql SqlValue a => ExecutedStatement a -> IO (Maybe a)
runQuery :: (IConnection conn, ToSql SqlValue p, FromSql SqlValue a) => conn -> Query p a -> p -> IO [a]
runQuery' :: (IConnection conn, ToSql SqlValue p, FromSql SqlValue a) => conn -> Query p a -> p -> IO [a]
prepareInsert :: IConnection conn => conn -> Insert a -> IO (PreparedInsert a)
runInsert :: (IConnection conn, ToSql SqlValue a) => conn -> Insert a -> a -> IO Integer
prepareInsertQuery :: IConnection conn => conn -> InsertQuery p -> IO (PreparedInsertQuery p)
runInsertQuery :: (IConnection conn, ToSql SqlValue p) => conn -> InsertQuery p -> p -> IO Integer
prepareUpdate :: IConnection conn => conn -> Update p -> IO (PreparedUpdate p)
runUpdate :: (IConnection conn, ToSql SqlValue p) => conn -> Update p -> p -> IO Integer
prepareDelete :: IConnection conn => conn -> Delete p -> IO (PreparedDelete p)
runDelete :: (IConnection conn, ToSql SqlValue p) => conn -> Delete p -> p -> IO Integer
prepareKeyUpdate :: IConnection conn => conn -> KeyUpdate p a -> IO (PreparedKeyUpdate p a)
bindKeyUpdate :: ToSql SqlValue a => PreparedKeyUpdate p a -> a -> BoundStatement ()
runKeyUpdate :: (IConnection conn, ToSql SqlValue a) => conn -> KeyUpdate p a -> a -> IO Integer
