Exemplo n.º 1
0
 public static void ThrowIfNotOK(this Sqlite.Result result, string function)
 {
     if (result != Sqlite.Result.Ok)
     {
         throw new SqliteException(function, result);
     }
 }
Exemplo n.º 2
0
 public static void ThrowIfNot(this Sqlite.Result result, Sqlite.Result expected, string function)
 {
     if (result != expected)
     {
         throw new SqliteException(function, result);
     }
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 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));
 }
Exemplo n.º 5
0
 internal SqliteException(string function, Sqlite.Result error)
     : base($"{function}: {error}")
 {
     Function = function;
     Error    = error;
 }