-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Interpolated SQLite queries via quasiquotation -- -- Please see the readme at -- https://github.com/ruby0b/sqlite-simple-interpolate#readme. @package sqlite-simple-interpolate @version 0.2.0.0 -- | Interpolated SQLite queries module Database.SQLite.Simple.Interpolate -- | Quote an SQL statement with embedded antiquoted expressions. -- -- The result of the quasiquoter is a tuple, containing the statement -- string and a list of parameters. For example: -- --
--   >>> import Data.Char (toLower)
--   
--   >>> [isql|SELECT field FROM !{map toLower "PEOPLE"} WHERE name = {map toLower "ELLIOT"} AND access IN @{["admin", "employee"]} LIMIT {10 :: Int}|]
--   ("SELECT field FROM people WHERE name = ? AND access IN (?,?) LIMIT ?",[SQLText "elliot",SQLText "admin",SQLText "employee",SQLInteger 10])
--   
-- -- The generated code is: -- --
--   ("SELECT field FROM people WHERE name = ? AND access IN (?,?) LIMIT ?", [toField (map toLower ELLIOT)] ++ toRow ["admin", "employee"] ++ [toField (10 :: Int)])
--   
-- -- How the parser works: -- -- -- -- Characters preceded by a backslash are treated literally. This enables -- the inclusion of the literal character { within your quoted -- text by writing it as \{. The literal sequence \{ -- may be written as \\{. isql :: QuasiQuoter -- | Invokes query with arguments provided by isql. The -- result is of type (Connection -> IO [r]). iquery :: QuasiQuoter -- | Invokes execute with arguments provided by isql. The -- result is of type (Connection -> IO ()). iexecute :: QuasiQuoter -- | Invokes fold with arguments provided by isql. The result -- is of type (a -> (a -> row -> IO a) -> -- Connection -> IO a). ifold :: QuasiQuoter -- | The Template Haskell function used by isql. quoteInterpolatedSql :: String -> Q Exp