static int my_bind_text(sqlite3_stmt *stmt, int n, const char *p, int np) {
static inline int my_bind_text(sqlite3_stmt *stmt, int n, const char *p, int np) {
return sqlite3_bind_text(stmt, n, p, np, SQLITE_TRANSIENT);
return sqlite3_bind_text(stmt, n, p, np, SQLITE_TRANSIENT);
}
}
static int my_bind_blob(sqlite3_stmt *stmt, int n, void *p, int np) {
static inline int my_bind_blob(sqlite3_stmt *stmt, int n, void *p, int np) {
return sqlite3_bind_blob(stmt, n, p, np, SQLITE_TRANSIENT);
return sqlite3_bind_blob(stmt, n, p, np, SQLITE_TRANSIENT);
}
}
// just to get ride of "warning: passing argument 5 of ‘sqlite3_prepare_v2’ from incompatible pointer type [...] ‘const char **’ but argument is of type ‘char **’"
static int my_prepare_v2(sqlite3 *db, const char *zSql, int nByte, sqlite3_stmt **ppStmt, char **pzTail) {
// If the caller knows that the supplied string is nul-terminated, then there is a small performance advantage to be gained by passing an nByte parameter that is equal to the number of bytes in the input string including the nul-terminator bytes as this saves SQLite from having to make a copy of the input string.
// If the caller knows that the supplied string is nul-terminated, then there is a small performance advantage to be gained by passing an nByte parameter that is equal to the number of bytes in the input string including the nul-terminator bytes as this saves SQLite from having to make a copy of the input string.