beam-core-0.7.2.0: 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 # 

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 # 
FromBackendRow be x => FromBackendRow be (Maybe x) 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 # 
(BeamBackend be, Generic (tbl Identity), Generic (tbl Exposed), GFromBackendRow be (Rep (tbl Exposed)) (Rep (tbl Identity))) => FromBackendRow be (tbl Identity) Source # 
FromBackendRow be x => FromBackendRow be (SqlSerial x) Source # 
(BeamBackend be, FromBackendRow be a, FromBackendRow be b) => FromBackendRow be (a, b) Source # 

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 # 
(BeamBackend be, FromBackendRow be t) => FromBackendRow be (Tagged * tag t) Source # 
(BeamBackend be, FromBackendRow be a, FromBackendRow be b, FromBackendRow be c) => FromBackendRow be (a, b, c) Source # 

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 # 

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 # 

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 # 

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 # 

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 # 

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

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 # 

Methods

project' :: Monad m => Proxy (* -> Constraint) 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 # 

Methods

project' :: Monad m => Proxy (* -> Constraint) 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 # 
Beamable tbl => ThreadRewritable s (tbl (Nullable (QGenExpr ctxt syntax s))) Source # 

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 # 

Methods

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

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

maybe_ :: QGenExpr ctxt syntax s y -> (t (QGenExpr ctxt syntax s) -> QGenExpr ctxt syntax s y) -> t (Nullable (QGenExpr ctxt syntax s)) -> QGenExpr ctxt 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 # 

Methods

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

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

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 # 

Methods

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

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

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 # 
(Table t, IsSql92ExpressionSyntax syntax, HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) SqlNull) => SqlJustable (t (QExpr syntax s)) (t (Nullable (QExpr syntax s))) Source # 

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 # 
(Table t, IsSql92ExpressionSyntax syntax, HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) SqlNull) => SqlJustable (PrimaryKey t (QExpr syntax s)) (PrimaryKey t (Nullable (QExpr syntax s))) Source # 

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 # 

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 # 
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 # 
type QExprToField (table (Nullable (QGenExpr context syntax s))) = table (Nullable (QField s))
type QExprToIdentity (table (Nullable c)) Source # 
type QExprToIdentity (table (Nullable c)) = Maybe (QExprToIdentity (table c))
type HaskellLiteralForQExpr (table (Nullable f)) Source # 
type WithRewrittenContext (tbl (Nullable (QGenExpr old syntax s))) ctxt Source # 
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 # 

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) #