hasql-th-0.2.1: Template Haskell utilities for Hasql

Safe HaskellNone
LanguageHaskell2010

Hasql.TH

Synopsis

Documentation

readFileAsSQL :: String -> Q Exp Source

Read an SQL-file, containing multiple statements, and produce an expression of type ByteString.

Allows to store plain SQL in external files and read it at compile time.

E.g.,

migration1 :: Hasql.Session.Session ()
migration1 =
  Hasql.Session.sql $(Hasql.TH.readFileAsSQL "sql/migration-1.sql")