beam-core-0.7.2.2: Type-safe, feature-complete SQL query and manipulation interface for Haskell

Safe HaskellNone
LanguageHaskell2010

Database.Beam.Backend.Types

Contents

Synopsis

Documentation

class BeamBackend be Source #

Class for all beam backends

Associated Types

type BackendFromField be :: * -> Constraint Source #

Requirements to marshal a certain type from a database of a particular backend

data FromBackendRowF be f where Source #

Constructors

ParseOneField :: BackendFromField be a => (a -> f) -> FromBackendRowF be f 
PeekField :: BackendFromField be a => (Maybe a -> f) -> FromBackendRowF be f 
CheckNextNNull :: Int -> (Bool -> f) -> FromBackendRowF be f 
Instances
Functor (FromBackendRowF be) Source # 
Instance details

Defined in Database.Beam.Backend.Types

Methods

fmap :: (a -> b) -> FromBackendRowF be a -> FromBackendRowF be b #

(<$) :: a -> FromBackendRowF be b -> FromBackendRowF be a #

class BeamBackend be => FromBackendRow be a where Source #

Instances
BeamBackend be => FromBackendRow be () Source # 
Instance details

Defined in Database.Beam.Backend.Types

FromBackendRow be x => FromBackendRow be (Maybe x) Source # 
Instance details

Defined in Database.Beam.Backend.Types

(BeamBackend be, Generic (tbl (Nullable Identity)), Generic (tbl (Nullable Exposed)), GFromBackendRow be (Rep (tbl (Nullable Exposed))) (Rep (tbl (Nullable Identity)))) => FromBackendRow be (tbl (Nullable Identity)) Source # 
Instance details

Defined in Database.Beam.Backend.Types

(BeamBackend be, Generic (tbl Identity), Generic (tbl Exposed), GFromBackendRow be (Rep (tbl Exposed)) (Rep (tbl Identity))) => FromBackendRow be (tbl Identity) Source # 
Instance details

Defined in Database.Beam.Backend.Types

FromBackendRow be x => FromBackendRow be (SqlSerial x) Source # 
Instance details

Defined in Database.Beam.Backend.SQL.Types

(BeamBackend be, FromBackendRow be a, FromBackendRow be b) => FromBackendRow be (a, b) Source # 
Instance details

Defined in Database.Beam.Backend.Types

Methods

fromBackendRow :: FromBackendRowM be (a, b) Source #

valuesNeeded :: Proxy be -> Proxy (a, b) -> Int Source #

(BeamBackend be, KnownNat n, FromBackendRow be a) => FromBackendRow be (Vector n a) Source # 
Instance details

Defined in Database.Beam.Backend.Types

(BeamBackend be, FromBackendRow be t) => FromBackendRow be (Tagged tag t) Source # 
Instance details

Defined in Database.Beam.Backend.Types

(BeamBackend be, FromBackendRow be a, FromBackendRow be b, FromBackendRow be c) => FromBackendRow be (a, b, c) Source # 
Instance details

Defined in Database.Beam.Backend.Types

Methods

fromBackendRow :: FromBackendRowM be (a, b, c) Source #

valuesNeeded :: Proxy be -> Proxy (a, b, c) -> Int Source #

(BeamBackend be, FromBackendRow be a, FromBackendRow be b, FromBackendRow be c, FromBackendRow be d) => FromBackendRow be (a, b, c, d) Source # 
Instance details

Defined in Database.Beam.Backend.Types

Methods

fromBackendRow :: FromBackendRowM be (a, b, c, d) Source #

valuesNeeded :: Proxy be -> Proxy (a, b, c, d) -> Int Source #

(BeamBackend be, FromBackendRow be a, FromBackendRow be b, FromBackendRow be c, FromBackendRow be d, FromBackendRow be e) => FromBackendRow be (a, b, c, d, e) Source # 
Instance details

Defined in Database.Beam.Backend.Types

