In this code:
defValue = FindKey(opts, "Journal Mode", "Delete");
if (String.Compare(defValue, "Default", StringComparison.OrdinalIgnoreCase) != 0)
{
cmd.CommandText = String.Format(CultureInfo.InvariantCulture, "PRAGMA journal_mode={0}", defValue);
cmd.ExecuteNonQuery();
}
shouldn't "Default" be "Delete"? There might be some other compares that are wrong.