Portability | portable |
---|---|
Stability | experimental |
Maintainer | Bryan O'Sullivan <bos@mailrank.com> |
Direct bindings to the C mysqlclient
API.
- mysql_init :: Ptr MYSQL -> IO (Ptr MYSQL)
- mysql_options :: Ptr MYSQL -> Option -> IO CInt
- mysql_ssl_set :: Ptr MYSQL -> CString -> CString -> CString -> CString -> CString -> IO MyBool
- mysql_real_connect :: Ptr MYSQL -> CString -> CString -> CString -> CString -> CInt -> CString -> CULong -> IO (Ptr MYSQL)
- mysql_close :: Ptr MYSQL -> IO ()
- mysql_ping :: Ptr MYSQL -> IO CInt
- mysql_autocommit :: Ptr MYSQL -> MyBool -> IO MyBool
- mysql_change_user :: Ptr MYSQL -> CString -> CString -> CString -> IO MyBool
- mysql_select_db :: Ptr MYSQL -> CString -> IO CInt
- mysql_set_character_set :: Ptr MYSQL -> CString -> IO CInt
- mysql_thread_id :: Ptr MYSQL -> IO CULong
- mysql_get_server_info :: Ptr MYSQL -> IO CString
- mysql_get_host_info :: Ptr MYSQL -> IO CString
- mysql_get_proto_info :: Ptr MYSQL -> IO CUInt
- mysql_character_set_name :: Ptr MYSQL -> IO CString
- mysql_get_ssl_cipher :: Ptr MYSQL -> IO CString
- mysql_stat :: Ptr MYSQL -> IO CString
- mysql_real_query :: Ptr MYSQL -> CString -> CULong -> IO CInt
- mysql_real_escape_string :: Ptr MYSQL -> CString -> CString -> CULong -> IO CULong
- mysql_field_count :: Ptr MYSQL -> IO CUInt
- mysql_affected_rows :: Ptr MYSQL -> IO CULLong
- mysql_store_result :: Ptr MYSQL -> IO (Ptr MYSQL_RES)
- mysql_use_result :: Ptr MYSQL -> IO (Ptr MYSQL_RES)
- mysql_fetch_lengths :: Ptr MYSQL_RES -> IO (Ptr CULong)
- mysql_fetch_lengths_nonblock :: Ptr MYSQL_RES -> IO (Ptr CULong)
- mysql_fetch_row :: Ptr MYSQL_RES -> IO MYSQL_ROW
- mysql_fetch_row_nonblock :: Ptr MYSQL_RES -> IO MYSQL_ROW
- mysql_free_result :: Ptr MYSQL_RES -> IO ()
- mysql_fetch_fields :: Ptr MYSQL_RES -> IO (Ptr Field)
- mysql_fetch_fields_nonblock :: Ptr MYSQL_RES -> IO (Ptr Field)
- mysql_data_seek :: Ptr MYSQL_RES -> CULLong -> IO ()
- mysql_row_seek :: Ptr MYSQL_RES -> MYSQL_ROW_OFFSET -> IO MYSQL_ROW_OFFSET
- mysql_row_tell :: Ptr MYSQL_RES -> IO MYSQL_ROW_OFFSET
- mysql_next_result :: Ptr MYSQL -> IO CInt
- mysql_commit :: Ptr MYSQL -> IO MyBool
- mysql_rollback :: Ptr MYSQL -> IO MyBool
- mysql_get_client_info :: CString
- mysql_get_client_version :: CULong
- mysql_errno :: Ptr MYSQL -> IO CInt
- mysql_error :: Ptr MYSQL -> IO CString
- withRTSSignalsBlocked :: IO a -> IO a
Connection management
Connection information
Querying
Escaping
Results
Working with results
Multiple results
Transactions
General information
Error handling
Support functions
withRTSSignalsBlocked :: IO a -> IO aSource
Execute an IO
action with signals used by GHC's runtime signals
blocked. The mysqlclient
C library does not correctly restart
system calls if they are interrupted by signals, so many MySQL API
calls can unexpectedly fail when called from a Haskell application.
This is most likely to occur if you are linking against GHC's
threaded runtime (using the -threaded
option).
This function blocks SIGALRM
and SIGVTALRM
, runs your action,
then unblocks those signals. If you have a series of HDBC calls
that may block for a period of time, it may be wise to wrap them in
this action. Blocking and unblocking signals is cheap, but not
free.
Here is an example of an exception that could be avoided by temporarily blocking GHC's runtime signals:
SqlError { seState = "", seNativeError = 2003, seErrorMsg = "Can't connect to MySQL server on 'localhost' (4)" }