postgrest-8.0.0: REST API for any Postgres database
Safe HaskellNone
LanguageHaskell2010

PostgREST.Query.QueryBuilder

Description

This module provides functions to consume data types that represent database queries (e.g. ReadRequest, MutateRequest) and SqlFragment to produce SqlQuery type outputs.

Synopsis

Documentation

readRequestToCountQuery :: ReadRequest -> Snippet Source #

SQL query meant for COUNTing the root node of the Tree. It only takes WHERE into account and doesn't include LIMIT/OFFSET because it would reduce the COUNT. SELECT 1 is done instead of SELECT * to prevent doing expensive operations(like functions based on the columns) inside the FROM target.