HORIZON HASKELLDocslts/ghc-10.0.x8c2f8e82026-10-19Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8c2f8e8 · 2026-10-19

Modulebeam-core-0.11.1.0Haskell2010

Database.Beam.Query.Adhoc

This module contains support for defining "ad-hoc" queries. That is queries on tables that do not necessarily have corresponding Beamable table types.

  • 1 type
  • 1 class
  • 2 values
classclass Adhoc structure where
#

Associated types

Methods

Instances8Adhoc, …
newtypenewtype NamedField a
#
Instances2Adhoc, AdhocTable
valuetable_
  1. :: (Adhoc structure, BeamSqlBackend be, Projectible be (AdhocTable structure (QExpr be s)))
  2. => Maybe Text
  3. -> Text
  4. -> structure
  5. -> Q be db s (AdhocTable structure (QExpr be s))
#

Introduce a table into a query without using the Beamable and Database machinery.

The first argument is the optional name of the schema the table is in and the second is the name of the table to source from.

The third argument is a tuple (or any nesting of tuples) where each value is of type NamedField (use field_ to construct).

The return value is a tuple (or any nesting of tuples) of the same shape as structure but where each value is a QExpr.

For example, to source from the table Table1, with fields Field1 (A boolean), Field2 (a timestamp), and Field3 (a string)

table_ Nothing "Table1" ( field_ @Bool "Field1", field_ @UTCTime "Field2", field_ @Text "Field3" )
valuefield_ :: Text -> NamedField a
#

Used to construct NamedFields, most often with an explicitly applied type.

The type can be omitted if the value is used unambiguously elsewhere.