+#define __BIND_TEXT(db, stmt, i, text) \
+do { \
+ if (sqlite3_bind_text(stmt, i, text, -1, SQLITE_STATIC) != SQLITE_OK) {\
+ LOGE("bind error(index %d): %s", i, sqlite3_errmsg(db)); \
+ sqlite3_finalize(stmt); \
+ return -1; \
+ } \
+} while (0)
+
+#define __BIND_INT(db, stmt, i, int) \
+do { \
+ if (sqlite3_bind_int(stmt, i, int) != SQLITE_OK) { \
+ LOGE("bind error(index %d): %s", i, sqlite3_errmsg(db)); \
+ sqlite3_finalize(stmt); \
+ return -1; \
+ } \
+} while (0)
+
+#define __BIND_DOUBLE(db, stmt, i, double) \
+do { \
+ if (sqlite3_bind_double(stmt, i, double) != SQLITE_OK) { \
+ LOGE("bind error(index %d): %s", i, sqlite3_errmsg(db)); \
+ sqlite3_finalize(stmt); \
+ return -1; \
+ } \
+} while (0)
+