Status queryInternal(const std::string& q, QueryData& results, sqlite3* db) { char* err = nullptr; sqlite3_exec(db, q.c_str(), queryDataCallback, &results, &err); sqlite3_db_release_memory(db); if (err != nullptr) { auto error_string = std::string(err); sqlite3_free(err); return Status(1, "Error running query: " + error_string); } return Status(0, "OK"); }
DLL_FUNCTION(int32_t) BU_SQLite_DB_Release_Memory(sqlite3* db) { #pragma comment(linker, "/EXPORT:BU_SQLite_DB_Release_Memory=_BU_SQLite_DB_Release_Memory@4") return sqlite3_db_release_memory(db); }