static void close_conn(UMConnection conn) { JSFiber::scope s; UMConnection_Close(conn); UMConnection_Destroy(conn); }
static void Connection_Destructor(Connection *self) { PRINTMARK(); UMConnection_Destroy(self->conn); PRINTMARK(); PyObject_Del(self); PRINTMARK(); if (PyErr_Occurred()) PyErr_Format(PyExc_RuntimeError, "Exception is set for no error in %s", __FUNCTION__); PRINTMARK(); }
result_t mysql::close(exlib::AsyncEvent *ac) { if (m_conn) { UMConnection_Close(m_conn); UMConnection_Destroy(m_conn); m_conn = NULL; } return 0; }
result_t mysql::close(AsyncEvent *ac) { if (!m_conn) return 0; if (!ac) return CHECK_ERROR(CALL_E_NOSYNC); if (m_conn) { UMConnection_Close(m_conn); UMConnection_Destroy(m_conn); m_conn = NULL; } return 0; }
result_t mysql::connect(const char *host, int port, const char *username, const char *password, const char *dbName) { if (m_conn) return CALL_E_INVALID_CALL; m_conn = UMConnection_Create(&capi); if (!UMConnection_Connect(m_conn, host, port, username, password, dbName, NULL, MCS_utf8mb4_bin)) { result_t hr = error(); UMConnection_Destroy(m_conn); m_conn = NULL; return hr; } return 0; }
static void Connection_Destructor(Connection *self) { UMConnection_Destroy(self->conn); PyObject_Del(self); }
static void close_conn(UMConnection conn) { UMConnection_Close(conn); UMConnection_Destroy(conn); }