internal static extern int sqlite3_prepare_v2( sqlite3 *db, /* Database handle */ string zSql, /* SQL statement, UTF-8 encoded */ int nByte, /* Maximum length of zSql in bytes. */ out sqlite3_stmt *ppStmt, /* OUT: Statement handle */ out char *pzTail /* OUT: Pointer to unused portion of zSql */ );
private static bool PrepareInsertStatement(sqlite3* db, out sqlite3_stmt* stmt, string sql) { char* tail; int error = NativeMethods.sqlite3_prepare_v2(db, sql, sql.Length, out stmt, out tail); if (error != 0) { LogErrorWithTimeStamp("sqlite3_prepare_v2 -> " + sql + " failed to execute with SQLite error code: " + error); return false; } return true; }
internal static extern int sqlite3_bind_text(sqlite3_stmt *pStmt, int index, string value, int n, IntPtr @static);
internal static extern int sqlite3_bind_int64(sqlite3_stmt *pStmt, int index, long value);
internal static extern int sqlite3_bind_int(sqlite3_stmt *pStmt, int index, int value);
internal static extern int sqlite3_finalize(sqlite3_stmt *pStmt);
internal static extern int sqlite3_reset(sqlite3_stmt *pStmt);
internal static extern int sqlite3_step(sqlite3_stmt *pStmt);