| Copyright | (c) digitally induced GmbH 2025 |
|---|---|
| Safe Haskell | None |
| Language | GHC2021 |
IHP.Fetch.Statement
Description
Internal module containing hasql Statement definitions shared by
Fetch and FetchPipelined.
Synopsis
- buildQueryListStatement :: forall model (table :: Symbol). (Table model, model ~ GetModelByTableName table, KnownSymbol table, FromRowHasql model) => QueryBuilder table -> Statement () [model]
- buildQueryVectorStatement :: forall model (table :: Symbol). (Table model, model ~ GetModelByTableName table, KnownSymbol table, FromRowHasql model) => QueryBuilder table -> Statement () (Vector model)
- buildQueryMaybeStatement :: forall model (table :: Symbol). (Table model, model ~ GetModelByTableName table, KnownSymbol table, FromRowHasql model) => QueryBuilder table -> Statement () (Maybe model)
- buildCountStatement :: forall (table :: Symbol). KnownSymbol table => QueryBuilder table -> Statement () Int64
- buildExistsStatement :: forall (table :: Symbol). KnownSymbol table => QueryBuilder table -> Statement () Bool
Documentation
buildQueryListStatement :: forall model (table :: Symbol). (Table model, model ~ GetModelByTableName table, KnownSymbol table, FromRowHasql model) => QueryBuilder table -> Statement () [model] Source #
Build a statement that fetches all rows matching a query builder.
buildQueryVectorStatement :: forall model (table :: Symbol). (Table model, model ~ GetModelByTableName table, KnownSymbol table, FromRowHasql model) => QueryBuilder table -> Statement () (Vector model) Source #
Like buildQueryListStatement, but returns a Vector instead of a list.
buildQueryMaybeStatement :: forall model (table :: Symbol). (Table model, model ~ GetModelByTableName table, KnownSymbol table, FromRowHasql model) => QueryBuilder table -> Statement () (Maybe model) Source #
Build a statement that fetches at most one row (adds LIMIT 1).
buildCountStatement :: forall (table :: Symbol). KnownSymbol table => QueryBuilder table -> Statement () Int64 Source #
Build a SELECT COUNT(*) statement wrapping a query builder.
buildExistsStatement :: forall (table :: Symbol). KnownSymbol table => QueryBuilder table -> Statement () Bool Source #
Build a SELECT EXISTS statement wrapping a query builder.