sql-simple-0.3.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

class Elem a as Source

Instances

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

class Typeable b => Backend b Source

Associated Types

data ConnectInfo b Source

type ToRow b :: * -> ConstraintSource

type FromRow b :: * -> ConstraintSource

connection

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

close :: Backend b => b -> IO ()Source

execute query

execute :: (ToRow b q, Backend b) => b -> Query -> q -> Sql bs ()Source

execute_ :: Backend b => b -> Query -> Sql bs ()Source

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

query_ :: (FromRow b r, Backend b) => b -> Query -> Sql bs [r]Source

fold :: (Backend b, FromRow b r, ToRow b q) => b -> Query -> q -> a -> (a -> r -> IO a) -> IO aSource

fold_ :: (Backend b, FromRow b r) => b -> Query -> a -> (a -> r -> IO a) -> IO aSource

forEach :: (Backend b, FromRow b r, ToRow b q) => b -> Query -> q -> (r -> IO ()) -> IO ()Source

forEach_ :: (Backend b, FromRow b r) => b -> Query -> (r -> IO ()) -> IO ()Source

transaction

begin :: Transaction b => b -> Sql bs ()Source

commit :: Transaction b => b -> Sql bs ()Source

rollback :: Transaction b => b -> Sql bs ()Source

withTransaction :: Transaction b => b -> Sql bs a -> Sql bs aSource

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