Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
mariadb/conncpp.hpp
✓ #include <mariadb/conncpp.hpp>
Connect to a MariaDB database
#include "mariadb/conncpp.hpp"
#include <iostream>
int main() {
try {
sql::Driver* driver = sql::mariadb::get_driver_instance();
sql::SQLString url("jdbc:mariadb://localhost:3306/test");
sql::Properties properties({{"user", "root"}, {"password", "password"}});
std::unique_ptr<sql::Connection> conn(driver->connect(url, properties));
std::cout << "Connected to MariaDB" << std::endl;
} catch (sql::SQLException& e) {
std::cerr << "Error: " << e.what() << std::endl;
}
return 0;
}
Debug
Known issues
No known issues recorded.
Audit
Dependencies
No dependency data recorded yet.
Resources
No resource links recorded.