data-basic-0.2.0.2: A database library with a focus on ease of use, type safety and useful error messages

Safe HaskellNone
LanguageHaskell2010

Internal.Data.Basic.Replace

Documentation

class PrimaryKeyMatch fields table where Source #

Minimal complete definition

primaryKeyMatch

Methods

primaryKeyMatch :: Entity (FromDb c) table -> Var Filtering table -> ConditionExp Source #

Instances

(Ord (TableFieldType table field), TableField table field, ToField (TableFieldType table field), (~) [Symbol] fields ((:) Symbol f fs), PrimaryKeyMatch fields table, (~) ExpressionKind (KindOfDbExp (TableFieldType table field)) LiteralExp) => PrimaryKeyMatch ((:) Symbol field ((:) Symbol f fs)) table Source # 

Methods

primaryKeyMatch :: Entity (FromDb c) table -> Var Filtering table -> ConditionExp Source #

(Ord (TableFieldType table field), TableField table field, ToField (TableFieldType table field), (~) ExpressionKind (KindOfDbExp (TableFieldType table field)) LiteralExp) => PrimaryKeyMatch ((:) Symbol field ([] Symbol)) table Source # 

Methods

primaryKeyMatch :: Entity (FromDb c) table -> Var Filtering table -> ConditionExp Source #

class SetAllFields fields table where Source #

Minimal complete definition

setAllFields

Methods

setAllFields :: Entity (FromDb c) table -> Var Updating table -> UpdateExp fields table Source #

Instances

SetAllFields ([] Symbol) table Source # 

Methods

setAllFields :: Entity (FromDb c) table -> Var Updating table -> UpdateExp [Symbol] table Source #

(SetAllFields fields table, CheckWithError (Not (Elem Symbol field fields)) ((:<>:) ((:<>:) (Text "Cannot update the field ") (ShowType Symbol field)) (Text " because it's already updated in this expression")), TableField table field, ToField (TableFieldType table field), (~) ExpressionKind (KindOfDbExp (TableFieldType table field)) LiteralExp) => SetAllFields ((:) Symbol field fields) table Source # 

Methods

setAllFields :: Entity (FromDb c) table -> Var Updating table -> UpdateExp ((Symbol ': field) fields) table Source #

save :: forall table pk fields c m. (Table table, Just pk ~ TablePrimaryKey table, fields ~ UniqueFields pk, PrimaryKeyMatch fields table, SetAllFields (TableFields table) table, MonadEffect Basic m) => Entity (FromDb c) table -> m (Entity (FromDb Live) table) Source #