hasql-th-0.1: Template Haskell utilities for Hasql

Safe HaskellNone
LanguageHaskell2010

Hasql.TH

Synopsis

Documentation

readFileAsTransaction :: String -> Q Exp Source

Read an SQL-file, containing multiple statements, and produce a transaction expression.

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

E.g.,

migration1 :: Transaction ()
migration1 =
  $(Hasql.TH.readFileAsTransaction "sql/migration-1.sql")