| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Database.PostgreSQL.Stream
Contents
- query :: (FromRow r, ToSQL q) => Connection -> Query -> q -> IO [r]
- query_ :: FromRow r => Connection -> Query -> IO [r]
- execute :: ToSQL q => Connection -> Query -> q -> IO ExecStatus
- execute_ :: Connection -> Query -> IO ExecStatus
- stream :: (FromRow r, ToSQL a, MonadBaseControl IO m, MonadIO m) => Connection -> Query -> a -> Int -> Source m [r]
- stream_ :: (FromRow r, MonadBaseControl IO m, MonadIO m) => Connection -> Query -> Int -> Source m [r]
- commit :: Connection -> IO ()
- rollback :: Connection -> IO ()
- data PoolSettings = PoolSettings {
- _stripes :: Int
- _keepalive :: NominalDiffTime
- _affinity :: Int
- pgPool :: Connection -> IO (Pool Connection)
- withPgConnection :: Connection -> (Connection -> IO b) -> IO b
- data Connection :: *
- data ExecStatus :: *
- data ConnStatus :: *
- data ConnSettings = ConnSettings {}
- connect :: ConnSettings -> IO (Either ConnStatus Connection)
- connect_alt :: ByteString -> IO (Either ConnStatus Connection)
- sql :: QuasiQuoter
- fmtSQL :: ToSQL a => Query -> a -> SQL
- fmtQuery :: ToSQL a => Query -> a -> ByteString
- printSQL :: Query -> IO ()
- module Database.PostgreSQL.Stream.Types
SQL query ( result set )
SQL query ( no result )
execute :: ToSQL q => Connection -> Query -> q -> IO ExecStatus Source
execute_ :: Connection -> Query -> IO ExecStatus Source
SQL query ( cursor )
Arguments
| :: (FromRow r, ToSQL a, MonadBaseControl IO m, MonadIO m) | |
| => Connection | Connection |
| -> Query | Query |
| -> a | Query arguments |
| -> Int | Batch size |
| -> Source m [r] | Source conduit |
Arguments
| :: (FromRow r, MonadBaseControl IO m, MonadIO m) | |
| => Connection | Connection |
| -> Query | Query |
| -> Int | Batch size |
| -> Source m [r] | Source conduit |
Transacations
commit :: Connection -> IO () Source
Commit a transaction.
rollback :: Connection -> IO () Source
Rollback a transaction.
Database pool
data PoolSettings Source
Constructors
| PoolSettings | |
Fields
| |
Instances
pgPool :: Connection -> IO (Pool Connection) Source
withPgConnection :: Connection -> (Connection -> IO b) -> IO b Source
LibPQ Rexports
data ExecStatus :: *
Constructors
| EmptyQuery | The string sent to the server was empty. |
| CommandOk | Successful completion of a command returning no data. |
| TuplesOk | Successful completion of a command returning data (such as a SELECT or SHOW). |
| CopyOut | Copy Out (from server) data transfer started. |
| CopyIn | Copy In (to server) data transfer started. |
| BadResponse | The server's response was not understood. |
| NonfatalError | A nonfatal error (a notice or warning) occurred. |
| FatalError | A fatal error occurred. |
Instances
data ConnStatus :: *
Constructors
| ConnectionOk | The |
| ConnectionBad | The connection procedure has failed. |
| ConnectionStarted | Waiting for connection to be made. |
| ConnectionMade | Connection OK; waiting to send. |
| ConnectionAwaitingResponse | Waiting for a response from the server. |
| ConnectionAuthOk | Received authentication; waiting for backend start-up to finish. |
| ConnectionSetEnv | Negotiating environment-driven parameter settings. |
| ConnectionSSLStartup | Negotiating SSL encryption. |
Instances
Connection initialization
data ConnSettings Source
Constructors
| ConnSettings | |
Fields
| |
Instances
connect :: ConnSettings -> IO (Either ConnStatus Connection) Source
connect_alt :: ByteString -> IO (Either ConnStatus Connection) Source
SQL quasiquoter
sql :: QuasiQuoter Source
SQL formatting
fmtQuery :: ToSQL a => Query -> a -> ByteString Source