opaleye-0.9.6.1: An SQL-generating DSL targeting PostgreSQL
Safe HaskellSafe-Inferred
LanguageHaskell2010

Opaleye.Sql

Synopsis

Showing SQL

showSql :: Default Unpackspec fields fields => Select fields -> Maybe String Source #

Show the SQL query string generated from the Select.

When Nothing is returned it means that the Select returns zero rows.

Example type specialization:

showSql :: Select (Field a, Field b) -> Maybe String

Assuming the makeAdaptorAndInstance splice has been run for the product type Foo:

showSql :: Select (Foo (Field a) (Field b) (Field c)) -> Maybe String

showSqlUnopt :: Default Unpackspec fields fields => Select fields -> Maybe String Source #

Show the unoptimized SQL query string generated from the Select.

Explicit versions