oatpp-sqlite
oatpp-sqlite copied to clipboard
How to properly enable foreign_keys support
Anyone cares to shed a light on how to enable foreign_keys with this library? I've tried doing the following:
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::provider::Provider<oatpp::sqlite::Connection>>, dbConnectionProvider)([] {
auto connectionProvider = std::make_shared<oatpp::sqlite::ConnectionProvider>("database.sqlite");
auto result = sqlite3_exec(connectionProvider->get().object.get()->getHandle(), "PRAGMA foreign_keys=ON;", nullptr, nullptr, nullptr);
assert(result == SQLITE_OK && "ERROR ENABLING foreign_keys");
return oatpp::sqlite::ConnectionPool::createShared(connectionProvider, 10, std::chrono::seconds(5));
}());
without success. if anyone could help me with this I'd be glad.