Methods

fromBackendRow :: FromBackendRowM be (a, b, c, d, e) Source #

valuesNeeded :: Proxy be -> Proxy (a, b, c, d, e) -> Int Source #

(BeamBackend be, FromBackendRow be a, FromBackendRow be b, FromBackendRow be c, FromBackendRow be d, FromBackendRow be e, FromBackendRow be f) => FromBackendRow be (a, b, c, d, e, f) Source # 
Instance details

Defined in Database.Beam.Backend.Types

Methods

fromBackendRow :: FromBackendRowM be (a, b, c, d, e, f) Source #

valuesNeeded :: Proxy be -> Proxy (a, b, c, d, e, f) -> Int Source #

(BeamBackend be, FromBackendRow be a, FromBackendRow be b, FromBackendRow be c, FromBackendRow be d, FromBackendRow be e, FromBackendRow be f, FromBackendRow be g) => FromBackendRow be (a, b, c, d, e, f, g) Source # 
Instance details

Defined in Database.Beam.Backend.Types

Methods

fromBackendRow :: FromBackendRowM be (a, b, c, d, e, f, g) Source #

valuesNeeded :: Proxy be -> Proxy (a, b, c, d, e, f, g) -> Int Source #

(BeamBackend be, FromBackendRow be a, FromBackendRow be b, FromBackendRow be c, FromBackendRow be d, FromBackendRow be e, FromBackendRow be f, FromBackendRow be g, FromBackendRow be h) => FromBackendRow be (a, b, c, d, e, f, g, h) Source # 
Instance details

Defined in Database.Beam.Backend.Types

Methods

fromBackendRow :: FromBackendRowM be (a, b, c, d, e, f, g, h) Source #

valuesNeeded :: Proxy be -> Proxy (a, b, c, d, e, f, g, h) -> Int Source #

data Exposed x Source #

newtype mainly used to inspect tho tag structure of a particular Beamable. Prevents overlapping instances in some case. Usually not used in end-user code.

Instances
FieldsFulfillConstraintNullable c t => GFieldsFulfillConstraint c (K1 R (t (Nullable Exposed)) :: * -> *) (K1 R (t (Nullable Identity)) :: * -> *) (K1 R (t (Nullable (WithConstraint c))) :: * -> *) Source # 
Instance details

Defined in Database.Beam.Schema.Tables

FieldsFulfillConstraint c t => GFieldsFulfillConstraint c (K1 R (t Exposed) :: * -> *) (K1 R (t Identity) :: * -> *) (K1 R (t (WithConstraint c)) :: * -> *) Source # 
Instance details

Defined in Database.Beam.Schema.Tables

Methods

gWithConstrainedFields :: Proxy c -> Proxy (K1 R (t Exposed)) -> K1 R (t Identity) () -> K1 R (t (WithConstraint c)) () Source #

c x => GFieldsFulfillConstraint c (K1 R (Exposed x) :: * -> *) (K1 R x :: * -> *) (K1 R (WithConstraint c x) :: * -> *) Source # 
Instance details

Defined in Database.Beam.Schema.Tables

Methods

gWithConstrainedFields :: Proxy c -> Proxy (K1 R (Exposed x)) -> K1 R x () -> K1 R (WithConstraint c x) () Source #

data Nullable (c :: * -> *) x Source #

Support for NULLable Foreign Key references.

data MyTable f = MyTable
               { nullableRef :: PrimaryKey AnotherTable (Nullable f)
               , ... }
                deriving (Generic, Typeable)

See Columnar for more information.

Instances
(Beamable t, contextPredicate context) => ProjectibleWithPredicate contextPredicate syntax (t (Nullable (QGenExpr context syntax s))) Source # 
Instance details

Defined in Database.Beam.Query.Internal

Methods

