public static void ThrowIfNotOK(this Sqlite.Result result, string function) { if (result != Sqlite.Result.Ok) { throw new SqliteException(function, result); } }
public static void ThrowIfNot(this Sqlite.Result result, Sqlite.Result expected, string function) { if (result != expected) { throw new SqliteException(function, result); } }
public bool MoveNext() { Sqlite.Result r = Sqlite.Step(_statement); if (r == Sqlite.Result.Row) { return(true); } r.ThrowIfNot(Sqlite.Result.Done, nameof(Sqlite.Step)); return(false); }
private void Dispose(bool disposing) { if (_disposed) { return; } Sqlite.Result r = Sqlite.Finalize(_statement); if (!disposing) { return; } GC.SuppressFinalize(this); _disposed = true; r.ThrowIfNotOK(nameof(Sqlite.Finalize)); }
internal SqliteException(string function, Sqlite.Result error) : base($"{function}: {error}") { Function = function; Error = error; }