sql-simple-0.1.0.0: common middle-level sql client.

Safe HaskellNone

Database.Sql.Simple

Contents

Synopsis

data type

query

specify :: Backend b => proxy ((b :: *) : `[]`) -> Text -> Query -> QuerySource

add specified query string to Query.

example:

 q = specify sqlite sqlite query common query

parameter

newtype Only a Source

Constructors

Only 

Fields

fromOnly :: a
 

data h :. t Source

Constructors

h :. t 

other

data Sql l a Source

Instances

class Elem a as Source

Instances

Elem * a (: * a as) 
Elem k a as => Elem k a (: * a' as) 

class Typeable b => Backend b whereSource

Associated Types

data ConnectInfo b Source

type ToRow b :: * -> ConstraintSource

type FromRow b :: * -> ConstraintSource

Methods

connect :: ConnectInfo b -> IO bSource

close :: b -> IO ()Source

execute :: ToRow b q => b -> Query -> q -> Sql c ()Source

execute_ :: b -> Query -> Sql c ()Source

query :: (FromRow b r, ToRow b q) => b -> Query -> q -> Sql c [r]Source

query_ :: FromRow b r => b -> Query -> Sql c [r]Source

begin :: b -> Sql c ()Source

commit :: b -> Sql c ()Source

rollback :: b -> Sql c ()Source

withTransaction :: b -> Sql c a -> Sql c aSource

connection

withConnection :: (Backend b, Elem b bs) => ConnectInfo b -> (b -> Sql bs a) -> IO aSource

execute query

transaction

specify backend

 
  sql (sqlite +:+ postgresql) $ query

sql :: proxy bs -> Sql bs a -> Sql bs aSource

specify sql backends.

(+:+) :: Proxy a -> Proxy b -> Proxy (a ++ b)Source

join sql backends.

type family a (++) b :: [k]Source