Database.Beam.Schema.Tables: exported symbols usage examples

Symbols

  • :*: No usage example found for this symbol :( Collapse [-]
    Exposed No usage example found for this symbol :( Collapse [-]
    Nullable No usage example found for this symbol :( Collapse [-]
    allBeamValues See 9 Occurences [+] Collapse [-]
    Found in Database.Beam.Query from the package beam-core
         -> SqlUpdate syntax table
    save tbl@(DatabaseEntity (DatabaseTable _ tblSettings)) v =
      update tbl (\(tblField :: table (QField s)) ->
                    execWriter $
                    zipBeamFieldsM
                      (\(Columnar' field) c@(Columnar' value) ->
                         do when (qFieldName field `notElem` primaryKeyFieldNames) $
                              tell [ field <-. value ]
                            pure c)
                      tblField (val_ v :: table (QExpr (Sql92UpdateExpressionSyntax syntax) s)))
                 (\tblE -> primaryKey tblE ==. val_ (primaryKey v))
    
      where
        primaryKeyFieldNames =
          allBeamValues (\(Columnar' (TableField fieldNm)) -> fieldNm) (primaryKey tblSettings)
    
    -- | Run a 'SqlUpdate' in a 'MonadBeam'.
    runUpdate :: (IsSql92Syntax cmd, MonadBeam cmd be hdl m)
              => SqlUpdate (Sql92UpdateSyntax cmd) tbl -> m ()
    runUpdate (SqlUpdate u) = runNoReturn (updateCmd u)
    

    Found in Database.Beam.Query from the package beam-core
    insertExpressions ::
        forall syntax table s.
        ( Beamable table
        , IsSql92InsertValuesSyntax syntax ) =>
        (forall s'. [ table (QExpr (Sql92InsertValuesExpressionSyntax syntax) s') ]) ->
        SqlInsertValues syntax (table (QExpr (Sql92InsertValuesExpressionSyntax syntax) s))
    insertExpressions tbls =
      case sqlExprs of
        [] -> SqlInsertValuesEmpty
        _  -> SqlInsertValues (insertSqlExpressions sqlExprs)
        where
          sqlExprs = map mkSqlExprs tbls
    
          mkSqlExprs :: forall s'. table (QExpr (Sql92InsertValuesExpressionSyntax syntax) s') -> [Sql92InsertValuesExpressionSyntax syntax]
          mkSqlExprs = allBeamValues (\(Columnar' (QExpr x)) -> x "t")
    
    -- | Build a 'SqlInsertValues' from concrete table values
    insertValues ::
        forall table syntax s.
        ( Beamable table
    

    Found in Database.Beam.Query.Combinators from the package beam-core
    instance IsSql92ExpressionSyntax syntax => SqlDeconstructMaybe syntax (QGenExpr ctxt syntax s (Maybe x)) (QGenExpr ctxt syntax s x) s where
        isJust_ (QExpr x) = QExpr (isNotNullE <$> x)
        isNothing_ (QExpr x) = QExpr (isNullE <$> x)
    
        maybe_ (QExpr onNothing) onJust (QExpr e) =
            let QExpr onJust' = onJust (QExpr e)
            in QExpr (\tbl -> caseE [(isNotNullE (e tbl), onJust' tbl)] (onNothing tbl))
    
    instance ( IsSql92ExpressionSyntax syntax
             , HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) Bool
             , Beamable t )
        => SqlDeconstructMaybe syntax (t (Nullable (QGenExpr ctxt syntax s))) (t (QGenExpr ctxt syntax s)) s where
        isJust_ t = allE (allBeamValues (\(Columnar' e) -> isJust_ e) t)
        isNothing_ t = allE (allBeamValues (\(Columnar' e) -> isNothing_ e) t)
        maybe_ (QExpr onNothing) onJust tbl =
          let QExpr onJust' = onJust (changeBeamRep (\(Columnar' (QExpr e)) -> Columnar' (QExpr e)) tbl)
              QExpr cond = isJust_ tbl
          in QExpr (\tblPfx -> caseE [(cond tblPfx, onJust' tblPfx)] (onNothing tblPfx))
    

    Found in Database.Beam.Query.Combinators from the package beam-core
        maybe_ :: QGenExpr ctxt syntax s y -> (nonNullA -> QGenExpr ctxt syntax s y) -> a -> QGenExpr ctxt syntax s y
    
    instance IsSql92ExpressionSyntax syntax => SqlDeconstructMaybe syntax (QGenExpr ctxt syntax s (Maybe x)) (QGenExpr ctxt syntax s x) s where
        isJust_ (QExpr x) = QExpr (isNotNullE <$> x)
        isNothing_ (QExpr x) = QExpr (isNullE <$> x)
    
        maybe_ (QExpr onNothing) onJust (QExpr e) =
            let QExpr onJust' = onJust (QExpr e)
            in QExpr (\tbl -> caseE [(isNotNullE (e tbl), onJust' tbl)] (onNothing tbl))
    
    instance ( IsSql92ExpressionSyntax syntax
             , HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) Bool
             , Beamable t )
        => SqlDeconstructMaybe syntax (t (Nullable (QGenExpr ctxt syntax s))) (t (QGenExpr ctxt syntax s)) s where
        isJust_ t = allE (allBeamValues (\(Columnar' e) -> isJust_ e) t)
        isNothing_ t = allE (allBeamValues (\(Columnar' e) -> isNothing_ e) t)
        maybe_ (QExpr onNothing) onJust tbl =
          let QExpr onJust' = onJust (changeBeamRep (\(Columnar' (QExpr e)) -> Columnar' (QExpr e)) tbl)
              QExpr cond = isJust_ tbl
          in QExpr (\tblPfx -> caseE [(cond tblPfx, onJust' tblPfx)] (onNothing tblPfx))
    

    Found in Database.Beam.Query.Combinators from the package beam-core
               IsSql92FieldNameSyntax fieldName
            => lhs
            -> rhs
            -> QAssignment fieldName expr s
    instance SqlUpdatable expr s (QField s a) (QExpr expr s a) where
      QField _ _ nm <-. QExpr expr =
        QAssignment [(unqualifiedField nm, expr "t")]
    instance Beamable tbl => SqlUpdatable expr s (tbl (QField s)) (tbl (QExpr expr s)) where
      (<-.) :: forall fieldName.
               IsSql92FieldNameSyntax fieldName
            => tbl (QField s) -> tbl (QExpr expr s)
            -> QAssignment fieldName expr s
      lhs <-. rhs =
        QAssignment $
        allBeamValues (\(Columnar' (Const assignments)) -> assignments) $
        runIdentity $
        zipBeamFieldsM (\(Columnar' (QField _ _ f) :: Columnar' (QField s) t) (Columnar' (QExpr e)) ->
                           pure (Columnar' (Const (unqualifiedField f, e "t")) :: Columnar' (Const (fieldName,expr)) t)) lhs rhs
    instance Beamable tbl => SqlUpdatable expr s (tbl (Nullable (QField s))) (tbl (Nullable (QExpr expr s))) where
      lhs <-. rhs =
    

    Found in Database.Beam.Migrate.SQL.Tables from the package beam-migrate
               createTableSyntax Nothing newTblName
                                 (allBeamValues (\(Columnar' (TableFieldSchema name (FieldSchema schema) _)) -> (name, schema)) tblSettings)
                                 [ primaryKeyConstraintSyntax (allBeamValues (\(Columnar' (TableFieldSchema name _ _)) -> name) (primaryKey tblSettings)) ]
    
             command = createTableCmd createTableCommand
    
             tbl' = changeBeamRep (\(Columnar' (TableFieldSchema name _ _)) -> Columnar' (TableField name)) tblSettings
    
             fieldChecks = changeBeamRep (\(Columnar' (TableFieldSchema _ _ cs)) -> Columnar' (Const cs)) tblSettings
    
             tblChecks = [ TableCheck (\tblName _ -> SomeDatabasePredicate (TableExistsPredicate tblName)) ] ++
                         primaryKeyCheck
    
             primaryKeyCheck =
               case allBeamValues (\(Columnar' (TableFieldSchema name _ _)) -> name) (primaryKey tblSettings) of
                 [] -> []
                 cols -> [ TableCheck (\tblName _ -> SomeDatabasePredicate (TableHasPrimaryKey tblName cols)) ]
    
         upDown command Nothing
         pure (CheckedDatabaseEntity (CheckedDatabaseTable (DatabaseTable newTblName tbl') tblChecks fieldChecks) [])
    

    Found in Database.Beam.Migrate.SQL.Tables from the package beam-migrate
    -- | Add a @CREATE TABLE@ statement to this migration
    --
    --   The first argument is the name of the table.
    --
    --   The second argument is a table containing a 'FieldSchema' for each field.
    --   See documentation on the 'Field' command for more information.
    createTable :: ( Beamable table, Table table
                   , IsSql92DdlCommandSyntax syntax ) =>
                   Text -> TableSchema (Sql92CreateTableColumnSchemaSyntax (Sql92DdlCommandCreateTableSyntax syntax)) table
                -> Migration syntax (CheckedDatabaseEntity be db (TableEntity table))
    createTable newTblName tblSettings =
      do let createTableCommand =
               createTableSyntax Nothing newTblName
                                 (allBeamValues (\(Columnar' (TableFieldSchema name (FieldSchema schema) _)) -> (name, schema)) tblSettings)
                                 [ primaryKeyConstraintSyntax (allBeamValues (\(Columnar' (TableFieldSchema name _ _)) -> name) (primaryKey tblSettings)) ]
    
             command = createTableCmd createTableCommand
    
             tbl' = changeBeamRep (\(Columnar' (TableFieldSchema name _ _)) -> Columnar' (TableField name)) tblSettings
    

    Found in Database.Beam.Migrate.SQL.Tables from the package beam-migrate
    -- | Add a @CREATE TABLE@ statement to this migration
    --
    --   The first argument is the name of the table.
    --
    --   The second argument is a table containing a 'FieldSchema' for each field.
    --   See documentation on the 'Field' command for more information.
    createTable :: ( Beamable table, Table table
                   , IsSql92DdlCommandSyntax syntax ) =>
                   Text -> TableSchema (Sql92CreateTableColumnSchemaSyntax (Sql92DdlCommandCreateTableSyntax syntax)) table
                -> Migration syntax (CheckedDatabaseEntity be db (TableEntity table))
    createTable newTblName tblSettings =
      do let createTableCommand =
               createTableSyntax Nothing newTblName
                                 (allBeamValues (\(Columnar' (TableFieldSchema name (FieldSchema schema) _)) -> (name, schema)) tblSettings)
                                 [ primaryKeyConstraintSyntax (allBeamValues (\(Columnar' (TableFieldSchema name _ _)) -> name) (primaryKey tblSettings)) ]
    
             command = createTableCmd createTableCommand
    
             tbl' = changeBeamRep (\(Columnar' (TableFieldSchema name _ _)) -> Columnar' (TableField name)) tblSettings
    

    Found in Database.Beam.Migrate.Types.CheckedEntities from the package beam-migrate
      unCheck (CheckedDatabaseTable x _ _) = x
    
      collectEntityChecks (CheckedDatabaseTable (DatabaseTable tbl tblFields) tblChecks tblFieldChecks) =
        map (\(TableCheck mkCheck) -> mkCheck tbl tblFields) tblChecks <>
        execWriter (zipBeamFieldsM (\(Columnar' (TableField fieldNm)) c@(Columnar' (Const fieldChecks)) ->
                                        tell (map (\(FieldCheck mkCheck) -> mkCheck tbl fieldNm) fieldChecks) >>
                                        pure c)
                                   tblFields tblFieldChecks)
    
      checkedDbEntityAuto syntax tblTypeName =
        let tblChecks =
              [ TableCheck (\tblName _ -> SomeDatabasePredicate (TableExistsPredicate tblName))
              , TableCheck (\tblName tblFields ->
                               let pkFields = allBeamValues (\(Columnar' (TableField x)) -> x) (primaryKey tblFields)
                               in SomeDatabasePredicate (TableHasPrimaryKey tblName pkFields)) ]
    
            fieldChecks = to (gDefaultTblSettingsChecks syntax (Proxy @(Rep (tbl Identity))) False)
        in CheckedDatabaseTable (dbEntityAuto tblTypeName) tblChecks fieldChecks
    

    alongsideTable See 4 Occurences [+] Collapse [-]
    Found in Database.Beam.Query.Ord from the package beam-core
                                                        case expr of
                                                          Nothing -> Just $ x ==. y
                                                          Just expr' -> Just $ expr' &&. x ==. y)
                                              return x')
                                          (withNullableConstraints @(HasSqlEqualityCheck syntax) `alongsideTable` a) b) Nothing
                in fromMaybe (QExpr (\_ -> valueE (sqlValueSyntax True))) e
      a /=. b = not_ (a ==. b)
    
      a ==?. b = let (_, e) = runState (zipBeamFieldsM
                                        (\x'@(Columnar' (Columnar' (WithConstraint _) :*: Columnar' x)) (Columnar' y) ->
                                            do modify (\expr ->
                                                         case expr of
                                                           Nothing -> Just $ x ==?. y
                                                           Just expr' -> Just $ expr' &&?. x ==?. y)
                                               return x') (withNullableConstraints @(HasSqlEqualityCheck syntax) `alongsideTable` a) b) Nothing
                in fromMaybe (QExpr (\_ -> valueE (sqlValueSyntax True))) e
      a /=?. b = sqlNot_ (a ==?. b)
    
    
    -- * Comparisons
    

    Found in Database.Beam.Query.Ord from the package beam-core
    instance ( IsSql92ExpressionSyntax syntax
             , FieldsFulfillConstraintNullable (HasSqlEqualityCheck syntax) tbl
             , HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) Bool
             , Beamable tbl)
        => SqlEq (QGenExpr context syntax s) (tbl (Nullable (QGenExpr context syntax s))) where
    
      a ==. b = let (_, e) = runState (zipBeamFieldsM
                                          (\x'@(Columnar' (Columnar' (WithConstraint _) :*: Columnar' x)) (Columnar' y) -> do
                                              modify (\expr ->
                                                        case expr of
                                                          Nothing -> Just $ x ==. y
                                                          Just expr' -> Just $ expr' &&. x ==. y)
                                              return x')
                                          (withNullableConstraints @(HasSqlEqualityCheck syntax) `alongsideTable` a) b) Nothing
                in fromMaybe (QExpr (\_ -> valueE (sqlValueSyntax True))) e
      a /=. b = not_ (a ==. b)
    
      a ==?. b = let (_, e) = runState (zipBeamFieldsM
                                        (\x'@(Columnar' (Columnar' (WithConstraint _) :*: Columnar' x)) (Columnar' y) ->
    

    Found in Database.Beam.Query.Ord from the package beam-core
                                           do modify (\expr ->
                                                        case expr of
                                                          Nothing -> Just $ x ==. y
                                                          Just expr' -> Just $ expr' &&. x ==. y)
                                              return x') (withConstraints @(HasSqlEqualityCheck syntax) `alongsideTable` a) b) Nothing
                in fromMaybe (QExpr (\_ -> valueE (sqlValueSyntax True))) e
      a /=. b = not_ (a ==. b)
    
      a ==?. b = let (_, e) = runState (zipBeamFieldsM
                                        (\x'@(Columnar' (Columnar' (WithConstraint _) :*: Columnar' x)) (Columnar' y) ->
                                            do modify (\expr ->
                                                         case expr of
                                                           Nothing -> Just $ x ==?. y
                                                           Just expr' -> Just $ expr' &&?. x ==?. y)
                                               return x') (withConstraints @(HasSqlEqualityCheck syntax) `alongsideTable` a) b) Nothing
                in fromMaybe (QExpr (\_ -> valueE (sqlValueSyntax True))) e
      a /=?. b = sqlNot_ (a ==?. b)
    
    instance ( IsSql92ExpressionSyntax syntax
             , FieldsFulfillConstraintNullable (HasSqlEqualityCheck syntax) tbl
    

    Found in Database.Beam.Query.Ord from the package beam-core
      (FieldsFulfillConstraintNullable (HasSqlEqualityCheck expr) tbl, Beamable tbl)
    
    -- | Compare two arbitrary 'Beamable' types containing 'QGenExpr's for equality.
    instance ( IsSql92ExpressionSyntax syntax, FieldsFulfillConstraint (HasSqlEqualityCheck syntax) tbl
             , HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) Bool
             , Beamable tbl ) =>
             SqlEq (QGenExpr context syntax s) (tbl (QGenExpr context syntax s)) where
    
      a ==. b = let (_, e) = runState (zipBeamFieldsM
                                       (\x'@(Columnar' (Columnar' (WithConstraint _) :*: Columnar' x)) (Columnar' y) ->
                                           do modify (\expr ->
                                                        case expr of
                                                          Nothing -> Just $ x ==. y
                                                          Just expr' -> Just $ expr' &&. x ==. y)
                                              return x') (withConstraints @(HasSqlEqualityCheck syntax) `alongsideTable` a) b) Nothing
                in fromMaybe (QExpr (\_ -> valueE (sqlValueSyntax True))) e
      a /=. b = not_ (a ==. b)
    
      a ==?. b = let (_, e) = runState (zipBeamFieldsM
                                        (\x'@(Columnar' (Columnar' (WithConstraint _) :*: Columnar' x)) (Columnar' y) ->
    

    changeBeamRep See 28 Occurences [+] Collapse [-]
    Found in Database.Beam.Query from the package beam-core
           => DatabaseEntity be db (TableEntity table)
              -- ^ Table to delete from
           -> (forall s. (forall s'. table (QExpr (Sql92DeleteExpressionSyntax delete) s')) -> QExpr (Sql92DeleteExpressionSyntax delete) s Bool)
              -- ^ Build a @WHERE@ clause given a table containing expressions
           -> SqlDelete delete table
    delete (DatabaseEntity (DatabaseTable tblNm tblSettings)) mkWhere =
      SqlDelete (deleteStmt tblNm alias (Just (where_ "t")))
      where
        supportsAlias = deleteSupportsAlias (Proxy @delete)
    
        tgtName = "delete_target"
        alias = if supportsAlias then Just tgtName else Nothing
        mkField = if supportsAlias then qualifiedField tgtName else unqualifiedField
    
        QExpr where_ = mkWhere (changeBeamRep (\(Columnar' (TableField name)) -> Columnar' (QExpr (pure (fieldE (mkField name))))) tblSettings)
    
    -- | Run a 'SqlDelete' in a 'MonadBeam'
    runDelete :: (IsSql92Syntax cmd, MonadBeam cmd be hdl m)
              => SqlDelete (Sql92DeleteSyntax cmd) table -> m ()
    runDelete (SqlDelete d) = runNoReturn (deleteCmd d)
    

    Found in Database.Beam.Query from the package beam-core
           -> (forall s. table (QField s) -> [ QAssignment (Sql92UpdateFieldNameSyntax syntax) (Sql92UpdateExpressionSyntax syntax) s ])
              -- ^ A sequence of assignments to make.
           -> (forall s. table (QExpr (Sql92UpdateExpressionSyntax syntax) s) -> QExpr (Sql92UpdateExpressionSyntax syntax) s Bool)
              -- ^ Build a @WHERE@ clause given a table containing expressions
           -> SqlUpdate syntax table
    update (DatabaseEntity (DatabaseTable tblNm tblSettings)) mkAssignments mkWhere =
      case assignments of
        [] -> SqlIdentityUpdate
        _  -> SqlUpdate (updateStmt tblNm assignments (Just (where_ "t")))
      where
        assignments = concatMap (\(QAssignment as) -> as) (mkAssignments tblFields)
        QExpr where_ = mkWhere tblFieldExprs
    
        tblFields = changeBeamRep (\(Columnar' (TableField name)) -> Columnar' (QField False tblNm name)) tblSettings
        tblFieldExprs = changeBeamRep (\(Columnar' (QField _ _ nm)) -> Columnar' (QExpr (pure (fieldE (unqualifiedField nm))))) tblFields
    
    -- | Generate a 'SqlUpdate' that will update the given table with the given value.
    --
    --   The SQL @UPDATE@ that is generated will set every non-primary key field for
    --   the row where each primary key field is exactly what is given.
    

    Found in Database.Beam.Query from the package beam-core
              -- ^ The table to insert into
           -> (forall s. table (QField s) -> [ QAssignment (Sql92UpdateFieldNameSyntax syntax) (Sql92UpdateExpressionSyntax syntax) s ])
              -- ^ A sequence of assignments to make.
           -> (forall s. table (QExpr (Sql92UpdateExpressionSyntax syntax) s) -> QExpr (Sql92UpdateExpressionSyntax syntax) s Bool)
              -- ^ Build a @WHERE@ clause given a table containing expressions
           -> SqlUpdate syntax table
    update (DatabaseEntity (DatabaseTable tblNm tblSettings)) mkAssignments mkWhere =
      case assignments of
        [] -> SqlIdentityUpdate
        _  -> SqlUpdate (updateStmt tblNm assignments (Just (where_ "t")))
      where
        assignments = concatMap (\(QAssignment as) -> as) (mkAssignments tblFields)
        QExpr where_ = mkWhere tblFieldExprs
    
        tblFields = changeBeamRep (\(Columnar' (TableField name)) -> Columnar' (QField False tblNm name)) tblSettings
        tblFieldExprs = changeBeamRep (\(Columnar' (QField _ _ nm)) -> Columnar' (QExpr (pure (fieldE (unqualifiedField nm))))) tblFields
    
    -- | Generate a 'SqlUpdate' that will update the given table with the given value.
    --
    --   The SQL @UPDATE@ that is generated will set every non-primary key field for
    

    Found in Database.Beam.Query from the package beam-core
      | SqlInsertNoRows
    
    -- | Generate a 'SqlInsert' over only certain fields of a table
    insertOnly :: ( IsSql92InsertSyntax syntax, Projectible Text (QExprToField r) )
               => DatabaseEntity be db (TableEntity table)
                  -- ^ Table to insert into
               -> (table (QField s) -> QExprToField r)
               -> SqlInsertValues (Sql92InsertValuesSyntax syntax) r
                  -- ^ Values to insert. See 'insertValues', 'insertExpressions', 'insertData', and 'insertFrom' for possibilities.
               -> SqlInsert syntax
    insertOnly _ _ SqlInsertValuesEmpty = SqlInsertNoRows
    insertOnly (DatabaseEntity (DatabaseTable tblNm tblSettings)) mkProj (SqlInsertValues vs) =
        SqlInsert (insertStmt tblNm proj vs)
      where
        tblFields = changeBeamRep (\(Columnar' (TableField name)) -> Columnar' (QField False tblNm name)) tblSettings
        proj = execWriter (project' (Proxy @AnyType) (\_ f -> tell [f ""] >> pure f)
                                    (mkProj tblFields))
    
    -- | Generate a 'SqlInsert' given a table and a source of values.
    insert :: ( IsSql92InsertSyntax syntax, Projectible Text (table (QField s)) )
    

    Found in Database.Beam.Query.Internal from the package beam-core
        ( rewriteThread s' a, rewriteThread s' b, rewriteThread s' c, rewriteThread s' d
        , rewriteThread s' e, rewriteThread s' f, rewriteThread s' g, rewriteThread s' h )
    
    class ContextRewritable a where
      type WithRewrittenContext a ctxt :: *
    
      rewriteContext :: Proxy ctxt -> a -> WithRewrittenContext a ctxt
    instance Beamable tbl => ContextRewritable (tbl (QGenExpr old syntax s)) where
      type WithRewrittenContext (tbl (QGenExpr old syntax s)) ctxt = tbl (QGenExpr ctxt syntax s)
    
      rewriteContext _ = changeBeamRep (\(Columnar' (QExpr a)) -> Columnar' (QExpr a))
    instance Beamable tbl => ContextRewritable (tbl (Nullable (QGenExpr old syntax s))) where
      type WithRewrittenContext (tbl (Nullable (QGenExpr old syntax s))) ctxt = tbl (Nullable (QGenExpr ctxt syntax s))
    
      rewriteContext _ = changeBeamRep (\(Columnar' (QExpr a)) -> Columnar' (QExpr a))
    instance ContextRewritable (QGenExpr old syntax s a) where
      type WithRewrittenContext (QGenExpr old syntax s a) ctxt = QGenExpr ctxt syntax s a
      rewriteContext _ (QExpr a) = QExpr a
    instance ContextRewritable a => ContextRewritable [a] where
      type WithRewrittenContext [a] ctxt = [ WithRewrittenContext a ctxt ]
    

    Found in Database.Beam.Query.Internal from the package beam-core
      type WithRewrittenThread s s' (a, b, c, d, e, f, g, h) =
        ( WithRewrittenThread s s' a, WithRewrittenThread s s' b, WithRewrittenThread s s' c, WithRewrittenThread s s' d
        , WithRewrittenThread s s' e, WithRewrittenThread s s' f, WithRewrittenThread s s' g, WithRewrittenThread s s' h)
      rewriteThread s' (a, b, c, d, e, f, g, h) =
        ( rewriteThread s' a, rewriteThread s' b, rewriteThread s' c, rewriteThread s' d
        , rewriteThread s' e, rewriteThread s' f, rewriteThread s' g, rewriteThread s' h )
    
    class ContextRewritable a where
      type WithRewrittenContext a ctxt :: *
    
      rewriteContext :: Proxy ctxt -> a -> WithRewrittenContext a ctxt
    instance Beamable tbl => ContextRewritable (tbl (QGenExpr old syntax s)) where
      type WithRewrittenContext (tbl (QGenExpr old syntax s)) ctxt = tbl (QGenExpr ctxt syntax s)
    
      rewriteContext _ = changeBeamRep (\(Columnar' (QExpr a)) -> Columnar' (QExpr a))
    instance Beamable tbl => ContextRewritable (tbl (Nullable (QGenExpr old syntax s))) where
      type WithRewrittenContext (tbl (Nullable (QGenExpr old syntax s))) ctxt = tbl (Nullable (QGenExpr ctxt syntax s))
    
      rewriteContext _ = changeBeamRep (\(Columnar' (QExpr a)) -> Columnar' (QExpr a))
    instance ContextRewritable (QGenExpr old syntax s a) where
    

    Found in Database.Beam.Query.Internal from the package beam-core
        ValueContextSuggestion _ = 'Text ""
    
    type Projectible = ProjectibleWithPredicate AnyType
    type ProjectibleValue = ProjectibleWithPredicate ValueContext
    
    class ThreadRewritable (s :: *) (a :: *) | a -> s where
      type WithRewrittenThread s (s' :: *) a :: *
    
      rewriteThread :: Proxy s' -> a -> WithRewrittenThread s s' a
    instance Beamable tbl => ThreadRewritable s (tbl (QGenExpr ctxt syntax s)) where
      type WithRewrittenThread s s' (tbl (QGenExpr ctxt syntax s)) = tbl (QGenExpr ctxt syntax s')
      rewriteThread _ = changeBeamRep (\(Columnar' (QExpr a)) -> Columnar' (QExpr a))
    instance Beamable tbl => ThreadRewritable s (tbl (Nullable (QGenExpr ctxt syntax s))) where
      type WithRewrittenThread s s' (tbl (Nullable (QGenExpr ctxt syntax s))) = tbl (Nullable (QGenExpr ctxt syntax s'))
      rewriteThread _ = changeBeamRep (\(Columnar' (QExpr a)) -> Columnar' (QExpr a))
    instance ThreadRewritable s (QGenExpr ctxt syntax s a) where
      type WithRewrittenThread s s' (QGenExpr ctxt syntax s a) = QGenExpr ctxt syntax s' a
      rewriteThread _ (QExpr a) = QExpr a
    instance ThreadRewritable s a => ThreadRewritable s [a] where
      type WithRewrittenThread s s' [a] = [WithRewrittenThread s s' a]
    

    Found in Database.Beam.Query.Internal from the package beam-core
        ValueContextSuggestion QAggregateContext = ('Text "Aggregate functions and groupings cannot be contained in value expressions." :$$:
                                                    'Text "Use 'aggregate_' to compute aggregations at the value level.")
        ValueContextSuggestion QGroupingContext = ValueContextSuggestion QAggregateContext
        ValueContextSuggestion _ = 'Text ""
    
    type Projectible = ProjectibleWithPredicate AnyType
    type ProjectibleValue = ProjectibleWithPredicate ValueContext
    
    class ThreadRewritable (s :: *) (a :: *) | a -> s where
      type WithRewrittenThread s (s' :: *) a :: *
    
      rewriteThread :: Proxy s' -> a -> WithRewrittenThread s s' a
    instance Beamable tbl => ThreadRewritable s (tbl (QGenExpr ctxt syntax s)) where
      type WithRewrittenThread s s' (tbl (QGenExpr ctxt syntax s)) = tbl (QGenExpr ctxt syntax s')
      rewriteThread _ = changeBeamRep (\(Columnar' (QExpr a)) -> Columnar' (QExpr a))
    instance Beamable tbl => ThreadRewritable s (tbl (Nullable (QGenExpr ctxt syntax s))) where
      type WithRewrittenThread s s' (tbl (Nullable (QGenExpr ctxt syntax s))) = tbl (Nullable (QGenExpr ctxt syntax s'))
      rewriteThread _ = changeBeamRep (\(Columnar' (QExpr a)) -> Columnar' (QExpr a))
    instance ThreadRewritable s (QGenExpr ctxt syntax s a) where
      type WithRewrittenThread s s' (QGenExpr ctxt syntax s a) = QGenExpr ctxt syntax s' a
    

    Found in Database.Beam.Query.SQL92 from the package beam-core
              Just oldFrom -> (Just (innerJoin oldFrom newSource (exprWithContext tblPfx <$> mkOn newTbl)), qbWhere qb)
    
          newTbl = changeBeamRep (\(Columnar' f) -> Columnar' (QExpr (\_ -> fieldE (qualifiedField newTblNm (_fieldName f))))) tblSettings
      in (newTblNm, newTbl, qb')
    
    nextTbl :: (IsSql92SelectSyntax select, Beamable table)
            => QueryBuilder select
            -> TablePrefix -> TableSettings table
            -> ( table (QExpr (Sql92SelectExpressionSyntax select) s)
               , T.Text
               , QueryBuilder select )
    nextTbl qb tblPfx tblSettings =
      let tblRef = qbNextTblRef qb
          newTblNm = tblPfx <> fromString (show tblRef)
          newTbl = changeBeamRep (\(Columnar' f) -> Columnar' (QExpr (\_ -> fieldE (qualifiedField newTblNm (_fieldName f))))) tblSettings
      in (newTbl, newTblNm, qb { qbNextTblRef = qbNextTblRef qb + 1})
    
    projOrder :: Projectible expr x =>
                 x -> WithExprContext [ expr ]
    projOrder = project -- (Proxy @AnyType) (\_ x -> tell [x] >> pure x)
    

    Found in Database.Beam.Query.SQL92 from the package beam-core
         . (Beamable table, IsSql92SelectSyntax select)
        => TablePrefix -> (TablePrefix -> T.Text -> Sql92SelectFromSyntax select) -> TableSettings table
        -> (table (QExpr (Sql92SelectExpressionSyntax select) s) -> Maybe (WithExprContext (Sql92SelectExpressionSyntax select)))
        -> QueryBuilder select -> (T.Text, table (QExpr (Sql92SelectExpressionSyntax select) s), QueryBuilder select)
    buildInnerJoinQuery tblPfx mkFrom tblSettings mkOn qb =
      let qb' = QueryBuilder (tblRef + 1) from' where'
          tblRef = qbNextTblRef qb
          newTblNm = tblPfx <> fromString (show tblRef)
          newSource = mkFrom (nextTblPfx tblPfx) newTblNm
          (from', where') =
            case qbFrom qb of
              Nothing -> (Just newSource, andE' (qbWhere qb) (exprWithContext tblPfx <$> mkOn newTbl))
              Just oldFrom -> (Just (innerJoin oldFrom newSource (exprWithContext tblPfx <$> mkOn newTbl)), qbWhere qb)
    
          newTbl = changeBeamRep (\(Columnar' f) -> Columnar' (QExpr (\_ -> fieldE (qualifiedField newTblNm (_fieldName f))))) tblSettings
      in (newTblNm, newTbl, qb')
    
    nextTbl :: (IsSql92SelectSyntax select, Beamable table)
            => QueryBuilder select
            -> TablePrefix -> TableSettings table
    

    Found in Database.Beam.Query.Aggregate from the package beam-core
    --   expression (usually something that contains 'QGenExpr's in the
    --   'QGroupingContext').
    class QGroupable expr grouped | expr -> grouped, grouped -> expr where
      group_ :: expr -> grouped
    
    -- | 'group_' for simple value expressions.
    instance QGroupable (QExpr expr s a) (QGroupExpr expr s a) where
      group_ (QExpr a) = QExpr a
    
    -- | 'group_' for any 'Beamable' type. Adds every field in the type to the
    --   grouping key. This is the equivalent of including the grouping expression
    --   of each field in the type as part of the aggregate projection
    instance Beamable tbl =>
      QGroupable (tbl (QExpr expr s)) (tbl (QGroupExpr expr s)) where
      group_ = changeBeamRep (\(Columnar' (QExpr x)) -> Columnar' (QExpr x))
    
    -- | Compute an aggregate over all values in a group. Corresponds semantically
    --   to the @AGG(ALL ..)@ syntax, but doesn't produce an explicit @ALL@. To
    --   produce @ALL@ expicitly, see 'allInGroupExplicitly_'.
    allInGroup_ :: IsSql92AggregationSetQuantifierSyntax s
    

    Found in Database.Beam.Query.Combinators from the package beam-core
        isJust_ (QExpr x) = QExpr (isNotNullE <$> x)
        isNothing_ (QExpr x) = QExpr (isNullE <$> x)
    
        maybe_ (QExpr onNothing) onJust (QExpr e) =
            let QExpr onJust' = onJust (QExpr e)
            in QExpr (\tbl -> caseE [(isNotNullE (e tbl), onJust' tbl)] (onNothing tbl))
    
    instance ( IsSql92ExpressionSyntax syntax
             , HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) Bool
             , Beamable t )
        => SqlDeconstructMaybe syntax (t (Nullable (QGenExpr ctxt syntax s))) (t (QGenExpr ctxt syntax s)) s where
        isJust_ t = allE (allBeamValues (\(Columnar' e) -> isJust_ e) t)
        isNothing_ t = allE (allBeamValues (\(Columnar' e) -> isNothing_ e) t)
        maybe_ (QExpr onNothing) onJust tbl =
          let QExpr onJust' = onJust (changeBeamRep (\(Columnar' (QExpr e)) -> Columnar' (QExpr e)) tbl)
              QExpr cond = isJust_ tbl
          in QExpr (\tblPfx -> caseE [(cond tblPfx, onJust' tblPfx)] (onNothing tblPfx))
    

    Found in Database.Beam.Query.Combinators from the package beam-core
    instance {-# OVERLAPPING #-} ( Table t
                                 , IsSql92ExpressionSyntax syntax
                                 , HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) SqlNull ) =>
        SqlJustable (t (QExpr syntax s)) (t (Nullable (QExpr syntax s))) where
        just_ = changeBeamRep (\(Columnar' q) -> Columnar' (just_ q))
        nothing_ = changeBeamRep (\(Columnar' _) -> Columnar' nothing_) (tblSkeleton :: TableSkeleton t)
    
    instance {-# OVERLAPPING #-} Table t => SqlJustable (PrimaryKey t Identity) (PrimaryKey t (Nullable Identity)) where
        just_ = changeBeamRep (\(Columnar' q) -> Columnar' (Just q))
        nothing_ = changeBeamRep (\(Columnar' _) -> Columnar' Nothing) (primaryKey (tblSkeleton :: TableSkeleton t))
    
    instance {-# OVERLAPPING #-} Table t => SqlJustable (t Identity) (t (Nullable Identity)) where
        just_ = changeBeamRep (\(Columnar' q) -> Columnar' (Just q))
        nothing_ = changeBeamRep (\(Columnar' _) -> Columnar' Nothing) (tblSkeleton :: TableSkeleton t)
    
    -- * Nullable checking
    
    data QIfCond context expr s a = QIfCond (QGenExpr context expr s SqlBool) (QGenExpr context expr s a)
    newtype QIfElse context expr s a = QIfElse (QGenExpr context expr s a)
    

    Found in Database.Beam.Query.Combinators from the package beam-core
        nothing_ = changeBeamRep (\(Columnar' _) -> Columnar' nothing_) (primaryKey (tblSkeleton :: TableSkeleton t))
    
    instance {-# OVERLAPPING #-} ( Table t
                                 , IsSql92ExpressionSyntax syntax
                                 , HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) SqlNull ) =>
        SqlJustable (t (QExpr syntax s)) (t (Nullable (QExpr syntax s))) where
        just_ = changeBeamRep (\(Columnar' q) -> Columnar' (just_ q))
        nothing_ = changeBeamRep (\(Columnar' _) -> Columnar' nothing_) (tblSkeleton :: TableSkeleton t)
    
    instance {-# OVERLAPPING #-} Table t => SqlJustable (PrimaryKey t Identity) (PrimaryKey t (Nullable Identity)) where
        just_ = changeBeamRep (\(Columnar' q) -> Columnar' (Just q))
        nothing_ = changeBeamRep (\(Columnar' _) -> Columnar' Nothing) (primaryKey (tblSkeleton :: TableSkeleton t))
    
    instance {-# OVERLAPPING #-} Table t => SqlJustable (t Identity) (t (Nullable Identity)) where
        just_ = changeBeamRep (\(Columnar' q) -> Columnar' (Just q))
        nothing_ = changeBeamRep (\(Columnar' _) -> Columnar' Nothing) (tblSkeleton :: TableSkeleton t)
    
    -- * Nullable checking
    
    data QIfCond context expr s a = QIfCond (QGenExpr context expr s SqlBool) (QGenExpr context expr s a)
    

    Found in Database.Beam.Query.Combinators from the package beam-core
                                 , HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) SqlNull ) =>
        SqlJustable (PrimaryKey t (QExpr syntax s)) (PrimaryKey t (Nullable (QExpr syntax s))) where
        just_ = changeBeamRep (\(Columnar' q) -> Columnar' (just_ q))
        nothing_ = changeBeamRep (\(Columnar' _) -> Columnar' nothing_) (primaryKey (tblSkeleton :: TableSkeleton t))
    
    instance {-# OVERLAPPING #-} ( Table t
                                 , IsSql92ExpressionSyntax syntax
                                 , HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) SqlNull ) =>
        SqlJustable (t (QExpr syntax s)) (t (Nullable (QExpr syntax s))) where
        just_ = changeBeamRep (\(Columnar' q) -> Columnar' (just_ q))
        nothing_ = changeBeamRep (\(Columnar' _) -> Columnar' nothing_) (tblSkeleton :: TableSkeleton t)
    
    instance {-# OVERLAPPING #-} Table t => SqlJustable (PrimaryKey t Identity) (PrimaryKey t (Nullable Identity)) where
        just_ = changeBeamRep (\(Columnar' q) -> Columnar' (Just q))
        nothing_ = changeBeamRep (\(Columnar' _) -> Columnar' Nothing) (primaryKey (tblSkeleton :: TableSkeleton t))
    
    instance {-# OVERLAPPING #-} Table t => SqlJustable (t Identity) (t (Nullable Identity)) where
        just_ = changeBeamRep (\(Columnar' q) -> Columnar' (Just q))
        nothing_ = changeBeamRep (\(Columnar' _) -> Columnar' Nothing) (tblSkeleton :: TableSkeleton t)
    

    Found in Database.Beam.Query.Combinators from the package beam-core
                                 , IsSql92ExpressionSyntax syntax
                                 , HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) SqlNull ) =>
        SqlJustable (PrimaryKey t (QExpr syntax s)) (PrimaryKey t (Nullable (QExpr syntax s))) where
        just_ = changeBeamRep (\(Columnar' q) -> Columnar' (just_ q))
        nothing_ = changeBeamRep (\(Columnar' _) -> Columnar' nothing_) (primaryKey (tblSkeleton :: TableSkeleton t))
    
    instance {-# OVERLAPPING #-} ( Table t
                                 , IsSql92ExpressionSyntax syntax
                                 , HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) SqlNull ) =>
        SqlJustable (t (QExpr syntax s)) (t (Nullable (QExpr syntax s))) where
        just_ = changeBeamRep (\(Columnar' q) -> Columnar' (just_ q))
        nothing_ = changeBeamRep (\(Columnar' _) -> Columnar' nothing_) (tblSkeleton :: TableSkeleton t)
    
    instance {-# OVERLAPPING #-} Table t => SqlJustable (PrimaryKey t Identity) (PrimaryKey t (Nullable Identity)) where
        just_ = changeBeamRep (\(Columnar' q) -> Columnar' (Just q))
        nothing_ = changeBeamRep (\(Columnar' _) -> Columnar' Nothing) (primaryKey (tblSkeleton :: TableSkeleton t))
    
    instance {-# OVERLAPPING #-} Table t => SqlJustable (t Identity) (t (Nullable Identity)) where
        just_ = changeBeamRep (\(Columnar' q) -> Columnar' (Just q))
        nothing_ = changeBeamRep (\(Columnar' _) -> Columnar' Nothing) (tblSkeleton :: TableSkeleton t)
    

    Found in Database.Beam.Query.Combinators from the package beam-core
        nothing_ = QExpr (pure (valueE (sqlValueSyntax SqlNull)))
    
    instance {-# OVERLAPPING #-} ( Table t
                                 , IsSql92ExpressionSyntax syntax
                                 , HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) SqlNull ) =>
        SqlJustable (PrimaryKey t (QExpr syntax s)) (PrimaryKey t (Nullable (QExpr syntax s))) where
        just_ = changeBeamRep (\(Columnar' q) -> Columnar' (just_ q))
        nothing_ = changeBeamRep (\(Columnar' _) -> Columnar' nothing_) (primaryKey (tblSkeleton :: TableSkeleton t))
    
    instance {-# OVERLAPPING #-} ( Table t
                                 , IsSql92ExpressionSyntax syntax
                                 , HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) SqlNull ) =>
        SqlJustable (t (QExpr syntax s)) (t (Nullable (QExpr syntax s))) where
        just_ = changeBeamRep (\(Columnar' q) -> Columnar' (just_ q))
        nothing_ = changeBeamRep (\(Columnar' _) -> Columnar' nothing_) (tblSkeleton :: TableSkeleton t)
    
    instance {-# OVERLAPPING #-} Table t => SqlJustable (PrimaryKey t Identity) (PrimaryKey t (Nullable Identity)) where
        just_ = changeBeamRep (\(Columnar' q) -> Columnar' (Just q))
        nothing_ = changeBeamRep (\(Columnar' _) -> Columnar' Nothing) (primaryKey (tblSkeleton :: TableSkeleton t))
    

    Found in Database.Beam.Query.Combinators from the package beam-core
        just_ (QExpr e) = QExpr e
        nothing_ = QExpr (pure (valueE (sqlValueSyntax SqlNull)))
    
    instance {-# OVERLAPPING #-} ( Table t
                                 , IsSql92ExpressionSyntax syntax
                                 , HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) SqlNull ) =>
        SqlJustable (PrimaryKey t (QExpr syntax s)) (PrimaryKey t (Nullable (QExpr syntax s))) where
        just_ = changeBeamRep (\(Columnar' q) -> Columnar' (just_ q))
        nothing_ = changeBeamRep (\(Columnar' _) -> Columnar' nothing_) (primaryKey (tblSkeleton :: TableSkeleton t))
    
    instance {-# OVERLAPPING #-} ( Table t
                                 , IsSql92ExpressionSyntax syntax
                                 , HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) SqlNull ) =>
        SqlJustable (t (QExpr syntax s)) (t (Nullable (QExpr syntax s))) where
        just_ = changeBeamRep (\(Columnar' q) -> Columnar' (just_ q))
        nothing_ = changeBeamRep (\(Columnar' _) -> Columnar' nothing_) (tblSkeleton :: TableSkeleton t)
    
    instance {-# OVERLAPPING #-} Table t => SqlJustable (PrimaryKey t Identity) (PrimaryKey t (Nullable Identity)) where
        just_ = changeBeamRep (\(Columnar' q) -> Columnar' (Just q))
        nothing_ = changeBeamRep (\(Columnar' _) -> Columnar' Nothing) (primaryKey (tblSkeleton :: TableSkeleton t))
    

    Found in Database.Beam.Query.Combinators from the package beam-core
        nothing_ :: b
    
    instance ( IsSql92ExpressionSyntax syntax
             , HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) SqlNull) =>
        SqlJustable (QExpr syntax s a) (QExpr syntax s (Maybe a)) where
    
        just_ (QExpr e) = QExpr e
        nothing_ = QExpr (pure (valueE (sqlValueSyntax SqlNull)))
    
    instance {-# OVERLAPPING #-} ( Table t
                                 , IsSql92ExpressionSyntax syntax
                                 , HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) SqlNull ) =>
        SqlJustable (PrimaryKey t (QExpr syntax s)) (PrimaryKey t (Nullable (QExpr syntax s))) where
        just_ = changeBeamRep (\(Columnar' q) -> Columnar' (just_ q))
        nothing_ = changeBeamRep (\(Columnar' _) -> Columnar' nothing_) (primaryKey (tblSkeleton :: TableSkeleton t))
    
    instance {-# OVERLAPPING #-} ( Table t
                                 , IsSql92ExpressionSyntax syntax
                                 , HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) SqlNull ) =>
        SqlJustable (t (QExpr syntax s)) (t (Nullable (QExpr syntax s))) where
    

    Found in Database.Beam.Query.Combinators from the package beam-core
        --   'PrimaryKey' filled with 'Nothing'.
        nothing_ :: b
    
    instance ( IsSql92ExpressionSyntax syntax
             , HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) SqlNull) =>
        SqlJustable (QExpr syntax s a) (QExpr syntax s (Maybe a)) where
    
        just_ (QExpr e) = QExpr e
        nothing_ = QExpr (pure (valueE (sqlValueSyntax SqlNull)))
    
    instance {-# OVERLAPPING #-} ( Table t
                                 , IsSql92ExpressionSyntax syntax
                                 , HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) SqlNull ) =>
        SqlJustable (PrimaryKey t (QExpr syntax s)) (PrimaryKey t (Nullable (QExpr syntax s))) where
        just_ = changeBeamRep (\(Columnar' q) -> Columnar' (just_ q))
        nothing_ = changeBeamRep (\(Columnar' _) -> Columnar' nothing_) (primaryKey (tblSkeleton :: TableSkeleton t))
    
    instance {-# OVERLAPPING #-} ( Table t
                                 , IsSql92ExpressionSyntax syntax
                                 , HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) SqlNull ) =>
    

    Found in Database.Beam.Query.Combinators from the package beam-core
                                                (Proxy @(Rep (table Exposed))) (from tbl))
        in changeBeamRep (\(Columnar' (WithConstraint x :: WithConstraint (HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax)) x)) ->
                             Columnar' (QExpr (pure (valueE (sqlValueSyntax x))))) fields
    instance ( Beamable table
             , IsSql92ExpressionSyntax syntax
    
             , FieldsFulfillConstraintNullable (HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax)) table ) =>
    
             SqlValable (table (Nullable (QGenExpr ctxt syntax s))) where
    
      val_ tbl =
        let fields :: table (Nullable (WithConstraint (HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax))))
            fields = to (gWithConstrainedFields (Proxy @(HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax)))
                                                (Proxy @(Rep (table (Nullable Exposed)))) (from tbl))
        in changeBeamRep (\(Columnar' (WithConstraint x :: WithConstraint (HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax)) (Maybe x))) ->
                             Columnar' (QExpr (pure (valueE (sqlValueSyntax x))))) fields
    
    default_ :: IsSql92ExpressionSyntax expr
             => QGenExpr ctxt expr s a
    default_ = QExpr (pure defaultE)
    

    Found in Database.Beam.Query.Combinators from the package beam-core
        val_ :: HaskellLiteralForQExpr a -> a
    
    instance (HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) a, IsSql92ExpressionSyntax syntax) =>
      SqlValable (QGenExpr ctxt syntax s a) where
    
      val_ = QExpr . pure . valueE . sqlValueSyntax
    instance ( Beamable table
             , IsSql92ExpressionSyntax syntax
             , FieldsFulfillConstraint (HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax)) table ) =>
      SqlValable (table (QGenExpr ctxt syntax s)) where
      val_ tbl =
        let fields :: table (WithConstraint (HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax)))
            fields = to (gWithConstrainedFields (Proxy @(HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax)))
                                                (Proxy @(Rep (table Exposed))) (from tbl))
        in changeBeamRep (\(Columnar' (WithConstraint x :: WithConstraint (HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax)) x)) ->
                             Columnar' (QExpr (pure (valueE (sqlValueSyntax x))))) fields
    instance ( Beamable table
             , IsSql92ExpressionSyntax syntax
    
             , FieldsFulfillConstraintNullable (HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax)) table ) =>
    

    Found in Database.Beam.Query.Combinators from the package beam-core
      (<-.) :: forall fieldName.
               IsSql92FieldNameSyntax fieldName
            => tbl (QField s) -> tbl (QExpr expr s)
            -> QAssignment fieldName expr s
      lhs <-. rhs =
        QAssignment $
        allBeamValues (\(Columnar' (Const assignments)) -> assignments) $
        runIdentity $
        zipBeamFieldsM (\(Columnar' (QField _ _ f) :: Columnar' (QField s) t) (Columnar' (QExpr e)) ->
                           pure (Columnar' (Const (unqualifiedField f, e "t")) :: Columnar' (Const (fieldName,expr)) t)) lhs rhs
    instance Beamable tbl => SqlUpdatable expr s (tbl (Nullable (QField s))) (tbl (Nullable (QExpr expr s))) where
      lhs <-. rhs =
        let lhs' = changeBeamRep (\(Columnar' (QField q tblName fieldName') :: Columnar' (Nullable (QField s)) a) ->
                                    Columnar' (QField q tblName fieldName') :: Columnar' (QField s)  a) lhs
            rhs' = changeBeamRep (\(Columnar' (QExpr e) :: Columnar' (Nullable (QExpr expr s)) a) ->
                                    Columnar' (QExpr e) :: Columnar' (QExpr expr s) a) rhs
        in lhs' <-. rhs'
    
    -- | SQL @UNION@ operator
    union_ :: forall select db s a.
    

    Found in Database.Beam.Query.Combinators from the package beam-core
        QAssignment [(unqualifiedField nm, expr "t")]
    instance Beamable tbl => SqlUpdatable expr s (tbl (QField s)) (tbl (QExpr expr s)) where
      (<-.) :: forall fieldName.
               IsSql92FieldNameSyntax fieldName
            => tbl (QField s) -> tbl (QExpr expr s)
            -> QAssignment fieldName expr s
      lhs <-. rhs =
        QAssignment $
        allBeamValues (\(Columnar' (Const assignments)) -> assignments) $
        runIdentity $
        zipBeamFieldsM (\(Columnar' (QField _ _ f) :: Columnar' (QField s) t) (Columnar' (QExpr e)) ->
                           pure (Columnar' (Const (unqualifiedField f, e "t")) :: Columnar' (Const (fieldName,expr)) t)) lhs rhs
    instance Beamable tbl => SqlUpdatable expr s (tbl (Nullable (QField s))) (tbl (Nullable (QExpr expr s))) where
      lhs <-. rhs =
        let lhs' = changeBeamRep (\(Columnar' (QField q tblName fieldName') :: Columnar' (Nullable (QField s)) a) ->
                                    Columnar' (QField q tblName fieldName') :: Columnar' (QField s)  a) lhs
            rhs' = changeBeamRep (\(Columnar' (QExpr e) :: Columnar' (Nullable (QExpr expr s)) a) ->
                                    Columnar' (QExpr e) :: Columnar' (QExpr expr s) a) rhs
        in lhs' <-. rhs'
    

    Found in Database.Beam.Migrate.SQL.Tables from the package beam-migrate
     let initialTbl = runIdentity $
                      zipBeamFieldsM
                          (\(Columnar' (TableField nm) :: Columnar' (TableField table) x)
                            (Columnar' (Const checks) :: Columnar' (Const [FieldCheck]) x) ->
                             pure (Columnar' (ColumnMigration nm checks)
                                   :: Columnar' ColumnMigration x))
                          tbl tblFieldChecks
    
         TableMigration alterColumns' = alterColumns initialTbl
         ((newTbl, cmds), (tblNm', tblChecks')) = runState (runWriterT alterColumns') (tblNm, tblChecks)
    
         fieldChecks' = changeBeamRep (\(Columnar' (ColumnMigration _ checks) :: Columnar' ColumnMigration a) ->
                                         Columnar' (Const checks) :: Columnar' (Const [FieldCheck]) a)
                                      newTbl
         tbl' = changeBeamRep (\(Columnar' (ColumnMigration nm _) :: Columnar' ColumnMigration a) ->
                                  Columnar' (TableField nm) :: Columnar' (TableField table') a)
                              newTbl
     in forM_ cmds (\cmd -> upDown (alterTableCmd cmd) Nothing) >>
        pure (CheckedDatabaseEntity (CheckedDatabaseTable (DatabaseTable tblNm' tbl') tblChecks' fieldChecks') entityChecks)
    

    Found in Database.Beam.Migrate.SQL.Tables from the package beam-migrate
               -> (table ColumnMigration -> TableMigration syntax (table' ColumnMigration))
               -> Migration syntax (CheckedDatabaseEntity be db' (TableEntity table'))
    alterTable (CheckedDatabaseEntity (CheckedDatabaseTable (DatabaseTable tblNm tbl) tblChecks tblFieldChecks) entityChecks) alterColumns =
     let initialTbl = runIdentity $
                      zipBeamFieldsM
                          (\(Columnar' (TableField nm) :: Columnar' (TableField table) x)
                            (Columnar' (Const checks) :: Columnar' (Const [FieldCheck]) x) ->
                             pure (Columnar' (ColumnMigration nm checks)
                                   :: Columnar' ColumnMigration x))
                          tbl tblFieldChecks
    
         TableMigration alterColumns' = alterColumns initialTbl
         ((newTbl, cmds), (tblNm', tblChecks')) = runState (runWriterT alterColumns') (tblNm, tblChecks)
    
         fieldChecks' = changeBeamRep (\(Columnar' (ColumnMigration _ checks) :: Columnar' ColumnMigration a) ->
                                         Columnar' (Const checks) :: Columnar' (Const [FieldCheck]) a)
                                      newTbl
         tbl' = changeBeamRep (\(Columnar' (ColumnMigration nm _) :: Columnar' ColumnMigration a) ->
                                  Columnar' (TableField nm) :: Columnar' (TableField table') a)
                              newTbl
    

    Found in Database.Beam.Migrate.SQL.Tables from the package beam-migrate
    createTable :: ( Beamable table, Table table
                   , IsSql92DdlCommandSyntax syntax ) =>
                   Text -> TableSchema (Sql92CreateTableColumnSchemaSyntax (Sql92DdlCommandCreateTableSyntax syntax)) table
                -> Migration syntax (CheckedDatabaseEntity be db (TableEntity table))
    createTable newTblName tblSettings =
      do let createTableCommand =
               createTableSyntax Nothing newTblName
                                 (allBeamValues (\(Columnar' (TableFieldSchema name (FieldSchema schema) _)) -> (name, schema)) tblSettings)
                                 [ primaryKeyConstraintSyntax (allBeamValues (\(Columnar' (TableFieldSchema name _ _)) -> name) (primaryKey tblSettings)) ]
    
             command = createTableCmd createTableCommand
    
             tbl' = changeBeamRep (\(Columnar' (TableFieldSchema name _ _)) -> Columnar' (TableField name)) tblSettings
    
             fieldChecks = changeBeamRep (\(Columnar' (TableFieldSchema _ _ cs)) -> Columnar' (Const cs)) tblSettings
    
             tblChecks = [ TableCheck (\tblName _ -> SomeDatabasePredicate (TableExistsPredicate tblName)) ] ++
                         primaryKeyCheck
    
             primaryKeyCheck =
    

    Found in Database.Beam.Migrate.SQL.Tables from the package beam-migrate
    --   The second argument is a table containing a 'FieldSchema' for each field.
    --   See documentation on the 'Field' command for more information.
    createTable :: ( Beamable table, Table table
                   , IsSql92DdlCommandSyntax syntax ) =>
                   Text -> TableSchema (Sql92CreateTableColumnSchemaSyntax (Sql92DdlCommandCreateTableSyntax syntax)) table
                -> Migration syntax (CheckedDatabaseEntity be db (TableEntity table))
    createTable newTblName tblSettings =
      do let createTableCommand =
               createTableSyntax Nothing newTblName
                                 (allBeamValues (\(Columnar' (TableFieldSchema name (FieldSchema schema) _)) -> (name, schema)) tblSettings)
                                 [ primaryKeyConstraintSyntax (allBeamValues (\(Columnar' (TableFieldSchema name _ _)) -> name) (primaryKey tblSettings)) ]
    
             command = createTableCmd createTableCommand
    
             tbl' = changeBeamRep (\(Columnar' (TableFieldSchema name _ _)) -> Columnar' (TableField name)) tblSettings
    
             fieldChecks = changeBeamRep (\(Columnar' (TableFieldSchema _ _ cs)) -> Columnar' (Const cs)) tblSettings
    
             tblChecks = [ TableCheck (\tblName _ -> SomeDatabasePredicate (TableExistsPredicate tblName)) ] ++
                         primaryKeyCheck
    

    dbEntityDescriptor No usage example found for this symbol :( Collapse [-]
    dbModification See 1 Occurences [+] Collapse [-]
    Found in Database.Beam.Schema from the package beam-core
        , Table(..), Beamable
        , defTblFieldSettings, pk
    
        , Columnar, C, Columnar', Nullable
        , TableField, fieldName
    
        , TableSettings, HaskellTable
    
        -- * 'Generic'-deriving mechanisms
        , defaultDbSettings
    
        -- ** Modifying the derived schema
        , DatabaseModification, EntityModification, FieldModification
        , withDbModification, withTableModification
        , dbModification, tableModification
        , modifyTable, fieldNamed
    
        -- * Types for lens generation
        , Lenses, LensFor(..)
    

    defTblFieldSettings See 1 Occurences [+] Collapse [-]
    Found in Database.Beam.Schema from the package beam-core
        (
        -- * Database construction
        -- $db-construction
          Database
    
        , DatabaseSettings
        , DatabaseEntity
    
        -- ** #entities# Database entities
        -- $entities
        , TableEntity
    
        -- * Table construction
        , Table(..), Beamable
        , defTblFieldSettings, pk
    
        , Columnar, C, Columnar', Nullable
        , TableField, fieldName
    
        , TableSettings, HaskellTable
    

    defaultDbSettings See 1 Occurences [+] Collapse [-]
    Found in Database.Beam.Schema from the package beam-core
        -- ** #entities# Database entities
        -- $entities
        , TableEntity
    
        -- * Table construction
        , Table(..), Beamable
        , defTblFieldSettings, pk
    
        , Columnar, C, Columnar', Nullable
        , TableField, fieldName
    
        , TableSettings, HaskellTable
    
        -- * 'Generic'-deriving mechanisms
        , defaultDbSettings
    
        -- ** Modifying the derived schema
        , DatabaseModification, EntityModification, FieldModification
        , withDbModification, withTableModification
        , dbModification, tableModification
    

    fieldName See 10 Occurences [+] Collapse [-]
    Found in Database.Beam.Query.Internal from the package beam-core
      = Q { runQ :: QM syntax db s a }
        deriving (Monad, Applicative, Functor)
    
    data QInternal
    data QNested s
    
    data QField s ty
      = QField
      { qFieldShouldQualify :: Bool
      , qFieldTblName :: T.Text
      , qFieldName    :: T.Text }
      deriving (Show, Eq, Ord)
    
    newtype QAssignment fieldName expr s
      = QAssignment [(fieldName, expr)]
      deriving (Show, Eq, Ord, Monoid, Semigroup)
    
    -- * QGenExpr type
    
    data QAggregateContext
    

    Found in Database.Beam.Query.Internal from the package beam-core
    newtype Q syntax (db :: (* -> *) -> *) s a
      = Q { runQ :: QM syntax db s a }
        deriving (Monad, Applicative, Functor)
    
    data QInternal
    data QNested s
    
    data QField s ty
      = QField
      { qFieldShouldQualify :: Bool
      , qFieldTblName :: T.Text
      , qFieldName    :: T.Text }
      deriving (Show, Eq, Ord)
    
    newtype QAssignment fieldName expr s
      = QAssignment [(fieldName, expr)]
      deriving (Show, Eq, Ord, Monoid, Semigroup)
    
    -- * QGenExpr type
    

    Found in Database.Beam.Schema from the package beam-core
          Database
    
        , DatabaseSettings
        , DatabaseEntity
    
        -- ** #entities# Database entities
        -- $entities
        , TableEntity
    
        -- * Table construction
        , Table(..), Beamable
        , defTblFieldSettings, pk
    
        , Columnar, C, Columnar', Nullable
        , TableField, fieldName
    
        , TableSettings, HaskellTable
    
        -- * 'Generic'-deriving mechanisms
        , defaultDbSettings
    

    Found in Database.Beam.Query.Combinators from the package beam-core
            -> QAssignment fieldName expr s
    instance SqlUpdatable expr s (QField s a) (QExpr expr s a) where
      QField _ _ nm <-. QExpr expr =
        QAssignment [(unqualifiedField nm, expr "t")]
    instance Beamable tbl => SqlUpdatable expr s (tbl (QField s)) (tbl (QExpr expr s)) where
      (<-.) :: forall fieldName.
               IsSql92FieldNameSyntax fieldName
            => tbl (QField s) -> tbl (QExpr expr s)
            -> QAssignment fieldName expr s
      lhs <-. rhs =
        QAssignment $
        allBeamValues (\(Columnar' (Const assignments)) -> assignments) $
        runIdentity $
        zipBeamFieldsM (\(Columnar' (QField _ _ f) :: Columnar' (QField s) t) (Columnar' (QExpr e)) ->
                           pure (Columnar' (Const (unqualifiedField f, e "t")) :: Columnar' (Const (fieldName,expr)) t)) lhs rhs
    instance Beamable tbl => SqlUpdatable expr s (tbl (Nullable (QField s))) (tbl (Nullable (QExpr expr s))) where
      lhs <-. rhs =
        let lhs' = changeBeamRep (\(Columnar' (QField q tblName fieldName') :: Columnar' (Nullable (QField s)) a) ->
                                    Columnar' (QField q tblName fieldName') :: Columnar' (QField s)  a) lhs
            rhs' = changeBeamRep (\(Columnar' (QExpr e) :: Columnar' (Nullable (QExpr expr s)) a) ->
    

    Found in Database.Beam.Query.Combinators from the package beam-core
      -- | Update a 'QField' or 'Beamable' type containing 'QField's with the given
      --   'QExpr' or 'Beamable' type containing 'QExpr'
      (<-.) :: forall fieldName.
               IsSql92FieldNameSyntax fieldName
            => lhs
            -> rhs
            -> QAssignment fieldName expr s
    instance SqlUpdatable expr s (QField s a) (QExpr expr s a) where
      QField _ _ nm <-. QExpr expr =
        QAssignment [(unqualifiedField nm, expr "t")]
    instance Beamable tbl => SqlUpdatable expr s (tbl (QField s)) (tbl (QExpr expr s)) where
      (<-.) :: forall fieldName.
               IsSql92FieldNameSyntax fieldName
            => tbl (QField s) -> tbl (QExpr expr s)
            -> QAssignment fieldName expr s
      lhs <-. rhs =
        QAssignment $
        allBeamValues (\(Columnar' (Const assignments)) -> assignments) $
        runIdentity $
        zipBeamFieldsM (\(Columnar' (QField _ _ f) :: Columnar' (QField s) t) (Columnar' (QExpr e)) ->
    

    Found in Database.Beam.Query.Combinators from the package beam-core
    infix 4 <-.
    class SqlUpdatable expr s lhs rhs | rhs -> expr, lhs -> s, rhs -> s, lhs s expr -> rhs, rhs -> lhs where
      -- | Update a 'QField' or 'Beamable' type containing 'QField's with the given
      --   'QExpr' or 'Beamable' type containing 'QExpr'
      (<-.) :: forall fieldName.
               IsSql92FieldNameSyntax fieldName
            => lhs
            -> rhs
            -> QAssignment fieldName expr s
    instance SqlUpdatable expr s (QField s a) (QExpr expr s a) where
      QField _ _ nm <-. QExpr expr =
        QAssignment [(unqualifiedField nm, expr "t")]
    instance Beamable tbl => SqlUpdatable expr s (tbl (QField s)) (tbl (QExpr expr s)) where
      (<-.) :: forall fieldName.
               IsSql92FieldNameSyntax fieldName
            => tbl (QField s) -> tbl (QExpr expr s)
            -> QAssignment fieldName expr s
      lhs <-. rhs =
        QAssignment $
        allBeamValues (\(Columnar' (Const assignments)) -> assignments) $
    

    Found in Database.Beam.Query.Combinators from the package beam-core
    infix 4 <-.
    class SqlUpdatable expr s lhs rhs | rhs -> expr, lhs -> s, rhs -> s, lhs s expr -> rhs, rhs -> lhs where
      -- | Update a 'QField' or 'Beamable' type containing 'QField's with the given
      --   'QExpr' or 'Beamable' type containing 'QExpr'
      (<-.) :: forall fieldName.
               IsSql92FieldNameSyntax fieldName
            => lhs
            -> rhs
            -> QAssignment fieldName expr s
    instance SqlUpdatable expr s (QField s a) (QExpr expr s a) where
      QField _ _ nm <-. QExpr expr =
        QAssignment [(unqualifiedField nm, expr "t")]
    instance Beamable tbl => SqlUpdatable expr s (tbl (QField s)) (tbl (QExpr expr s)) where
      (<-.) :: forall fieldName.
               IsSql92FieldNameSyntax fieldName
            => tbl (QField s) -> tbl (QExpr expr s)
            -> QAssignment fieldName expr s
      lhs <-. rhs =
        QAssignment $
    

    Found in Database.Beam.Query.Combinators from the package beam-core
    -- | Extract an expression representing the current (non-UPDATEd) value of a 'QField'
    current_ :: IsSql92ExpressionSyntax expr
             => QField s ty -> QExpr expr s ty
    current_ (QField False _ nm) = QExpr (pure (fieldE (unqualifiedField nm)))
    current_ (QField True tbl nm) = QExpr (pure (fieldE (qualifiedField tbl nm)))
    
    infix 4 <-.
    class SqlUpdatable expr s lhs rhs | rhs -> expr, lhs -> s, rhs -> s, lhs s expr -> rhs, rhs -> lhs where
      -- | Update a 'QField' or 'Beamable' type containing 'QField's with the given
      --   'QExpr' or 'Beamable' type containing 'QExpr'
      (<-.) :: forall fieldName.
               IsSql92FieldNameSyntax fieldName
            => lhs
            -> rhs
            -> QAssignment fieldName expr s
    instance SqlUpdatable expr s (QField s a) (QExpr expr s a) where
      QField _ _ nm <-. QExpr expr =
        QAssignment [(unqualifiedField nm, expr "t")]
    instance Beamable tbl => SqlUpdatable expr s (tbl (QField s)) (tbl (QExpr expr s)) where
      (<-.) :: forall fieldName.
    

    Found in Database.Beam.Query.Combinators from the package beam-core
    -- * UPDATE operators
    
    -- | Extract an expression representing the current (non-UPDATEd) value of a 'QField'
    current_ :: IsSql92ExpressionSyntax expr
             => QField s ty -> QExpr expr s ty
    current_ (QField False _ nm) = QExpr (pure (fieldE (unqualifiedField nm)))
    current_ (QField True tbl nm) = QExpr (pure (fieldE (qualifiedField tbl nm)))
    
    infix 4 <-.
    class SqlUpdatable expr s lhs rhs | rhs -> expr, lhs -> s, rhs -> s, lhs s expr -> rhs, rhs -> lhs where
      -- | Update a 'QField' or 'Beamable' type containing 'QField's with the given
      --   'QExpr' or 'Beamable' type containing 'QExpr'
      (<-.) :: forall fieldName.
               IsSql92FieldNameSyntax fieldName
            => lhs
            -> rhs
            -> QAssignment fieldName expr s
    instance SqlUpdatable expr s (QField s a) (QExpr expr s a) where
      QField _ _ nm <-. QExpr expr =
    

    Found in Database.Beam.Query.Combinators from the package beam-core
                    Nothing es
    
    -- * UPDATE operators
    
    -- | Extract an expression representing the current (non-UPDATEd) value of a 'QField'
    current_ :: IsSql92ExpressionSyntax expr
             => QField s ty -> QExpr expr s ty
    current_ (QField False _ nm) = QExpr (pure (fieldE (unqualifiedField nm)))
    current_ (QField True tbl nm) = QExpr (pure (fieldE (qualifiedField tbl nm)))
    
    infix 4 <-.
    class SqlUpdatable expr s lhs rhs | rhs -> expr, lhs -> s, rhs -> s, lhs s expr -> rhs, rhs -> lhs where
      -- | Update a 'QField' or 'Beamable' type containing 'QField's with the given
      --   'QExpr' or 'Beamable' type containing 'QExpr'
      (<-.) :: forall fieldName.
               IsSql92FieldNameSyntax fieldName
            => lhs
            -> rhs
            -> QAssignment fieldName expr s
    instance SqlUpdatable expr s (QField s a) (QExpr expr s a) where
    

    fieldNamed See 1 Occurences [+] Collapse [-]
    Found in Database.Beam.Schema from the package beam-core
        , defTblFieldSettings, pk
    
        , Columnar, C, Columnar', Nullable
        , TableField, fieldName
    
        , TableSettings, HaskellTable
    
        -- * 'Generic'-deriving mechanisms
        , defaultDbSettings
    
        -- ** Modifying the derived schema
        , DatabaseModification, EntityModification, FieldModification
        , withDbModification, withTableModification
        , dbModification, tableModification
        , modifyTable, fieldNamed
    
        -- * Types for lens generation
        , Lenses, LensFor(..)
    
        , module Database.Beam.Schema.Lenses ) where
    

    modifyTable See 1 Occurences [+] Collapse [-]
    Found in Database.Beam.Schema from the package beam-core
        , defTblFieldSettings, pk
    
        , Columnar, C, Columnar', Nullable
        , TableField, fieldName
    
        , TableSettings, HaskellTable
    
        -- * 'Generic'-deriving mechanisms
        , defaultDbSettings
    
        -- ** Modifying the derived schema
        , DatabaseModification, EntityModification, FieldModification
        , withDbModification, withTableModification
        , dbModification, tableModification
        , modifyTable, fieldNamed
    
        -- * Types for lens generation
        , Lenses, LensFor(..)
    
        , module Database.Beam.Schema.Lenses ) where
    

    pk See 3 Occurences [+] Collapse [-]
    Found in Database.Beam.Query from the package beam-core
               , SqlValableTable (PrimaryKey table) (Sql92SelectExpressionSyntax syntax)
               , HasSqlValueSyntax (Sql92ExpressionValueSyntax (Sql92SelectExpressionSyntax syntax)) Bool
    
               , HasTableEquality (Sql92SelectExpressionSyntax syntax) (PrimaryKey table)
    
               , Beamable table, Table table
    
               , Database be db )
            => DatabaseEntity be db (TableEntity table)
            -> PrimaryKey table Identity
            -> SqlSelect syntax (table Identity)
    lookup_ tbl tblKey =
      select $
      filter_ (\t -> pk t ==. val_ tblKey) $
      all_ tbl
    
    -- | Run a 'SqlSelect' in a 'MonadBeam' and get the results as a list
    runSelectReturningList ::
      (IsSql92Syntax cmd, MonadBeam cmd be hdl m, FromBackendRow be a) =>
    

    Found in Database.Beam.Schema from the package beam-core
        (
        -- * Database construction
        -- $db-construction
          Database
    
        , DatabaseSettings
        , DatabaseEntity
    
        -- ** #entities# Database entities
        -- $entities
        , TableEntity
    
        -- * Table construction
        , Table(..), Beamable
        , defTblFieldSettings, pk
    
        , Columnar, C, Columnar', Nullable
        , TableField, fieldName
    
        , TableSettings, HaskellTable
    

    Found in Database.Beam.Query.Combinators from the package beam-core
                   , IsSql92SelectSyntax select )
                => DatabaseEntity be db (TableEntity rel)
                -> (rel (QExpr (Sql92SelectTableExpressionSyntax (Sql92SelectSelectTableSyntax select)) s) ->
                     QExpr (Sql92SelectTableExpressionSyntax (Sql92SelectSelectTableSyntax select)) s SqlBool)
                -> Q select db s (rel (QExpr (Sql92SelectTableExpressionSyntax (Sql92SelectSelectTableSyntax select)) s))
    relatedBy_' = join_'
    
    -- | Generate an appropriate boolean 'QGenExpr' comparing the given foreign key
    --   to the given table. Useful for creating join conditions.
    references_ :: ( IsSql92ExpressionSyntax expr
                   , HasTableEquality expr (PrimaryKey t)
                   , HasSqlValueSyntax (Sql92ExpressionValueSyntax expr) Bool
                   , Table t )
                => PrimaryKey t (QGenExpr ctxt expr s) -> t (QGenExpr ctxt expr s) -> QGenExpr ctxt expr s Bool
    references_ fk tbl = fk ==. pk tbl
    
    -- | Only return distinct values from a query
    nub_ :: ( IsSql92SelectSyntax select
            , Projectible (Sql92SelectExpressionSyntax select) r )
         => Q select db s r -> Q select db s r
    

    tableModification See 1 Occurences [+] Collapse [-]
    Found in Database.Beam.Schema from the package beam-core
        , Table(..), Beamable
        , defTblFieldSettings, pk
    
        , Columnar, C, Columnar', Nullable
        , TableField, fieldName
    
        , TableSettings, HaskellTable
    
        -- * 'Generic'-deriving mechanisms
        , defaultDbSettings
    
        -- ** Modifying the derived schema
        , DatabaseModification, EntityModification, FieldModification
        , withDbModification, withTableModification
        , dbModification, tableModification
        , modifyTable, fieldNamed
    
        -- * Types for lens generation
        , Lenses, LensFor(..)
    

    tableValuesNeeded No usage example found for this symbol :( Collapse [-]
    withConstrainedFields No usage example found for this symbol :( Collapse [-]
    withConstraints See 2 Occurences [+] Collapse [-]
    Found in Database.Beam.Query.Ord from the package beam-core
                                           do modify (\expr ->
                                                        case expr of
                                                          Nothing -> Just $ x ==. y
                                                          Just expr' -> Just $ expr' &&. x ==. y)
                                              return x') (withConstraints @(HasSqlEqualityCheck syntax) `alongsideTable` a) b) Nothing
                in fromMaybe (QExpr (\_ -> valueE (sqlValueSyntax True))) e
      a /=. b = not_ (a ==. b)
    
      a ==?. b = let (_, e) = runState (zipBeamFieldsM
                                        (\x'@(Columnar' (Columnar' (WithConstraint _) :*: Columnar' x)) (Columnar' y) ->
                                            do modify (\expr ->
                                                         case expr of
                                                           Nothing -> Just $ x ==?. y
                                                           Just expr' -> Just $ expr' &&?. x ==?. y)
                                               return x') (withConstraints @(HasSqlEqualityCheck syntax) `alongsideTable` a) b) Nothing
                in fromMaybe (QExpr (\_ -> valueE (sqlValueSyntax True))) e
      a /=?. b = sqlNot_ (a ==?. b)
    
    instance ( IsSql92ExpressionSyntax syntax
             , FieldsFulfillConstraintNullable (HasSqlEqualityCheck syntax) tbl
    

    Found in Database.Beam.Query.Ord from the package beam-core
      (FieldsFulfillConstraintNullable (HasSqlEqualityCheck expr) tbl, Beamable tbl)
    
    -- | Compare two arbitrary 'Beamable' types containing 'QGenExpr's for equality.
    instance ( IsSql92ExpressionSyntax syntax, FieldsFulfillConstraint (HasSqlEqualityCheck syntax) tbl
             , HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) Bool
             , Beamable tbl ) =>
             SqlEq (QGenExpr context syntax s) (tbl (QGenExpr context syntax s)) where
    
      a ==. b = let (_, e) = runState (zipBeamFieldsM
                                       (\x'@(Columnar' (Columnar' (WithConstraint _) :*: Columnar' x)) (Columnar' y) ->
                                           do modify (\expr ->
                                                        case expr of
                                                          Nothing -> Just $ x ==. y
                                                          Just expr' -> Just $ expr' &&. x ==. y)
                                              return x') (withConstraints @(HasSqlEqualityCheck syntax) `alongsideTable` a) b) Nothing
                in fromMaybe (QExpr (\_ -> valueE (sqlValueSyntax True))) e
      a /=. b = not_ (a ==. b)
    
      a ==?. b = let (_, e) = runState (zipBeamFieldsM
                                        (\x'@(Columnar' (Columnar' (WithConstraint _) :*: Columnar' x)) (Columnar' y) ->
    

    withDbModification See 1 Occurences [+] Collapse [-]
    Found in Database.Beam.Schema from the package beam-core
        -- * Table construction
        , Table(..), Beamable
        , defTblFieldSettings, pk
    
        , Columnar, C, Columnar', Nullable
        , TableField, fieldName
    
        , TableSettings, HaskellTable
    
        -- * 'Generic'-deriving mechanisms
        , defaultDbSettings
    
        -- ** Modifying the derived schema
        , DatabaseModification, EntityModification, FieldModification
        , withDbModification, withTableModification
        , dbModification, tableModification
        , modifyTable, fieldNamed
    
        -- * Types for lens generation
        , Lenses, LensFor(..)
    

    withNullableConstrainedFields No usage example found for this symbol :( Collapse [-]
    withNullableConstraints See 2 Occurences [+] Collapse [-]
    Found in Database.Beam.Query.Ord from the package beam-core
                                                        case expr of
                                                          Nothing -> Just $ x ==. y
                                                          Just expr' -> Just $ expr' &&. x ==. y)
                                              return x')
                                          (withNullableConstraints @(HasSqlEqualityCheck syntax) `alongsideTable` a) b) Nothing
                in fromMaybe (QExpr (\_ -> valueE (sqlValueSyntax True))) e
      a /=. b = not_ (a ==. b)
    
      a ==?. b = let (_, e) = runState (zipBeamFieldsM
                                        (\x'@(Columnar' (Columnar' (WithConstraint _) :*: Columnar' x)) (Columnar' y) ->
                                            do modify (\expr ->
                                                         case expr of
                                                           Nothing -> Just $ x ==?. y
                                                           Just expr' -> Just $ expr' &&?. x ==?. y)
                                               return x') (withNullableConstraints @(HasSqlEqualityCheck syntax) `alongsideTable` a) b) Nothing
                in fromMaybe (QExpr (\_ -> valueE (sqlValueSyntax True))) e
      a /=?. b = sqlNot_ (a ==?. b)
    
    
    -- * Comparisons
    

    Found in Database.Beam.Query.Ord from the package beam-core
    instance ( IsSql92ExpressionSyntax syntax
             , FieldsFulfillConstraintNullable (HasSqlEqualityCheck syntax) tbl
             , HasSqlValueSyntax (Sql92ExpressionValueSyntax syntax) Bool
             , Beamable tbl)
        => SqlEq (QGenExpr context syntax s) (tbl (Nullable (QGenExpr context syntax s))) where
    
      a ==. b = let (_, e) = runState (zipBeamFieldsM
                                          (\x'@(Columnar' (Columnar' (WithConstraint _) :*: Columnar' x)) (Columnar' y) -> do
                                              modify (\expr ->
                                                        case expr of
                                                          Nothing -> Just $ x ==. y
                                                          Just expr' -> Just $ expr' &&. x ==. y)
                                              return x')
                                          (withNullableConstraints @(HasSqlEqualityCheck syntax) `alongsideTable` a) b) Nothing
                in fromMaybe (QExpr (\_ -> valueE (sqlValueSyntax True))) e
      a /=. b = not_ (a ==. b)
    
      a ==?. b = let (_, e) = runState (zipBeamFieldsM
                                        (\x'@(Columnar' (Columnar' (WithConstraint _) :*: Columnar' x)) (Columnar' y) ->
    

    withTableModification See 1 Occurences [+] Collapse [-]
    Found in Database.Beam.Schema from the package beam-core
        -- * Table construction
        , Table(..), Beamable
        , defTblFieldSettings, pk
    
        , Columnar, C, Columnar', Nullable
        , TableField, fieldName
    
        , TableSettings, HaskellTable
    
        -- * 'Generic'-deriving mechanisms
        , defaultDbSettings
    
        -- ** Modifying the derived schema
        , DatabaseModification, EntityModification, FieldModification
        , withDbModification, withTableModification
        , dbModification, tableModification
        , modifyTable, fieldNamed
    
        -- * Types for lens generation
        , Lenses, LensFor(..)
    

    Beamable No usage example found for this symbol :( Collapse [-]
    C No usage example found for this symbol :( Collapse [-]
    Columnar No usage example found for this symbol :( Collapse [-]
    Columnar' No usage example found for this symbol :( Collapse [-]
    ComposeColumnar No usage example found for this symbol :( Collapse [-]
    Database No usage example found for this symbol :( Collapse [-]
    DatabaseEntity No usage example found for this symbol :( Collapse [-]
    DatabaseEntityDescriptor No usage example found for this symbol :( Collapse [-]
    DatabaseModification No usage example found for this symbol :( Collapse [-]
    DatabaseSettings No usage example found for this symbol :( Collapse [-]
    DomainTypeEntity No usage example found for this symbol :( Collapse [-]
    EntityModification No usage example found for this symbol :( Collapse [-]
    FieldModification No usage example found for this symbol :( Collapse [-]
    FieldRenamer No usage example found for this symbol :( Collapse [-]
    FieldsFulfillConstraint No usage example found for this symbol :( Collapse [-]
    FieldsFulfillConstraintNullable No usage example found for this symbol :( Collapse [-]
    GFieldsFulfillConstraint No usage example found for this symbol :( Collapse [-]
    HaskellTable No usage example found for this symbol :( Collapse [-]
    Ignored No usage example found for this symbol :( Collapse [-]
    IsDatabaseEntity No usage example found for this symbol :( Collapse [-]
    LensFor No usage example found for this symbol :( Collapse [-]
    Lenses No usage example found for this symbol :( Collapse [-]
    RenamableField No usage example found for this symbol :( Collapse [-]
    RenamableWithRule No usage example found for this symbol :( Collapse [-]
    ReplaceBaseTag No usage example found for this symbol :( Collapse [-]
    Retaggable No usage example found for this symbol :( Collapse [-]
    Table No usage example found for this symbol :( Collapse [-]
    TableEntity No usage example found for this symbol :( Collapse [-]
    TableField No usage example found for this symbol :( Collapse [-]
    TableSettings No usage example found for this symbol :( Collapse [-]
    TableSkeleton No usage example found for this symbol :( Collapse [-]
    TagReducesTo No usage example found for this symbol :( Collapse [-]
    ViewEntity No usage example found for this symbol :( Collapse [-]
    WithConstraint No usage example found for this symbol :( Collapse [-]