Lines Matching refs:stmt
226 static bool getInsertSqlStmt(sqlite3* db, sqlite3_stmt** stmt, const int64_t metricId, in getInsertSqlStmt() argument
246 if (sqlite3_prepare_v2(db, result.c_str(), -1, stmt, nullptr) != SQLITE_OK) { in getInsertSqlStmt()
261 sqlite3_bind_int(*stmt, index, fieldValue.mValue.int_value); in getInsertSqlStmt()
264 sqlite3_bind_int64(*stmt, index, fieldValue.mValue.long_value); in getInsertSqlStmt()
267 sqlite3_bind_text(*stmt, index, fieldValue.mValue.str_value.c_str(), -1, in getInsertSqlStmt()
271 sqlite3_bind_double(*stmt, index, fieldValue.mValue.float_value); in getInsertSqlStmt()
298 sqlite3_stmt* stmt = nullptr; in insert() local
299 if (!getInsertSqlStmt(db, &stmt, metricId, events, error)) { in insert()
301 sqlite3_finalize(stmt); in insert()
304 if (sqlite3_step(stmt) != SQLITE_DONE) { in insert()
307 sqlite3_finalize(stmt); in insert()
310 sqlite3_finalize(stmt); in insert()
323 sqlite3_stmt* stmt; in query() local
324 if (sqlite3_prepare_v2(db, zSql.c_str(), -1, &stmt, nullptr) != SQLITE_OK) { in query()
326 sqlite3_finalize(stmt); in query()
330 int result = sqlite3_step(stmt); in query()
333 int colCount = sqlite3_column_count(stmt); in query()
337 int32_t columnType = sqlite3_column_type(stmt, i); in query()
343 columnNames.push_back(reinterpret_cast<const char*>(sqlite3_column_name(stmt, i))); in query()
345 const unsigned char* textResult = sqlite3_column_text(stmt, i); in query()
352 result = sqlite3_step(stmt); in query()
354 sqlite3_finalize(stmt); in query()
399 static bool getDeviceInfoInsertStmt(sqlite3* db, sqlite3_stmt** stmt, string error) { in getDeviceInfoInsertStmt() argument
401 if (sqlite3_prepare_v2(db, insertSql.c_str(), -1, stmt, nullptr) != SQLITE_OK) { in getDeviceInfoInsertStmt()
410 sqlite3_bind_int(*stmt, index, sdkVersion); in getDeviceInfoInsertStmt()
414 sqlite3_bind_text(*stmt, index, model.c_str(), -1, SQLITE_TRANSIENT); in getDeviceInfoInsertStmt()
418 sqlite3_bind_text(*stmt, index, product.c_str(), -1, SQLITE_TRANSIENT); in getDeviceInfoInsertStmt()
422 sqlite3_bind_text(*stmt, index, hardware.c_str(), -1, SQLITE_TRANSIENT); in getDeviceInfoInsertStmt()
426 sqlite3_bind_text(*stmt, index, device.c_str(), -1, SQLITE_TRANSIENT); in getDeviceInfoInsertStmt()
430 sqlite3_bind_text(*stmt, index, osBuild.c_str(), -1, SQLITE_TRANSIENT); in getDeviceInfoInsertStmt()
434 sqlite3_bind_text(*stmt, index, fingerprint.c_str(), -1, SQLITE_TRANSIENT); in getDeviceInfoInsertStmt()
438 sqlite3_bind_text(*stmt, index, brand.c_str(), -1, SQLITE_TRANSIENT); in getDeviceInfoInsertStmt()
442 sqlite3_bind_text(*stmt, index, manufacturer.c_str(), -1, SQLITE_TRANSIENT); in getDeviceInfoInsertStmt()
446 sqlite3_bind_text(*stmt, index, board.c_str(), -1, SQLITE_TRANSIENT); in getDeviceInfoInsertStmt()
480 sqlite3_stmt* stmt = nullptr; in updateDeviceInfoTable() local
481 if (!getDeviceInfoInsertStmt(db, &stmt, error)) { in updateDeviceInfoTable()
483 sqlite3_finalize(stmt); in updateDeviceInfoTable()
488 if (sqlite3_step(stmt) != SQLITE_DONE) { in updateDeviceInfoTable()
491 sqlite3_finalize(stmt); in updateDeviceInfoTable()
495 sqlite3_finalize(stmt); in updateDeviceInfoTable()