project' :: Monad m => Proxy contextPredicate -> (forall context0. contextPredicate context0 => Proxy context0 -> WithExprContext syntax -> m (WithExprContext syntax)) -> t (Nullable (QGenExpr context syntax s)) -> m (t (Nullable (QGenExpr context syntax s))) Source #

Beamable t => ProjectibleWithPredicate AnyType Text (t (Nullable (QField s))) Source # 
Instance details

Defined in Database.Beam.Query.Internal

Methods

project' :: Monad m => Proxy AnyType -> (forall context. AnyType context => Proxy context -> WithExprContext Text -> m (WithExprContext Text)) -> t (Nullable (QField s)) -> m (t (Nullable (QField s))) Source #

(BeamBackend be, Generic (tbl (Nullable Identity)), Generic (tbl (Nullable Exposed)), GFromBackendRow be (Rep (tbl (Nullable Exposed))) (Rep (tbl (Nullable Identity)))) => FromBackendRow be (tbl (Nullable Identity)) Source # 
Instance details

Defined in Database.Beam.Backend.Types

Beamable tbl => ThreadRewritable s (tbl (Nullable (QGenExpr ctxt syntax s))) Source # 
Instance details

Defined in Database.Beam.Query.Internal

Associated Types

type WithRewrittenThread s s' (tbl (Nullable (QGenExpr ctxt syntax s))) :: * Source #

Methods

rewriteThread :: Proxy s' -> tbl (Nullable (QGenExpr ctxt syntax s)) -> WithRewrittenThread s s' (tbl (Nullable (QGenExpr ctxt syntax s))) Source #

(IsSql92ExpressionSyntax syntax, HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) Bool, Beamable t) => SqlDeconstructMaybe syntax (t (Nullable (QGenExpr ctxt syntax s))) (t (QGenExpr ctxt syntax s)) s Source # 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

isJust_ :: t (Nullable (QGenExpr ctxt syntax s)) -> QGenExpr ctxt0 syntax s Bool Source #

isNothing_ :: t (Nullable (QGenExpr ctxt syntax s)) -> QGenExpr ctxt0 syntax s Bool Source #

maybe_ :: QGenExpr ctxt0 syntax s y -> (t (QGenExpr ctxt syntax s) -> QGenExpr ctxt0 syntax s y) -> t (Nullable (QGenExpr ctxt syntax s)) -> QGenExpr ctxt0 syntax s y Source #

FieldsFulfillConstraintNullable c t => GFieldsFulfillConstraint c (K1 R (t (Nullable Exposed)) :: * -> *) (K1 R (t (Nullable Identity)) :: * -> *) (K1 R (t (Nullable (WithConstraint c))) :: * -> *) Source # 
Instance details

Defined in Database.Beam.Schema.Tables

Beamable tbl => ContextRewritable (tbl (Nullable (QGenExpr old syntax s))) Source # 
Instance details

Defined in Database.Beam.Query.Internal

Associated Types

type WithRewrittenContext (tbl (Nullable (QGenExpr old syntax s))) ctxt :: * Source #

Methods

rewriteContext :: Proxy ctxt -> tbl (Nullable (QGenExpr old syntax s)) -> WithRewrittenContext (tbl (Nullable (QGenExpr old syntax s))) ctxt Source #

(Beamable table, IsSql92ExpressionSyntax syntax, FieldsFulfillConstraintNullable (HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax)) table) => SqlValable (table (Nullable (QGenExpr ctxt syntax s))) Source # 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

val_ :: HaskellLiteralForQExpr (table (Nullable (QGenExpr ctxt syntax s))) -> table (Nullable (QGenExpr ctxt syntax s)) Source #

TagReducesTo f f' => TagReducesTo (Nullable f) f' Source # 
Instance details

Defined in Database.Beam.Schema.Tables

Methods

reduceTag :: Functor m => (Columnar' f' a' -> m (Columnar' f' a')) -> Columnar' (Nullable f) a -> m (Columnar' (Nullable f) a) Source #

Table t => SqlJustable (t Identity) (t (Nullable Identity)) Source # 
Instance details

