Slide 19
Slide 19 text
Make sure we prepare statements
foreach (var v in insertList) {
try {
this.Checked(raw.sqlite3_bind_text(insertOp, 1, v.Key));
if (String.IsNullOrWhiteSpace(v.TypeName)) {
this.Checked(raw.sqlite3_bind_null(insertOp, 2));
} else {
this.Checked(raw.sqlite3_bind_text(insertOp, 2, v.TypeName));
}
this.Checked(raw.sqlite3_bind_blob(insertOp, 3, v.Value));
this.Checked(raw.sqlite3_bind_int64(insertOp, 4, v.Expiration.Ticks));
this.Checked(raw.sqlite3_bind_int64(insertOp, 5, v.CreatedAt.Ticks));
this.Checked(raw.sqlite3_step(insertOp));
} finally {
this.Checked(raw.sqlite3_reset(insertOp));
}
}