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

Safe HaskellNone

Database.Sql.Simple.Internal

Synopsis

Documentation

data Query Source

Constructors

Query Text (Map TypeRep Text) 

newtype Sql l a Source

Constructors

Sql 

Fields

unSql :: IO a
 

newtype Only a Source

Constructors

Only 

Fields

fromOnly :: a
 

data h :. t Source

Constructors

h :. t 

class Elem a as Source

Instances

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

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

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

specify sql backends.

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

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

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

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

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

class Backend b => Transaction b whereSource

Methods

begin :: b -> Sql c ()Source

commit :: b -> Sql c ()Source

rollback :: b -> Sql c ()Source

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

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

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

join sql backends.

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

add specified query string to Query.

example:

 q = specify sqlite "sqlite query" "common query"