Module
Selda
- Package
- purescript-selda
- Repository
- Kamirus/purescript-selda
Re-exports from Selda.Col
Re-exports from Selda.PG
#showUpdate Source
showUpdate :: forall r' s r. TableToColsWithoutAlias r r' => GetCols r' => Table r -> (Record r' -> Col s Boolean) -> (Record r' -> Record r') -> String
#showInsert1 Source
showInsert1 :: forall rlcols t. CanInsertColumnsIntoTable rlcols t => TableColumnNames rlcols => RowListLength rlcols => Table t -> RLProxy rlcols -> String
#showDeleteFrom Source
showDeleteFrom :: forall r' s r. TableToColsWithoutAlias r r' => Table r -> (Record r' -> Col s Boolean) -> String
Re-exports from Selda.PG.Class
#MonadSelda Source
class (MonadAff m, MonadError PGError m, MonadReader Connection m) <= MonadSelda m
Instances
(MonadAff m, MonadError PGError m, MonadReader Connection m) => MonadSelda m
#query Source
query :: forall m s tup i o. ColsToPGHandler s i tup o => GetCols i => FromSQLRow tup => MonadSelda m => FullQuery s (Record i) -> m (Array (Record o))
#insert_ Source
insert_ :: forall m tup rlcols t r. RowToList r rlcols => CanInsertColumnsIntoTable rlcols t => TableColumnNames rlcols => RowListLength rlcols => FromSQLRow tup => ToSQLRow tup => MkTupleToRecord tup r => HFoldl RecordToTuple Unit (Record r) tup => MonadSelda m => Table t -> Array (Record r) -> m Unit
Executes an insert query for each input record.
#insert Source
insert :: forall m tup rlcols t r. RowToList r rlcols => CanInsertColumnsIntoTable rlcols t => TableColumnNames rlcols => RowListLength rlcols => FromSQLRow tup => ToSQLRow tup => MkTupleToRecord tup r => HFoldl RecordToTuple Unit (Record r) tup => MonadSelda m => Table t -> Array (Record r) -> m (Array (Record r))
Executes an insert query for each input record. Records to be inserted needs to have columns without constraints, Default ale optional, Auto must be missing
#deleteFrom Source
deleteFrom :: forall m r' s r. TableToColsWithoutAlias r r' => MonadSelda m => Table r -> (Record r' -> Col s Boolean) -> m Unit
Re-exports from Selda.Query
#selectFrom_ Source
selectFrom_ :: forall reso resi s inner. FromSubQuery s inner resi => FullQuery (Inner s) (Record inner) -> (Record resi -> Query s (Record reso)) -> FullQuery s (Record reso)
#leftJoin_ Source
leftJoin_ :: forall inner mres res s. FromSubQuery s inner res => HMap WrapWithMaybe (Record res) (Record mres) => (Record res -> Col s Boolean) -> FullQuery (Inner s) (Record inner) -> Query s (Record mres)
leftJoin_ on q
run sub query q
;
with this execute on
to get JOIN constraint;
add sub query to sources;
return previously mapped record with each value in Col wrapped in Maybe
(because LEFT JOIN can return null for each column)
#crossJoin_ Source
crossJoin_ :: forall res s inner. FromSubQuery s inner res => FullQuery (Inner s) (Record inner) -> Query s (Record res)
Re-exports from Selda.Query.Type
#Query Source
newtype Query s a
Represents an intermediate query state. Before being wrapped with FullQuery this state represents SQL query without FROM component, but having every other including JOIN[s]