persistent-1.1.3.2: Type-safe, multi-backend data serialization.

Safe HaskellNone

Database.Persist.GenericSql.Internal

Description

Code that is only needed for writing GenericSql backends.

Synopsis

Documentation

data Connection Source

Constructors

Connection 

Fields

prepare :: Text -> IO Statement

table name, column names, id name, either 1 or 2 statements to run

insertSql :: DBName -> [DBName] -> DBName -> InsertSqlResult
 
stmtMap :: IORef (Map Text Statement)
 
close :: IO ()
 
migrateSql :: forall v. PersistEntity v => [EntityDef] -> (Text -> IO Statement) -> v -> IO (Either [Text] [(Bool, Text)])
 
begin :: (Text -> IO Statement) -> IO ()
 
commitC :: (Text -> IO Statement) -> IO ()
 
rollbackC :: (Text -> IO Statement) -> IO ()
 
escapeName :: DBName -> Text
 
noLimit :: Text
 

data Statement Source

Constructors

Statement 

Fields

finalize :: IO ()
 
reset :: IO ()
 
execute :: [PersistValue] -> IO ()
 
withStmt :: forall m. MonadResource m => [PersistValue] -> Source m [PersistValue]
 

withSqlPoolSource

Arguments

:: MonadIO m 
=> IO Connection

create a new connection

-> Int

connection count

-> (Pool Connection -> m a) 
-> m a 

mkColumns :: PersistEntity val => [EntityDef] -> val -> ([Column], [UniqueDef])Source

Create the list of columns for the given entity.