Instances1ContextName
type ContextName QAggregateContext =Defined in beam-core-0.11.1.0 · Database.Beam.Query.Internal"an aggregate"
:: a typeCtrl KGHC 10.0.0.20260917 · lts/ghc-10.0.x · 8c2f8e8 · 2026-10-19
Modulebeam-core-0.11.1.0Haskell2010
module Database.Beam.Query.Types
A context is a type-level value that signifies where an expression can be used. For example, QExpr corresponds to QGenExprs that result in values. In reality, QExpr is really QGenExpr parameterized over the QValueContext. Similarly, QAgg represents expressions that contain aggregates, but it is just QGenExpr parameterized over QAggregateContext
type ContextName QAggregateContext = "an aggregate"
Defined in beam-core-0.11.1.0 · Database.Beam.Query.InternalBeamable tbl => QGroupable (tbl (Nullable (QExpr be s))) (tbl (Nullable (QGroupExpr be s)))Defined in beam-core-0.11.1.0 · Database.Beam.Query.AggregateBeamable tbl => QGroupable (tbl (QExpr be s)) (tbl (QGroupExpr be s))Defined in beam-core-0.11.1.0 · Database.Beam.Query.AggregateQGroupable (QExpr be s a) (QGroupExpr be s a)Defined in beam-core-0.11.1.0 · Database.Beam.Query.Aggregategroup_ for simple value expressions.
type ContextName QGroupingContext = "an aggregate grouping"
Defined in beam-core-0.11.1.0 · Database.Beam.Query.Internal(BeamSqlBackend be, Beamable tbl) => SqlUpdatable be s (tbl (Nullable (QField s))) (tbl (Nullable (QExpr be s)))Defined in beam-core-0.11.1.0 · Database.Beam.Query.Combinators(BeamSqlBackend be, Beamable tbl) => SqlUpdatable be s (tbl (QField s)) (tbl (QExpr be s))Defined in beam-core-0.11.1.0 · Database.Beam.Query.CombinatorsBeamSqlBackend be => SqlUpdatable be s (QField s a) (QExpr be s a)Defined in beam-core-0.11.1.0 · Database.Beam.Query.CombinatorsBeamable tbl => QGroupable (tbl (Nullable (QExpr be s))) (tbl (Nullable (QGroupExpr be s)))Defined in beam-core-0.11.1.0 · Database.Beam.Query.AggregateBeamable tbl => QGroupable (tbl (QExpr be s)) (tbl (QGroupExpr be s))Defined in beam-core-0.11.1.0 · Database.Beam.Query.Aggregate(Table t, BeamSqlBackend be) => SqlJustable (t (QExpr be s)) (t (Nullable (QExpr be s)))Defined in beam-core-0.11.1.0 · Database.Beam.Query.Combinators(Table t, BeamSqlBackend be) => SqlJustable (PrimaryKey t (QExpr be s)) (PrimaryKey t (Nullable (QExpr be s)))Defined in beam-core-0.11.1.0 · Database.Beam.Query.CombinatorsQGroupable (QExpr be s a) (QGroupExpr be s a)Defined in beam-core-0.11.1.0 · Database.Beam.Query.Aggregategroup_ for simple value expressions.
BeamSqlBackend be => SqlJustable (QExpr be s a) (QExpr be s (Maybe a))Defined in beam-core-0.11.1.0 · Database.Beam.Query.Combinatorstype ContextName QValueContext = "a value"
Defined in beam-core-0.11.1.0 · Database.Beam.Query.Internaltype ContextName QWindowingContext = "a window expression"
Defined in beam-core-0.11.1.0 · Database.Beam.Query.Internaltype ContextName QWindowFrameContext = "a window frame"
Defined in beam-core-0.11.1.0 · Database.Beam.Query.InternalA version of the table where each field is a QGenExpr
Semigroup (QAssignment be s)Defined in beam-core-0.11.1.0 · Database.Beam.Query.InternalMonoid (QAssignment be s)Defined in beam-core-0.11.1.0 · Database.Beam.Query.InternalBeamable t => ProjectibleWithPredicate AnyType () Text (t (Nullable (QField s)))Defined in beam-core-0.11.1.0 · Database.Beam.Query.InternalBeamable t => ProjectibleWithPredicate AnyType () Text (t (QField s))Defined in beam-core-0.11.1.0 · Database.Beam.Query.InternalProjectibleWithPredicate AnyType () Text (QField s a)Defined in beam-core-0.11.1.0 · Database.Beam.Query.Internal(BeamSqlBackend be, Beamable tbl) => SqlUpdatable be s (tbl (Nullable (QField s))) (tbl (Nullable (QExpr be s)))Defined in beam-core-0.11.1.0 · Database.Beam.Query.Combinators(BeamSqlBackend be, Beamable tbl) => SqlUpdatable be s (tbl (QField s)) (tbl (QExpr be s))Defined in beam-core-0.11.1.0 · Database.Beam.Query.CombinatorsBeamSqlBackend be => SqlUpdatable be s (QField s a) (QExpr be s a)Defined in beam-core-0.11.1.0 · Database.Beam.Query.CombinatorsEq (QField s ty)Defined in beam-core-0.11.1.0 · Database.Beam.Query.InternalOrd (QField s ty)Defined in beam-core-0.11.1.0 · Database.Beam.Query.InternalShow (QField s ty)Defined in beam-core-0.11.1.0 · Database.Beam.Query.InternalIntroduce all entries of a view into the Q monad
Introduce all entries of a table into the Q monad
Convenience function that allows you to use type applications to specify the result of a QGenExpr.
Useful to disambiguate the types of QGenExprs without having to provide a
complete type signature. As an example, the countAll_ aggregate can
return a result of any Integral type. Without further constraints, the
type is ambiguous. You can use as_ to disambiguate the return type.
For example, this is ambiguous
aggregate_ (\_ -> countAll_) ..But this is not
aggregate_ (\_ -> as_ @Int32 countAll_) ..Produce a QOrd corresponding to a SQL ASC ordering
SQL BIT_LENGTH function
SQL CHAR_LENGTH function
SQL COALESCE support
SQL CURRENT_TIMESTAMP function
Extract an expression representing the current (non-UPDATEd) value of a QField
Produce a QOrd corresponding to a SQL DESC ordering
Use the SQL99 DISTINCT operator to determine if the given query produces a distinct result
SQL EXCEPT ALL operator
SQL EXCEPT operator
Use the SQL EXISTS operator to determine if the given query returns any results
frame_ :: (BeamSql2003ExpressionBackend be, SqlOrderable be ordering, Projectible be partition)=> Maybe partitionPARTITION BY
-> Maybe orderingORDER BY
-> QFrameBounds beRANGE / ROWS
-> QWindow be sSpecify a window frame with all the options
Convert a Maybe value to a concrete value, by suppling a default
SQL INTERSECT ALL operator
SQL INTERSECT operator
Introduce a table using a left join. The ON clause is required here.Because this is not an inner join, the resulting table is made nullable. This means that each field that would normally have type 'QExpr x' will now have type 'QExpr (Maybe x)'.
The ON condition given must return Bool. For a version that
accepts an ON condition returning SqlBool, see leftJoin_'.
Conditionally limit the number of results returned by a query.
Limit the number of results returned by a query.
See also limitMaybe_ to conditionally apply a limit.
SQL LOWER function
Only return distinct values from a query
SQL OCTET_LENGTH function
Conditionally drop the first offset results.
Drop the first offset results.
See also offsetMaybe_ to conditionally apply an offset
Order by the given expressions. The return type of the ordering key should either be the result of asc_ or desc_ (or another ordering QOrd generated by a backend-specific ordering) or an (possibly nested) tuple of results of the former.
The manual section has more information.
Outer join. every row of each table, returning NULL for any row
of either table for which the join condition finds no related rows.
This expects a join expression returning Bool, for a version that
accepts a SqlBool (a possibly UNKNOWN boolean, that maps more
closely to the SQL standard), see outerJoin_'
Like outerJoin_, but accepting SqlBool. Pairs of rows for which the join condition is unknown are considered to be unrelated, by SQL compliant databases at least.
Produce a window expression given an aggregate function and a window.
Introduce a table using a left join with no ON clause. Because this is not an inner join, the resulting table is made nullable. This means that each field that would normally have type 'QExpr x' will now have type 'QExpr (Maybe x)'.
SQL POSITION(.. IN ..) function
Generate an appropriate boolean QGenExpr comparing the given foreign key to the given table. Useful for creating join conditions. Use references_' for a SqlBool comparison.
Generate an appropriate boolean QGenExpr comparing the given foreign key to the given table. Useful for creating join conditions. Use references_ for a Bool comparison.
Project the (presumably) singular result of the given query as an expression
SQL TRIM function
SQL UNION ALL operator
SQL UNION operator
Use the SQL UNIQUE operator to determine if the given query produces a unique result
SQL UPPER function
SQL VALUES clause. Introduce the elements of the given non-empty list as
rows in a joined table.
withWindow_ :: (ProjectibleWithPredicate WindowFrameContext be (WithExprContext (BeamSqlBackendWindowFrameSyntax' be)) window, Projectible be r, Projectible be a, ContextRewritable a, ThreadRewritable (QNested s) (WithRewrittenContext a QValueContext))=> (r -> window)Window builder function
-> (r -> window -> a)Projection builder function. Has access to the windows generated above
-> Q be db (QNested s) rQuery to window over
-> Q be db s (WithRewrittenThread (QNested s) s (WithRewrittenContext a QValueContext))Compute a query over windows.
The first function builds window frames using the frame_, partitionBy_, etc functions. The return type can be a single frame, tuples of frame, or any arbitrarily nested tuple of the above. Instances up to 8-tuples are provided.
The second function builds the resulting projection using the result of the subquery as well as the window frames built in the first function. In this function, window expressions can be included in the output using the over_ function.
type HaskellLiteralForQExpr (QGenExpr context be s a) = aDefined in beam-core-0.11.1.0 · Database.Beam.Query.Combinatorstype HaskellLiteralForQExpr (table (Nullable f)) = HaskellLiteralForQExpr_AddNullable (HaskellLiteralForQExpr (table f))Defined in beam-core-0.11.1.0 · Database.Beam.Query.Combinatorstype HaskellLiteralForQExpr (table (QGenExpr context be s)) = table IdentityDefined in beam-core-0.11.1.0 · Database.Beam.Query.Combinatorsclass BeamSqlBackend be => SqlDeconstructMaybe be a nonNullA s | a s -> be, a -> nonNullA, a -> s, nonNullA -> s whereType class for anything which can be checked for null-ness. This includes 'QExpr (Maybe a)' as well as Tables or PrimaryKeys over 'Nullable QExpr'.
isJust_ :: a -> QGenExpr ctxt be s BoolReturns a QExpr that evaluates to true when the first argument is not null
isNothing_ :: a -> QGenExpr ctxt be s BoolReturns a QExpr that evaluates to true when the first argument is null
maybe_ :: QGenExpr ctxt be s y -> (nonNullA -> QGenExpr ctxt be s y) -> a -> QGenExpr ctxt be s yGiven an object (third argument) which may or may not be null, return the default value if null (first argument), or transform the value that could be null to yield the result of the expression (second argument)
(BeamSqlBackend be, Beamable t) => SqlDeconstructMaybe be (t (Nullable (QGenExpr ctxt be s))) (t (QGenExpr ctxt be s)) sDefined in beam-core-0.11.1.0 · Database.Beam.Query.CombinatorsBeamSqlBackend be => SqlDeconstructMaybe be (QGenExpr ctxt be s (Maybe x)) (QGenExpr ctxt be s x) sDefined in beam-core-0.11.1.0 · Database.Beam.Query.CombinatorsType class for things that can be nullable. This includes 'QExpr (Maybe a)', 'tbl (Nullable QExpr)', and 'PrimaryKey tbl (Nullable QExpr)'
just_ :: a -> bGiven something of type 'QExpr a', 'tbl QExpr', or 'PrimaryKey tbl QExpr', turn it into a 'QExpr (Maybe a)', 'tbl (Nullable QExpr)', or 'PrimaryKey t (Nullable QExpr)' respectively that contains the same values.
nothing_ :: bReturn either a 'QExpr (Maybe x)' representing Nothing or a nullable Table or PrimaryKey filled with Nothing.
Table t => SqlJustable (t Identity) (t (Nullable Identity))Defined in beam-core-0.11.1.0 · Database.Beam.Query.Combinators(Table t, BeamSqlBackend be) => SqlJustable (t (QExpr be s)) (t (Nullable (QExpr be s)))Defined in beam-core-0.11.1.0 · Database.Beam.Query.CombinatorsTable t => SqlJustable (PrimaryKey t Identity) (PrimaryKey t (Nullable Identity))Defined in beam-core-0.11.1.0 · Database.Beam.Query.Combinators(Table t, BeamSqlBackend be) => SqlJustable (PrimaryKey t (QExpr be s)) (PrimaryKey t (Nullable (QExpr be s)))Defined in beam-core-0.11.1.0 · Database.Beam.Query.CombinatorsBeamSqlBackend be => SqlJustable (QExpr be s a) (QExpr be s (Maybe a))Defined in beam-core-0.11.1.0 · Database.Beam.Query.CombinatorsSqlOrderable be a => SqlOrderable be [a]Defined in beam-core-0.11.1.0 · Database.Beam.Query.Combinators(SqlOrderable be a, SqlOrderable be b) => SqlOrderable be (a, b)Defined in beam-core-0.11.1.0 · Database.Beam.Query.CombinatorsSqlOrderable be (QOrd be s a)Defined in beam-core-0.11.1.0 · Database.Beam.Query.Combinators(SqlOrderable be a, SqlOrderable be b, SqlOrderable be c) => SqlOrderable be (a, b, c)Defined in beam-core-0.11.1.0 · Database.Beam.Query.CombinatorsTypeError ('Text "Missing mandatory sorting order. Use either 'asc_' or 'desc_' to specify sorting order."
) => SqlOrderable be (QGenExpr ctx be s a)Defined in beam-core-0.11.1.0 · Database.Beam.Query.Combinators(SqlOrderable be a, SqlOrderable be b, SqlOrderable be c, SqlOrderable be d) => SqlOrderable be (a, b, c, d)Defined in beam-core-0.11.1.0 · Database.Beam.Query.Combinators(SqlOrderable be a, SqlOrderable be b, SqlOrderable be c, SqlOrderable be d, SqlOrderable be e) => SqlOrderable be (a, b, c, d, e)Defined in beam-core-0.11.1.0 · Database.Beam.Query.Combinators(SqlOrderable be a, SqlOrderable be b, SqlOrderable be c, SqlOrderable be d, SqlOrderable be e, SqlOrderable be f) => SqlOrderable be (a, b, c, d, e, f)Defined in beam-core-0.11.1.0 · Database.Beam.Query.Combinators(SqlOrderable be a, SqlOrderable be b, SqlOrderable be c, SqlOrderable be d, SqlOrderable be e, SqlOrderable be f, SqlOrderable be g) => SqlOrderable be (a, b, c, d, e, f, g)Defined in beam-core-0.11.1.0 · Database.Beam.Query.Combinators(SqlOrderable be a, SqlOrderable be b, SqlOrderable be c, SqlOrderable be d, SqlOrderable be e, SqlOrderable be f, SqlOrderable be g, SqlOrderable be h) => SqlOrderable be (a, b, c, d, e, f, g, h)Defined in beam-core-0.11.1.0 · Database.Beam.Query.Combinatorsval_ :: HaskellLiteralForQExpr a -> a(Beamable table, BeamSqlBackend be, FieldsFulfillConstraint (BeamSqlBackendCanSerialize be) table) => SqlValable (table (QGenExpr ctxt be s))Defined in beam-core-0.11.1.0 · Database.Beam.Query.Combinators(Beamable table, BeamSqlBackend be, FieldsFulfillConstraintNullable (BeamSqlBackendCanSerialize be) table) => SqlValable (table (Nullable (QGenExpr ctxt be s)))Defined in beam-core-0.11.1.0 · Database.Beam.Query.Combinators(BeamSqlBackendCanSerialize be a, BeamSqlBackend be) => SqlValable (QGenExpr ctxt be s a)Defined in beam-core-0.11.1.0 · Database.Beam.Query.Combinatorstype SqlValableTable be (table :: (Type -> Type) -> Type) = (Beamable table, FieldsFulfillConstraint (HasSqlValueSyntax (BeamSqlBackendValueSyntax be)) table)Used to define many-to-many relationships with additional data. Takes the join table and two key extraction functions from that table to the related tables. Also takes two Qs representing the table sources to relate.
See the manual for more information.
Used to define many-to-many relationships without any additional data. Takes the join table and two key extraction functions from that table to the related tables. Also takes two Qs representing the table sources to relate.
See the manual for more information.
oneToManyOptional_ :: (BeamSqlBackend be, Database be db, Table tbl, Table rel, HasTableEqualityNullable be (PrimaryKey tbl))=> DatabaseEntity be db (TableEntity rel)Table to fetch
-> (rel (QExpr be s) -> PrimaryKey tbl (Nullable (QExpr be s)))Foreign key
-> tbl (QExpr be s)-> Q be db s (rel (Nullable (QExpr be s)))Used to define one-to-many (or one-to-one) relationships with a nullable foreign key. Takes the table to fetch, a way to extract the foreign key from that table, and the table to relate to.
oneToMany_ :: (Database be db, BeamSqlBackend be, HasTableEquality be (PrimaryKey tbl), Table tbl, Table rel)=> DatabaseEntity be db (TableEntity rel)Table to fetch (many)
-> (rel (QExpr be s) -> PrimaryKey tbl (QExpr be s))Foreign key
-> tbl (QExpr be s)-> Q be db s (rel (QExpr be s))Used to define one-to-many (or one-to-one) relationships. Takes the table to fetch, a way to extract the foreign key from that table, and the table to relate to.
oneToMaybe_ :: (BeamSqlBackend be, Database be db, Table tbl, Table rel, HasTableEqualityNullable be (PrimaryKey tbl))=> DatabaseEntity be db (TableEntity rel)Table to fetch
-> (rel (QExpr be s) -> PrimaryKey tbl (Nullable (QExpr be s)))Foreign key
-> tbl (QExpr be s)-> Q be db s (rel (Nullable (QExpr be s)))Used to define one-to-many (or one-to-one) relationships with a nullable foreign key. Takes the table to fetch, a way to extract the foreign key from that table, and the table to relate to.
oneToOne_ :: (Database be db, BeamSqlBackend be, HasTableEquality be (PrimaryKey tbl), Table tbl, Table rel)=> DatabaseEntity be db (TableEntity rel)Table to fetch (many)
-> (rel (QExpr be s) -> PrimaryKey tbl (QExpr be s))Foreign key
-> tbl (QExpr be s)-> Q be db s (rel (QExpr be s))Used to define one-to-many (or one-to-one) relationships. Takes the table to fetch, a way to extract the foreign key from that table, and the table to relate to.
type ManyToMany be (db :: (Type -> Type) -> Type) (left :: (Type -> Type) -> Type) (right :: (Type -> Type) -> Type) = forall s. (BeamSqlBackend be, SqlEq (QExpr be s) (PrimaryKey left (QExpr be s)), SqlEq (QExpr be s) (PrimaryKey right (QExpr be s))) => Q be db s (left (QExpr be s)) -> Q be db s (right (QExpr be s)) -> Q be db s (left (QExpr be s), right (QExpr be s))Convenience type to declare many-to-many relationships. See the manual section on relationships for more information
type ManyToManyThrough be (db :: (Type -> Type) -> Type) (through :: (Type -> Type) -> Type) (left :: (Type -> Type) -> Type) (right :: (Type -> Type) -> Type) = forall s. (BeamSqlBackend be, SqlEq (QExpr be s) (PrimaryKey left (QExpr be s)), SqlEq (QExpr be s) (PrimaryKey right (QExpr be s))) => Q be db s (left (QExpr be s)) -> Q be db s (right (QExpr be s)) -> Q be db s (through (QExpr be s), left (QExpr be s), right (QExpr be s))Convenience type to declare many-to-many relationships with additional data. See the manual section on relationships for more information
type OneToMany be (db :: (Type -> Type) -> Type) s (one :: (Type -> Type) -> Type) (many :: (Type -> Type) -> Type) = (BeamSqlBackend be, BeamSqlBackendCanSerialize be Bool) => one (QExpr be s) -> Q be db s (many (QExpr be s))Convenience type to declare one-to-many relationships. See the manual section on relationships for more information
type OneToManyOptional be (db :: (Type -> Type) -> Type) s (tbl :: (Type -> Type) -> Type) (rel :: (Type -> Type) -> Type) = (BeamSqlBackend be, BeamSqlBackendCanSerialize be Bool, BeamSqlBackendCanSerialize be SqlNull) => tbl (QExpr be s) -> Q be db s (rel (Nullable (QExpr be s)))Convenience type to declare one-to-many relationships with a nullable foreign key. See the manual section on relationships for more information
type OneToMaybe be (db :: (Type -> Type) -> Type) s (tbl :: (Type -> Type) -> Type) (rel :: (Type -> Type) -> Type) = OneToManyOptional be db s tbl relSynonym of OneToManyOptional. Useful for giving more meaningful types, when the relationship is meant to be one-to-one.
type OneToOne be (db :: (Type -> Type) -> Type) s (one :: (Type -> Type) -> Type) (many :: (Type -> Type) -> Type) = OneToMany be db s one manySynonym of OneToMany. Useful for giving more meaningful types, when the relationship is meant to be one-to-one.
Introduces the result of a previous selecting (a CTE) into a new query
Introduce the result of a query as a result in a common table expression. The returned value can be used in future queries by applying reuse.
Monad in which SELECT statements can be made (via selecting)
and bound to result names for re-use later. This has the advantage
of only computing each result once. In SQL, this is translated to a
common table expression.
Once introduced, results can be re-used in future queries with reuse.
With is also a member of MonadFix for backends that support
recursive CTEs. In this case, you can use mdo or rec notation
(with RecursiveDo enabled) to bind result values (again, using
reuse) even before they're introduced.
See further documentation here.
Monad (With be db)Defined in beam-core-0.11.1.0 · Database.Beam.Query.CTEFunctor (With be db)Defined in beam-core-0.11.1.0 · Database.Beam.Query.CTEIsSql99RecursiveCommonTableExpressionSelectSyntax (BeamSqlBackendSelectSyntax be) => MonadFix (With be db)Defined in beam-core-0.11.1.0 · Database.Beam.Query.CTEApplicative (With be db)Defined in beam-core-0.11.1.0 · Database.Beam.Query.CTEExtracts the given field from the target expression
Extracts the hours, minutes, or seconds from any timestamp or time field
Extracts the hours, minutes, or seconds from any timestamp or time field
Extracts the hours, minutes, or seconds from any timestamp or time field
A field that can be extracted from SQL expressions of type tgt
that results in a type a, in backend be.
Type-class for types that contain a date component
HasSqlDate DayDefined in beam-core-0.11.1.0 · Database.Beam.Query.ExtractHasSqlDate UTCTimeDefined in beam-core-0.11.1.0 · Database.Beam.Query.ExtractHasSqlDate LocalTimeDefined in beam-core-0.11.1.0 · Database.Beam.Query.ExtractType-class for types that contain a time component
HasSqlTime UTCTimeDefined in beam-core-0.11.1.0 · Database.Beam.Query.ExtractHasSqlTime LocalTimeDefined in beam-core-0.11.1.0 · Database.Beam.Query.ExtractHasSqlTime TimeOfDayDefined in beam-core-0.11.1.0 · Database.Beam.Query.ExtractSQL AND operator
SQL AND operator for SqlBool
SQL CONCAT function
SQL / operator
SQL LIKE operator
SQL LIKE operator but heterogeneous over the text type
SQL % operator
SQL NOT operator
SQL99 SIMILAR TO operator
SQL99 SIMILAR TO operator but heterogeneous over the text type
SQL NOT operator, but operating on SqlBool instead
SQL OR operator
SQL OR operator
Phantom type representing a SQL Tri-state boolean -- true, false, and unknown
This type has no values because it cannot be sent to or retrieved
from the database directly. Use isTrue_, isFalse_,
isNotTrue_, isNotFalse_, isUnknown_, isNotUnknown_, and
unknownAs_ to retrieve the corresponding Bool value.
SQL IS TRUE operator
SQL IS NOT TRUE operator
SQL IS FALSE operator
SQL IS NOT FALSE operator
SQL IS UNKNOWN operator
SQL IS NOT UNKNOWN operator
Return the first argument if the expression has the unknown SQL value See sqlBool_ for the inverse
Convert a known not null bool to a SqlBool. See unknownAs_ for the inverse
Class for Haskell types that can be compared for equality in the given backend
sqlEqE :: Proxy a -> Proxy be -> BeamSqlBackendExpressionSyntax be -> BeamSqlBackendExpressionSyntax be -> BeamSqlBackendExpressionSyntax besqlNeqE :: Proxy a -> Proxy be -> BeamSqlBackendExpressionSyntax be -> BeamSqlBackendExpressionSyntax be -> BeamSqlBackendExpressionSyntax besqlEqTriE :: Proxy a -> Proxy be -> BeamSqlBackendExpressionSyntax be -> BeamSqlBackendExpressionSyntax be -> BeamSqlBackendExpressionSyntax beTri-state equality
sqlNeqTriE :: Proxy a -> Proxy be -> BeamSqlBackendExpressionSyntax be -> BeamSqlBackendExpressionSyntax be -> BeamSqlBackendExpressionSyntax beTri-state equality
HasSqlEqualityCheck be a => HasSqlEqualityCheck be (SqlSerial a)Defined in beam-core-0.11.1.0 · Database.Beam.Query.Ord(HasSqlEqualityCheck be a, CanCheckMaybeEquality a) => HasSqlEqualityCheck be (Maybe a)Defined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) IntegerDefined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) Int16Defined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) Int32Defined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) Int64Defined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) Int8Defined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) BoolDefined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) DoubleDefined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) FloatDefined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) IntDefined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) WordDefined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) Word16Defined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) Word32Defined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) Word64Defined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) Word8Defined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) TextDefined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) DayDefined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) UTCTimeDefined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) LocalTimeDefined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlEqualityCheck (MockSqlBackend cmd) TimeOfDayDefined in beam-core-0.11.1.0 · Database.Beam.Query.Ord(BeamSqlBackend (MockSqlBackend cmd), HasSqlEqualityCheck (MockSqlBackend cmd) a) => HasSqlEqualityCheck (MockSqlBackend cmd) (Tagged t a)Defined in beam-core-0.11.1.0 · Database.Beam.Query.OrdClass for Haskell types that can be compared for quantified equality in the given backend
sqlQEqE :: Proxy a -> Proxy be -> Maybe (BeamSqlBackendExpressionQuantifierSyntax be) -> BeamSqlBackendExpressionSyntax be -> BeamSqlBackendExpressionSyntax be -> BeamSqlBackendExpressionSyntax besqlQNeqE :: Proxy a -> Proxy be -> Maybe (BeamSqlBackendExpressionQuantifierSyntax be) -> BeamSqlBackendExpressionSyntax be -> BeamSqlBackendExpressionSyntax be -> BeamSqlBackendExpressionSyntax beHasSqlQuantifiedEqualityCheck syntax a => HasSqlQuantifiedEqualityCheck syntax (SqlSerial a)Defined in beam-core-0.11.1.0 · Database.Beam.Query.Ord(HasSqlQuantifiedEqualityCheck syntax a, CanCheckMaybeEquality a) => HasSqlQuantifiedEqualityCheck syntax (Maybe a)Defined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) IntegerDefined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) Int16Defined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) Int32Defined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) Int64Defined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) Int8Defined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) BoolDefined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) DoubleDefined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) FloatDefined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) IntDefined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) WordDefined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) Word16Defined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) Word32Defined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) Word64Defined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) Word8Defined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) TextDefined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) DayDefined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) UTCTimeDefined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) LocalTimeDefined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend (MockSqlBackend cmd) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) TimeOfDayDefined in beam-core-0.11.1.0 · Database.Beam.Query.Ord(BeamSqlBackend (MockSqlBackend cmd), HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) a) => HasSqlQuantifiedEqualityCheck (MockSqlBackend cmd) (Tagged t a)Defined in beam-core-0.11.1.0 · Database.Beam.Query.Ordtype HasTableEquality be (tbl :: (Type -> Type) -> Type) = (FieldsFulfillConstraint (HasSqlEqualityCheck be) tbl, Beamable tbl)Constraint synonym to check if two tables can be compared for equality
Class for expression types or expression containers for which there is a notion of equality.
Instances are provided to check the equality of expressions of the same type as well as entire Beamable types parameterized over QGenExpr
(==.) :: a -> a -> expr Boolinfix 4Given two expressions, returns whether they are equal, using Haskell semantics (NULLs handled properly)
(/=.) :: a -> a -> expr Boolinfix 4Given two expressions, returns whether they are not equal, using Haskell semantics (NULLs handled properly)
(==?.) :: a -> a -> expr SqlBoolinfix 4Given two expressions, returns the SQL tri-state boolean when compared for equality
(/=?.) :: a -> a -> expr SqlBoolinfix 4Given two expressions, returns the SQL tri-state boolean when compared for inequality
(BeamSqlBackend be, Beamable tbl, FieldsFulfillConstraint (HasSqlEqualityCheck be) tbl) => SqlEq (QGenExpr context be s) (tbl (QGenExpr context be s))Defined in beam-core-0.11.1.0 · Database.Beam.Query.Ord(BeamSqlBackend be, Beamable tbl, FieldsFulfillConstraintNullable (HasSqlEqualityCheck be) tbl) => SqlEq (QGenExpr context be s) (tbl (Nullable (QGenExpr context be s)))Defined in beam-core-0.11.1.0 · Database.Beam.Query.Ord(BeamSqlBackend be, HasSqlEqualityCheck be a) => SqlEq (QGenExpr context be s) (QGenExpr context be s a)Defined in beam-core-0.11.1.0 · Database.Beam.Query.OrdCompare two arbitrary expressions (of the same type) for equality
Class for expression types or expression containers for which there is a notion of ordering.
Instances are provided to check the ordering of expressions of the same type. Since there is no universal notion of ordering for an arbitrary number of expressions, no instance is provided for Beamable types.
BeamSqlBackend be => SqlOrd (QGenExpr context be s) (QGenExpr context be s a)Defined in beam-core-0.11.1.0 · Database.Beam.Query.Ord(HasSqlInTable be, Beamable table) => SqlIn (QGenExpr context be s) (table (QGenExpr context be s))Defined in beam-core-0.11.1.0 · Database.Beam.Query.OrdBeamSqlBackend be => SqlIn (QGenExpr context be s) (QGenExpr context be s a)Defined in beam-core-0.11.1.0 · Database.Beam.Query.OrdClass for backends which support SQL IN on lists of row values, which is
not part of ANSI SQL. This is useful for IN on primary keys.
inRowValuesE :: Proxy be -> BeamSqlBackendExpressionSyntax be -> [BeamSqlBackendExpressionSyntax be] -> BeamSqlBackendExpressionSyntax beclass SqlEq expr a => SqlEqQuantified (expr :: Type -> Type) quantified a | a -> expr quantified whereClass for expression types for which there is a notion of quantified equality.
(BeamSqlBackend be, HasSqlQuantifiedEqualityCheck be a) => SqlEqQuantified (QGenExpr context be s) (QQuantified be s a) (QGenExpr context be s a)Defined in beam-core-0.11.1.0 · Database.Beam.Query.OrdTwo arbitrary expressions can be quantifiably compared for equality.
class SqlOrd expr e => SqlOrdQuantified (expr :: Type -> Type) quantified e | e -> expr quantified whereClass for things which can be quantifiably compared.
BeamSqlBackend be => SqlOrdQuantified (QGenExpr context be s) (QQuantified be s a) (QGenExpr context be s a)Defined in beam-core-0.11.1.0 · Database.Beam.Query.OrdA data structure representing the set to quantify a comparison operator over.
(BeamSqlBackend be, HasSqlQuantifiedEqualityCheck be a) => SqlEqQuantified (QGenExpr context be s) (QQuantified be s a) (QGenExpr context be s a)Defined in beam-core-0.11.1.0 · Database.Beam.Query.OrdTwo arbitrary expressions can be quantifiably compared for equality.
BeamSqlBackend be => SqlOrdQuantified (QGenExpr context be s) (QQuantified be s a) (QGenExpr context be s a)Defined in beam-core-0.11.1.0 · Database.Beam.Query.OrdA QQuantified representing a SQL ANY(..) for use with a
quantified comparison operator
Accepts a subquery. Use anyIn_ for an explicit list
A QQuantified representing a SQL ALL(..) for use with a
quantified comparison operator
Accepts a subquery. Use allIn_ for an explicit list
A QQuantified representing a SQL ANY(..) for use with a
quantified comparison operator
Accepts an explicit list of typed expressions. Use anyOf_ for a subquery
A QQuantified representing a SQL ALL(..) for use with a
quantified comparison operator
Accepts an explicit list of typed expressions. Use allOf_ for a subquery
SQL BETWEEN clause
aggregate_ :: (BeamSqlBackend be, Aggregable be a, Projectible be r, Projectible be a, ContextRewritable a, ThreadRewritable (QNested s) (WithRewrittenContext a QValueContext))=> (r -> a)Aggregate projection
-> Q be db (QNested s) rQuery to aggregate over
-> Q be db s (WithRewrittenThread (QNested s) s (WithRewrittenContext a QValueContext))Compute an aggregate over a query.
The supplied aggregate projection should return an aggregate expression (an expression containing an aggregate function such as count_, sum_, countAll_, etc), a grouping key (specified with the group_ function), or a combination of tuples of the above.
Appropriate instances are provided up to 8-tuples.
Semantically, all grouping expressions in the projection will be added to a
SQL GROUP BY clause and all aggregate expressions will be computed.
The return value will be the type of the aggregate projection, but transformed to be in the normal value context (i.e., everything will become QExprs).
For usage examples, see the manual.
Compute an aggregate over all values in a group. Corresponds to the
AGG(ALL ..) syntax. Note that ALL is the default for most aggregations,
so you don't normally explicitly specify ALL. However, if you need to,
you can use this function. To be explicit about quantification in the beam
query DSL, but not produce an explicit ALL, use allInGroup_.
allInGroup_ has the same semantic meaning, but does not produce an
explicit ALL.
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_.
SQL EVERY, SOME, and ANY aggregates. Operates over
SqlBool only, as the result can be NULL, even if all inputs are
known (no input rows).
SQL99 ANY(ALL ..) function (but without the explicit ALL)
SQL AVG(ALL ..) function (but without the explicit ALL)
SQL COUNT(*) function
SQL COUNT(ALL ..) function (but without the explicit ALL)
SQL2003 CUME_DIST function (Requires T612 Advanced OLAP operations support)
SQL2003 DENSE_RANK function (Requires T612 Advanced OLAP operations support)
Compute an aggregate only over distinct values in a group. Corresponds to
the AGG(DISTINCT ..) syntax.
SQL EVERY, SOME, and ANY aggregates. Operates over
SqlBool only, as the result can be NULL, even if all inputs are
known (no input rows).
SQL99 EVERY(ALL ..) function (but without the explicit ALL)
Support for FILTER (WHERE ...) syntax for aggregates. Part of SQL2003 Elementary OLAP operations feature (T611).
See filterWhere_' for a version that accepts SqlBool.
Like filterWhere_ but accepting SqlBool.
SQL MAX(ALL ..) function (but without the explicit ALL)
SQL MIN(ALL ..) function (but without the explicit ALL)
SQL2003 PERCENT_RANK function (Requires T612 Advanced OLAP operations support)
SQL2003 RANK function (Requires T611 Elementary OLAP operations support)
SQL2003 ROW_NUMBER function
SQL EVERY, SOME, and ANY aggregates. Operates over
SqlBool only, as the result can be NULL, even if all inputs are
known (no input rows).
SQL99 SOME(ALL ..) function (but without the explicit ALL)
SQL SUM(ALL ..) function (but without the explicit ALL)
Type class for grouping keys. expr is the type of the grouping key after
projection. grouped is the type of the grouping key in the aggregate
expression (usually something that contains QGenExprs in the
QGroupingContext).
group_ :: expr -> groupedBeamable tbl => QGroupable (tbl (Nullable (QExpr be s))) (tbl (Nullable (QGroupExpr be s)))Defined in beam-core-0.11.1.0 · Database.Beam.Query.AggregateBeamable tbl => QGroupable (tbl (QExpr be s)) (tbl (QGroupExpr be s))Defined in beam-core-0.11.1.0 · Database.Beam.Query.AggregateQGroupable (QExpr be s a) (QGroupExpr be s a)Defined in beam-core-0.11.1.0 · Database.Beam.Query.Aggregategroup_ for simple value expressions.
SELECTRepresents a select statement in the given backend, returning
rows of type a.
Convenience function to generate a SqlSelect that looks up a table row given a primary key.
Use a special debug syntax to print out an ANSI Standard SELECT statement
that may be generated for a given Q.
INSERTRepresents a SQL INSERT command that has not yet been run
SqlInsert !(TableSettings table) !(BeamSqlBackendInsertSyntax be)SqlInsertNoRowsinsert :: (BeamSqlBackend be, ProjectibleWithPredicate AnyType () Text (table (QField s)))=> DatabaseEntity be db (TableEntity table)Table to insert into
-> SqlInsertValues be (table (QExpr be s))Values to insert. See insertValues, insertExpressions, and insertFrom for possibilities.
-> SqlInsert be tableGenerate a SqlInsert given a table and a source of values.
insertOnly :: (BeamSqlBackend be, ProjectibleWithPredicate AnyType () Text (QExprToField r))=> DatabaseEntity be db (TableEntity table)Table to insert into
-> (table (QField s) -> QExprToField r)-> SqlInsertValues be rValues to insert. See insertValues, insertExpressions, insertData, and insertFrom for possibilities.
-> SqlInsert be tableGenerate a SqlInsert over only certain fields of a table
Represents a source of values that can be inserted into a table shaped like
tbl.
Build a SqlInsertValues from series of expressions in tables
Build a SqlInsertValues from concrete table values
Build a SqlInsertValues from a SqlSelect that returns the same table
Build a SqlInsertValues from arbitrarily shaped data containing expressions
UPDATERepresents a SQL UPDATE statement for the given table.
SqlUpdate !(TableSettings table) !(BeamSqlBackendUpdateSyntax be)SqlIdentityUpdateupdate :: (BeamSqlBackend be, Beamable table)=> DatabaseEntity be db (TableEntity table)The table to insert into
-> (forall s. table (QField s) -> QAssignment be s)A sequence of assignments to make.
-> (forall s. table (QExpr be s) -> QExpr be s Bool)Build a WHERE clause given a table containing expressions
-> SqlUpdate be tableBuild a SqlUpdate given a table, a list of assignments, and a way to
build a WHERE clause.
Use update' for comparisons with SqlBool.
See the (<-.) operator for ways to build assignments. The argument to the
second argument is a the table parameterized over QField, which
represents the left hand side of assignments. Sometimes, you'd like to also
get the current value of a particular column. You can use the current_
function to convert a QField to a QExpr.
save :: (Table table, BeamSqlBackend be, SqlValableTable be (PrimaryKey table), SqlValableTable be table, HasTableEquality be (PrimaryKey table))=> DatabaseEntity be db (TableEntity table)Table to update
-> table IdentityValue to set to
-> SqlUpdate be tableGenerate a SqlUpdate that will update the given table row 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.
Note: This is a pure SQL UPDATE command. This does not upsert or merge values.
update' :: (BeamSqlBackend be, Beamable table)=> DatabaseEntity be db (TableEntity table)The table to insert into
-> (forall s. table (QField s) -> QAssignment be s)A sequence of assignments to make.
-> (forall s. table (QExpr be s) -> QExpr be s SqlBool)Build a WHERE clause given a table containing expressions
-> SqlUpdate be tableBuild a SqlUpdate given a table, a list of assignments, and a way to
build a WHERE clause.
Uses a SqlBool comparison. Use update for comparisons with Bool.
See the (<-.) operator for ways to build assignments. The argument to the
second argument is a the table parameterized over QField, which
represents the left hand side of assignments. Sometimes, you'd like to also
get the current value of a particular column. You can use the current_
function to convert a QField to a QExpr.
save' :: (Table table, BeamSqlBackend be, SqlValableTable be (PrimaryKey table), SqlValableTable be table, HasTableEquality be (PrimaryKey table))=> DatabaseEntity be db (TableEntity table)Table to update
-> table IdentityValue to set to
-> SqlUpdate be tableGenerate a SqlUpdate that will update the given table row with the given value. This is a variant using update' and a SqlBool comparison.
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.
Note: This is a pure SQL UPDATE command. This does not upsert or merge values.
updateTable :: (BeamSqlBackend be, Beamable table)=> DatabaseEntity be db (TableEntity table)The table to update
-> table (QFieldAssignment be table)Updates to be made (use set to construct an empty field)
-> (forall s. table (QExpr be s) -> QExpr be s Bool)-> SqlUpdate be tableA specialization of update that is more convenient for normal tables.
Use updateTable' for comparisons with SqlBool.
updateTable' :: (BeamSqlBackend be, Beamable table)=> DatabaseEntity be db (TableEntity table)The table to update
-> table (QFieldAssignment be table)Updates to be made (use set to construct an empty field)
-> (forall s. table (QExpr be s) -> QExpr be s SqlBool)-> SqlUpdate be tableA specialization of update' that is more convenient for normal tables.
Use updateTable for comparisons with Bool.
Use with set to set a field to an explicit new value that does not depend on any other value
Use with set to not modify the field
Use with set to set a field to a new value that is calculated based on one or more fields from the existing row
Use with set to optionally set a fiield to a new value, calculated based on one or more fields from the existing row
updateRow :: (BeamSqlBackend be, Table table, HasTableEquality be (PrimaryKey table), SqlValableTable be (PrimaryKey table))=> DatabaseEntity be db (TableEntity table)The table to insert into
-> table IdentityThe row to update
-> (forall s. table (QField s) -> QAssignment be s)A sequence of assignments to make.
-> SqlUpdate be tableA specialization of update that matches the given (already existing) row.
Use updateRow' for an internal SqlBool comparison.
updateTableRow :: (BeamSqlBackend be, Table table, HasTableEquality be (PrimaryKey table), SqlValableTable be (PrimaryKey table))=> DatabaseEntity be db (TableEntity table)The table to update
-> table IdentityThe row to update
-> table (QFieldAssignment be table)Updates to be made (use set to construct an empty field)
-> SqlUpdate be tableConvenience form of updateTable that generates a WHERE clause
that matches only the already existing entity.
Use updateTableRow' for an internal SqlBool comparison.
updateRow' :: (BeamSqlBackend be, Table table, HasTableEquality be (PrimaryKey table), SqlValableTable be (PrimaryKey table))=> DatabaseEntity be db (TableEntity table)The table to insert into
-> table IdentityThe row to update
-> (forall s. table (QField s) -> QAssignment be s)A sequence of assignments to make.
-> SqlUpdate be tableupdateTableRow' :: (BeamSqlBackend be, Table table, HasTableEquality be (PrimaryKey table), SqlValableTable be (PrimaryKey table))=> DatabaseEntity be db (TableEntity table)The table to update
-> table IdentityThe row to update
-> table (QFieldAssignment be table)Updates to be made (use set to construct an empty field)
-> SqlUpdate be tableConvenience form of updateTable' that generates a WHERE clause
that matches only the already existing entity.
Uses update' with a SqlBool comparison. Use updateTableRow for an internal Bool comparison.
DELETERepresents a SQL DELETE statement for the given table
SqlDelete !(TableSettings table) !(BeamSqlBackendDeleteSyntax be)delete :: BeamSqlBackend be=> DatabaseEntity be db (TableEntity table)Table to delete from
-> (forall s. (forall s'. table (QExpr be s')) -> QExpr be s Bool)Build a WHERE clause given a table containing expressions
-> SqlDelete be tableBuild a SqlDelete from a table and a way to build a WHERE clause