| 85 | } |
| 86 | |
| 87 | lbug_state lbug_connection_init(lbug_database* database, lbug_connection* out_connection) { |
| 88 | if (database == nullptr || database->_database == nullptr) { |
| 89 | out_connection->_connection = nullptr; |
| 90 | return LbugError; |
| 91 | } |
| 92 | try { |
| 93 | out_connection->_connection = new Connection(static_cast<Database*>(database->_database)); |
| 94 | } catch (Exception& e) { |
| 95 | out_connection->_connection = nullptr; |
| 96 | return LbugError; |
| 97 | } |
| 98 | return LbugSuccess; |
| 99 | } |
| 100 | |
| 101 | void lbug_connection_destroy(lbug_connection* connection) { |
| 102 | if (connection == nullptr) { |