odbc-0.2.1: Haskell binding to the ODBC API, aimed at SQL Server driver

Safe HaskellNone
LanguageHaskell2010

Database.ODBC.TH

Synopsis

Documentation

sql :: QuasiQuoter Source #

Allows SQL parameters interpolation from a SQL query. Only quoteExp is implemented because this quote can only be used at the expression level.

select_some_stuff :: Text -> Int -> Query
select_some_stuff name age = [sql|select * from user where age = $age AND name = $name|]

In this case, sql quote will generate the code below:

"select * from user where age = " <> toSql age <> " AND name = " <> toSql name

sqlFile :: FilePath -> Q Exp Source #

Loads the content of a SQL query file and allows SQL parameters interpolation from it.

select_some_stuff :: Text -> Int -> Query
select_some_stuff name age = $(sqlFile "path/to/my/sql/file.sql")

See sql for more details.

data Part Source #

Constructors

SqlPart !String 
ParamName !String 
Instances
Eq Part Source # 
Instance details

Defined in Database.ODBC.TH

Methods

(==) :: Part -> Part -> Bool #

(/=) :: Part -> Part -> Bool #

Show Part Source # 
Instance details

Defined in Database.ODBC.TH

Methods

showsPrec :: Int -> Part -> ShowS #

show :: Part -> String #

showList :: [Part] -> ShowS #