persistent-migration-0.0.1: Manual migrations for the persistent library

MaintainerBrandon Chinn <brandonchinn178@gmail.com>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Database.Persist.Migration.Utils.Sql

Description

Defines helper functions for writing SQL queries.

Synopsis

Documentation

commas :: Text -> [Text] Source #

Split the given line by commas, ignoring commas within parentheses.

commas "a,b,c" == ["a", "b", "c"]
commas "a,b,c (d,e),z" == ["a", "b", "c (d,e)", "z"]
commas "a,b,c (d,e,(f,g)),z" == ["a", "b", "c (d,e,(f,g))", "z"]

uncommas :: [Text] -> Text Source #

Join the given Text with commas separating each item.

quote :: Text -> Text Source #

Quote the given Text.

interpolate :: Text -> [PersistValue] -> Text Source #

Interpolate the given values into the SQL string.