Defined in Database.Beam.Query.Combinators

(Table t, IsSql92ExpressionSyntax syntax, HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) SqlNull) => SqlJustable (t (QExpr syntax s)) (t (Nullable (QExpr syntax s))) Source # 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

just_ :: t (QExpr syntax s) -> t (Nullable (QExpr syntax s)) Source #

nothing_ :: t (Nullable (QExpr syntax s)) Source #

Table t => SqlJustable (PrimaryKey t Identity) (PrimaryKey t (Nullable Identity)) Source # 
Instance details

Defined in Database.Beam.Query.Combinators

(Table t, IsSql92ExpressionSyntax syntax, HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) SqlNull) => SqlJustable (PrimaryKey t (QExpr syntax s)) (PrimaryKey t (Nullable (QExpr syntax s))) Source # 
Instance details

Defined in Database.Beam.Query.Combinators

Methods

just_ :: PrimaryKey t (QExpr syntax s) -> PrimaryKey t (Nullable (QExpr syntax s)) Source #

nothing_ :: PrimaryKey t (Nullable (QExpr syntax s)) Source #

(IsSql92ExpressionSyntax syntax, FieldsFulfillConstraintNullable (HasSqlEqualityCheck syntax) tbl, HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) Bool, Beamable tbl) => SqlEq (QGenExpr context syntax s) (tbl (Nullable (QGenExpr context syntax s))) Source # 
Instance details

Defined in Database.Beam.Query.Ord

Methods

(==.) :: tbl (Nullable (QGenExpr context syntax s)) -> tbl (Nullable (QGenExpr context syntax s)) -> QGenExpr context syntax s Bool Source #

(/=.) :: tbl (Nullable (QGenExpr context syntax s)) -> tbl (Nullable (QGenExpr context syntax s)) -> QGenExpr context syntax s Bool Source #

(==?.) :: tbl (Nullable (QGenExpr context syntax s)) -> tbl (Nullable (QGenExpr context syntax s)) -> QGenExpr context syntax s SqlBool Source #

(/=?.) :: tbl (Nullable (QGenExpr context syntax s)) -> tbl (Nullable (QGenExpr context syntax s)) -> QGenExpr context syntax s SqlBool Source #

type WithRewrittenThread s s' (tbl (Nullable (QGenExpr ctxt syntax s))) Source # 
Instance details

Defined in Database.Beam.Query.Internal

type WithRewrittenThread s s' (tbl (Nullable (QGenExpr ctxt syntax s))) = tbl (Nullable (QGenExpr ctxt syntax s'))
type QExprToField (table (Nullable (QGenExpr context syntax s))) Source # 
Instance details

Defined in Database.Beam.Query.Types

type QExprToField (table (Nullable (QGenExpr context syntax s))) = table (Nullable (QField s))
type QExprToIdentity (table (Nullable c)) Source # 
Instance details

Defined in Database.Beam.Query.Types

type QExprToIdentity (table (Nullable c)) = Maybe (QExprToIdentity (table c))
type HaskellLiteralForQExpr (table (Nullable f)) Source # 
Instance details

Defined in Database.Beam.Query.Combinators

type WithRewrittenContext (tbl (Nullable (QGenExpr old syntax s))) ctxt Source # 
Instance details

Defined in Database.Beam.Query.Internal

type WithRewrittenContext (tbl (Nullable (QGenExpr old syntax s))) ctxt = tbl (Nullable (QGenExpr ctxt syntax s))

Orphan instances

Generic (a, b, c, d, e, f, g, h) Source # 
Instance details

Associated Types

type Rep (a, b, c, d, e, f, g, h) :: * -> * #

Methods

from :: (a, b, c, d, e, f, g, h) -> Rep (a, b, c, d, e, f, g, h) x #

to :: Rep (a, b, c, d, e, f, g, h) x -> (a, b, c, d, e, f, g, h) #