ihp-1.4.0: Haskell Web Framework
Copyright(c) digitally induced GmbH 2025
Safe HaskellNone
LanguageGHC2021

IHP.QueryBuilder.HasqlCompiler

Description

This module compiles QueryBuilder queries to Hasql's Snippet type for execution with prepared statements.

Synopsis

Documentation

toSnippet :: forall {k} (table :: Symbol) queryBuilderProvider (joinRegister :: k). (KnownSymbol table, HasQueryBuilder queryBuilderProvider joinRegister) => queryBuilderProvider table -> Snippet Source #

Compile a QueryBuilder to a Hasql Snippet

buildSnippet :: SQLQuery -> Snippet Source #

Build a Snippet from a compiled SQLQuery

snippetToSQL :: Snippet -> Text Source #

Extract the SQL ByteString from a Snippet (for testing purposes)

This converts a Snippet to a Statement and extracts the SQL text. Useful for verifying the hasql compilation path in tests.

compileOperator :: FilterOperator -> Text Source #

Compiles a FilterOperator to its SQL representation