vt-utils-1.3.0.0: Vector and Text utilities

Safe HaskellNone
LanguageHaskell2010

VtUtils.Queries

Description

SQL queries files utilities

Synopsis

Documentation

queriesLoad :: Text -> IO Queries Source #

Parses a specified SQL file into a HashMap that contains all SQL queries as map entries

SQL file example:

  --
  -- test queries
  --

  /** selectFoo */
  select foo
  from bar

  /** updateBar */
  update bar
  set foo = 42

Note: there must be an empty line after the initial comment lines on the top of the file

Throws an error on file IO error or parsing error

Arguments:

  • path :: Text: Path to SQL file

Return value: HashMap containing SQL queries from a file