Skip to content

Commit 7c19344

Browse files
bigjonrobertsroji
authored andcommitted
Add SupportsSavepoints property to NpgsqlTransaction (#4978)
(cherry picked from commit c2ecdbb)
1 parent bb0623e commit 7c19344

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

Npgsql.sln.DotSettings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
<s:Boolean x:Key="/Default/UserDictionary/Words/=Regproc/@EntryIndexedValue">True</s:Boolean>
122122
<s:Boolean x:Key="/Default/UserDictionary/Words/=regtype/@EntryIndexedValue">True</s:Boolean>
123123
<s:Boolean x:Key="/Default/UserDictionary/Words/=resultset/@EntryIndexedValue">True</s:Boolean>
124+
<s:Boolean x:Key="/Default/UserDictionary/Words/=savepoints/@EntryIndexedValue">True</s:Boolean>
124125
<s:Boolean x:Key="/Default/UserDictionary/Words/=sproc/@EntryIndexedValue">True</s:Boolean>
125126
<s:Boolean x:Key="/Default/UserDictionary/Words/=Subrange/@EntryIndexedValue">True</s:Boolean>
126127
<s:Boolean x:Key="/Default/UserDictionary/Words/=subtransaction/@EntryIndexedValue">True</s:Boolean>

src/Npgsql/NpgsqlTransaction.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,18 @@ public Task ReleaseAsync(string name, CancellationToken cancellationToken = defa
356356
return Release(name, true, cancellationToken);
357357
}
358358

359+
/// <summary>
360+
/// Indicates whether this transaction supports database savepoints.
361+
/// </summary>
362+
#if NET5_0_OR_GREATER
363+
public override bool SupportsSavepoints
364+
#else
365+
public bool SupportsSavepoints
366+
#endif
367+
{
368+
get => _connector.DatabaseInfo.SupportsTransactions;
369+
}
370+
359371
#endregion
360372

361373
#region Dispose
@@ -500,4 +512,4 @@ internal void UnbindIfNecessary()
500512
}
501513

502514
#endregion
503-
}
515+
}

src/Npgsql/PublicAPI.Shipped.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,6 +1741,7 @@ override Npgsql.NpgsqlTransaction.RollbackAsync(string! name, System.Threading.C
17411741
override Npgsql.NpgsqlTransaction.RollbackAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task!
17421742
override Npgsql.NpgsqlTransaction.Save(string! name) -> void
17431743
override Npgsql.NpgsqlTransaction.SaveAsync(string! name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task!
1744+
override Npgsql.NpgsqlTransaction.SupportsSavepoints.get -> bool
17441745
override Npgsql.PostgresException.GetObjectData(System.Runtime.Serialization.SerializationInfo! info, System.Runtime.Serialization.StreamingContext context) -> void
17451746
override Npgsql.PostgresException.IsTransient.get -> bool
17461747
override Npgsql.PostgresException.SqlState.get -> string!

0 commit comments

Comments
 (0)