Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides implementations of user's APIs
Synopsis
- query :: Env () w -> String -> IO (Either String (Vector (Vector ClickhouseType)))
- queryWithInfo :: String -> Env () w -> IO (Either String CKResult)
- deploySettings :: TCPConnection -> IO (Env () w)
- insertMany :: Env () w -> String -> [[ClickhouseType]] -> IO ByteString
- insertOneRow :: Env () w -> String -> [ClickhouseType] -> IO ByteString
- ping :: Env () w -> IO ()
- withQuery :: Env () w -> String -> (Either String (Vector (Vector ClickhouseType)) -> IO a) -> IO a
- fetch :: String -> GenHaxl u w (Either String (Vector (Vector ClickhouseType)))
- fetchWithInfo :: String -> GenHaxl u w (Either String CKResult)
- execute :: Env u w -> GenHaxl u w a -> IO a
- createClient :: ConnParams -> IO (Env () w)
- defaultClient :: IO (Env () w)
- closeClient :: Env () w -> IO ()
- defaultClientPool :: Int -> NominalDiffTime -> Int -> IO (Env () w)
- createClientPool :: ConnParams -> Int -> NominalDiffTime -> Int -> IO (Env () w)
- client :: Resource a => Either String a -> IO (Env () w)
Data Fetch and Insert
:: Env () w | Haxl environment for connection |
-> String | |
-> IO (Either String (Vector (Vector ClickhouseType))) |
query command
queryWithInfo :: String -> Env () w -> IO (Either String CKResult) Source #
query result contains query information.
deploySettings :: TCPConnection -> IO (Env () w) Source #
insertMany :: Env () w -> String -> [[ClickhouseType]] -> IO ByteString Source #
:: Env () w | |
-> String | SQL command |
-> [ClickhouseType] | a row of local clickhouse data type to be serialized and inserted. |
-> IO ByteString | The resulting bytestring indicates success or failure. |
:: String | SQL SELECT command |
-> GenHaxl u w (Either String (Vector (Vector ClickhouseType))) | result wrapped in Haxl monad for other tasks run with concurrency. |
Fetch data
fetchWithInfo :: String -> GenHaxl u w (Either String CKResult) Source #
fetch data alone with query information
execute :: Env u w -> GenHaxl u w a -> IO a Source #
For general use e.g. creating table, multiple queries, multiple insertions.
Communication
createClient :: ConnParams -> IO (Env () w) Source #
create client with given information such as username, host name and password etc.
defaultClient :: IO (Env () w) Source #
closeClient :: Env () w -> IO () Source #
close connection
Connection pool
:: Int | number of stripes |
-> NominalDiffTime | idle time for each stripe |
-> Int | maximum resources for reach stripe |
-> IO (Env () w) | Haxl env wrapped in IO monad. |
:: ConnParams | parameters for connection settings |
-> Int | number of stripes |
-> NominalDiffTime | idle time for each stripe |
-> Int | maximum resources for reach stripe |
-> IO (Env () w) |