Skip to content

Commit dfa5c16

Browse files
authored
Remove obsoletions (#5393)
Closes #4520 Closes #4756 Closes #4946
1 parent fadcfee commit dfa5c16

16 files changed

+50
-224
lines changed

src/Npgsql/NpgsqlConnection.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -453,12 +453,6 @@ public override string ConnectionString
453453
/// </value>
454454
public override string DataSource => Connector?.Settings.DataSourceCached ?? _dataSource?.Settings.DataSourceCached ?? string.Empty;
455455

456-
/// <summary>
457-
/// Whether to use Windows integrated security to log in.
458-
/// </summary>
459-
[Obsolete("The IntegratedSecurity parameter is no longer needed and does nothing.")]
460-
public bool IntegratedSecurity => Settings.IntegratedSecurity;
461-
462456
/// <summary>
463457
/// User name.
464458
/// </summary>

src/Npgsql/NpgsqlConnectionStringBuilder.cs

Lines changed: 0 additions & 160 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,166 +1393,6 @@ public ServerCompatibilityMode ServerCompatibilityMode
13931393

13941394
#region Properties - Obsolete
13951395

1396-
/// <summary>
1397-
/// Whether to use Windows integrated security to log in.
1398-
/// </summary>
1399-
[Category("Security")]
1400-
[Description("Whether to use Windows integrated security to log in.")]
1401-
[DisplayName("Integrated Security")]
1402-
[NpgsqlConnectionStringProperty]
1403-
[Obsolete("The IntegratedSecurity parameter is no longer needed and does nothing.")]
1404-
public bool IntegratedSecurity
1405-
{
1406-
get => _integratedSecurity;
1407-
set
1408-
{
1409-
_integratedSecurity = value;
1410-
SetValue(nameof(IntegratedSecurity), value);
1411-
}
1412-
}
1413-
bool _integratedSecurity;
1414-
1415-
/// <summary>
1416-
/// Obsolete, see https://www.npgsql.org/doc/release-notes/6.0.html
1417-
/// </summary>
1418-
[Category("Compatibility")]
1419-
[Description("Makes MaxValue and MinValue timestamps and dates readable as infinity and negative infinity.")]
1420-
[DisplayName("Convert Infinity DateTime")]
1421-
[NpgsqlConnectionStringProperty]
1422-
[Obsolete("The ConvertInfinityDateTime parameter is no longer supported.")]
1423-
public bool ConvertInfinityDateTime
1424-
{
1425-
get => false;
1426-
set => throw new NotSupportedException("The Convert Infinity DateTime parameter is no longer supported; Npgsql 6.0 and above convert min/max values to Infinity by default. See https://www.npgsql.org/doc/types/datetime.html for more details.");
1427-
}
1428-
1429-
/// <summary>
1430-
/// Obsolete, see https://www.npgsql.org/doc/release-notes/3.1.html
1431-
/// </summary>
1432-
[Category("Obsolete")]
1433-
[Description("Obsolete, see https://www.npgsql.org/doc/release-notes/3.1.html")]
1434-
[DisplayName("Continuous Processing")]
1435-
[NpgsqlConnectionStringProperty]
1436-
[Obsolete("The ContinuousProcessing parameter is no longer supported.")]
1437-
public bool ContinuousProcessing
1438-
{
1439-
get => false;
1440-
set => throw new NotSupportedException("The ContinuousProcessing parameter is no longer supported. Please see https://www.npgsql.org/doc/release-notes/3.1.html");
1441-
}
1442-
1443-
/// <summary>
1444-
/// Obsolete, see https://www.npgsql.org/doc/release-notes/3.1.html
1445-
/// </summary>
1446-
[Category("Obsolete")]
1447-
[Description("Obsolete, see https://www.npgsql.org/doc/release-notes/3.1.html")]
1448-
[DisplayName("Backend Timeouts")]
1449-
[NpgsqlConnectionStringProperty]
1450-
[Obsolete("The BackendTimeouts parameter is no longer supported")]
1451-
public bool BackendTimeouts
1452-
{
1453-
get => false;
1454-
set => throw new NotSupportedException("The BackendTimeouts parameter is no longer supported. Please see https://www.npgsql.org/doc/release-notes/3.1.html");
1455-
}
1456-
1457-
/// <summary>
1458-
/// Obsolete, see https://www.npgsql.org/doc/release-notes/3.0.html
1459-
/// </summary>
1460-
[Category("Obsolete")]
1461-
[Description("Obsolete, see https://www.npgsql.org/doc/v/3.0.html")]
1462-
[DisplayName("Preload Reader")]
1463-
[NpgsqlConnectionStringProperty]
1464-
[Obsolete("The PreloadReader parameter is no longer supported")]
1465-
public bool PreloadReader
1466-
{
1467-
get => false;
1468-
set => throw new NotSupportedException("The PreloadReader parameter is no longer supported. Please see https://www.npgsql.org/doc/release-notes/3.0.html");
1469-
}
1470-
1471-
/// <summary>
1472-
/// Obsolete, see https://www.npgsql.org/doc/release-notes/3.0.html
1473-
/// </summary>
1474-
[Category("Obsolete")]
1475-
[Description("Obsolete, see https://www.npgsql.org/doc/release-notes/3.0.html")]
1476-
[DisplayName("Use Extended Types")]
1477-
[NpgsqlConnectionStringProperty]
1478-
[Obsolete("The UseExtendedTypes parameter is no longer supported")]
1479-
public bool UseExtendedTypes
1480-
{
1481-
get => false;
1482-
set => throw new NotSupportedException("The UseExtendedTypes parameter is no longer supported. Please see https://www.npgsql.org/doc/release-notes/3.0.html");
1483-
}
1484-
1485-
/// <summary>
1486-
/// Obsolete, see https://www.npgsql.org/doc/release-notes/4.1.html
1487-
/// </summary>
1488-
[Category("Obsolete")]
1489-
[Description("Obsolete, see https://www.npgsql.org/doc/release-notes/4.1.html")]
1490-
[DisplayName("Use Ssl Stream")]
1491-
[NpgsqlConnectionStringProperty]
1492-
[Obsolete("The UseSslStream parameter is no longer supported (always true)")]
1493-
public bool UseSslStream
1494-
{
1495-
get => true;
1496-
set => throw new NotSupportedException("The UseSslStream parameter is no longer supported (SslStream is always used). Please see https://www.npgsql.org/doc/release-notes/4.1.html");
1497-
}
1498-
1499-
/// <summary>
1500-
/// Writes connection performance information to performance counters.
1501-
/// </summary>
1502-
[Category("Obsolete")]
1503-
[Description("Writes connection performance information to performance counters.")]
1504-
[DisplayName("Use Perf Counters")]
1505-
[NpgsqlConnectionStringProperty]
1506-
[Obsolete("The UsePerfCounters parameter is no longer supported")]
1507-
public bool UsePerfCounters
1508-
{
1509-
get => false;
1510-
set => throw new NotSupportedException("The UsePerfCounters parameter is no longer supported. Please see https://www.npgsql.org/doc/release-notes/5.0.html");
1511-
}
1512-
1513-
/// <summary>
1514-
/// Location of a client certificate to be sent to the server.
1515-
/// </summary>
1516-
[Category("Obsolete")]
1517-
[Description("Location of a client certificate to be sent to the server.")]
1518-
[DisplayName("Client Certificate")]
1519-
[NpgsqlConnectionStringProperty]
1520-
[Obsolete("Use NpgsqlConnectionStringBuilder.SslKey instead")]
1521-
public string? ClientCertificate
1522-
{
1523-
get => SslKey;
1524-
set => SslKey = value;
1525-
}
1526-
1527-
/// <summary>
1528-
/// Key for a client certificate to be sent to the server.
1529-
/// </summary>
1530-
[Category("Obsolete")]
1531-
[Description("Key for a client certificate to be sent to the server.")]
1532-
[DisplayName("Client Certificate Key")]
1533-
[NpgsqlConnectionStringProperty]
1534-
[Obsolete("Use NpgsqlConnectionStringBuilder.SslPassword instead")]
1535-
public string? ClientCertificateKey
1536-
{
1537-
get => SslPassword;
1538-
set => SslPassword = value;
1539-
}
1540-
1541-
/// <summary>
1542-
/// When enabled, PostgreSQL error details are included on <see cref="PostgresException.Detail" /> and
1543-
/// <see cref="PostgresNotice.Detail" />. These can contain sensitive data.
1544-
/// </summary>
1545-
[Category("Obsolete")]
1546-
[Description("When enabled, PostgreSQL error and notice details are included on PostgresException.Detail and PostgresNotice.Detail. These can contain sensitive data.")]
1547-
[DisplayName("Include Error Details")]
1548-
[NpgsqlConnectionStringProperty]
1549-
[Obsolete("Use NpgsqlConnectionStringBuilder.IncludeErrorDetail instead")]
1550-
public bool IncludeErrorDetails
1551-
{
1552-
get => IncludeErrorDetail;
1553-
set => IncludeErrorDetail = value;
1554-
}
1555-
15561396
/// <summary>
15571397
/// Whether to trust the server certificate without validating it.
15581398
/// </summary>

src/Npgsql/NpgsqlLargeObjectManager.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Npgsql.Util;
1+
using System;
2+
using Npgsql.Util;
23
using System.Data;
34
using System.Text;
45
using System.Threading;
@@ -9,6 +10,7 @@ namespace Npgsql;
910
/// <summary>
1011
/// Large object manager. This class can be used to store very large files in a PostgreSQL database.
1112
/// </summary>
13+
[Obsolete("NpgsqlLargeObjectManager allows manipulating PostgreSQL large objects via publicly available PostgreSQL functions (lo_read, lo_write); call these yourself directly.")]
1214
public class NpgsqlLargeObjectManager
1315
{
1416
const int InvWrite = 0x00020000;

src/Npgsql/NpgsqlLargeObjectStream.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace Npgsql;
1010
/// An interface to remotely control the seekable stream for an opened large object on a PostgreSQL server.
1111
/// Note that the OpenRead/OpenReadWrite method as well as all operations performed on this stream must be wrapped inside a database transaction.
1212
/// </summary>
13+
[Obsolete("NpgsqlLargeObjectStream allows manipulating PostgreSQL large objects via publicly available PostgreSQL functions (lo_read, lo_write); call these yourself directly.")]
1314
public sealed class NpgsqlLargeObjectStream : Stream
1415
{
1516
readonly NpgsqlLargeObjectManager _manager;

src/Npgsql/NpgsqlNotificationEventArgs.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,10 @@ public sealed class NpgsqlNotificationEventArgs : EventArgs
2626
/// </summary>
2727
public string Payload { get; }
2828

29-
/// <summary>
30-
/// The channel on which the notification was sent.
31-
/// </summary>
32-
[Obsolete("Use Channel instead")]
33-
public string Condition => Channel;
34-
35-
/// <summary>
36-
/// An optional payload string that was sent with this notification.
37-
/// </summary>
38-
[Obsolete("Use Payload instead")]
39-
public string AdditionalInformation => Payload;
40-
4129
internal NpgsqlNotificationEventArgs(NpgsqlReadBuffer buf)
4230
{
4331
PID = buf.ReadInt32();
4432
Channel = buf.ReadNullTerminatedString();
4533
Payload = buf.ReadNullTerminatedString();
4634
}
47-
}
35+
}

src/Npgsql/NpgsqlTypes/NpgsqlTsQuery.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public override string ToString()
7777
/// </summary>
7878
/// <param name="value"></param>
7979
/// <returns></returns>
80+
[Obsolete("Client-side parsing of NpgsqlTsQuery is unreliable and cannot fully duplicate the PostgreSQL logic. Use PG functions instead (e.g. to_tsquery)")]
8081
public static NpgsqlTsQuery Parse(string value)
8182
{
8283
if (value == null)

src/Npgsql/NpgsqlTypes/NpgsqlTsVector.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ internal NpgsqlTsVector(List<Lexeme> lexemes, bool noCheck = false)
7474
/// </summary>
7575
/// <param name="value"></param>
7676
/// <returns></returns>
77+
[Obsolete("Client-side parsing of NpgsqlTsVector is unreliable and cannot fully duplicate the PostgreSQL logic. Use PG functions instead (e.g. to_tsvector)")]
7778
public static NpgsqlTsVector Parse(string value)
7879
{
7980
if (value == null)
@@ -551,4 +552,4 @@ public bool Equals(Lexeme o)
551552
/// </summary>
552553
public static bool operator !=(Lexeme left, Lexeme right) => !left.Equals(right);
553554
}
554-
}
555+
}

src/Npgsql/PostgresException.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -269,17 +269,6 @@ public override bool IsTransient
269269
public string SqlState { get; }
270270
#endif
271271

272-
/// <summary>
273-
/// The SQLSTATE code for the error.
274-
/// </summary>
275-
/// <remarks>
276-
/// Always present.
277-
/// Constants are defined in <seealso cref="PostgresErrorCodes"/>.
278-
/// See https://www.postgresql.org/docs/current/static/errcodes-appendix.html
279-
/// </remarks>
280-
[Obsolete("Use SqlState instead")]
281-
public string Code => SqlState;
282-
283272
/// <summary>
284273
/// The primary human-readable error message. This should be accurate but terse.
285274
/// </summary>

src/Npgsql/PostgresNotice.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,6 @@ public sealed class PostgresNotice
3838
/// </remarks>
3939
public string SqlState { get; set; }
4040

41-
/// <summary>
42-
/// The SQLSTATE code for the error.
43-
/// </summary>
44-
/// <remarks>
45-
/// Always present.
46-
/// See https://www.postgresql.org/docs/current/static/errcodes-appendix.html
47-
/// </remarks>
48-
[Obsolete("Use SqlState instead")]
49-
public string Code => SqlState;
50-
5141
/// <summary>
5242
/// The primary human-readable error message. This should be accurate but terse.
5343
/// </summary>
@@ -211,4 +201,4 @@ internal NpgsqlNoticeEventArgs(PostgresNotice notice)
211201
{
212202
Notice = notice;
213203
}
214-
}
204+
}

src/Npgsql/PublicAPI.Unshipped.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,40 @@ static Npgsql.INpgsqlTypeMapperExtensions.EnableRecordsAsTuples<T>(this T mapper
122122
static Npgsql.INpgsqlTypeMapperExtensions.EnableUnmappedTypes<T>(this T mapper) -> T
123123
static NpgsqlTypes.NpgsqlCidr.explicit operator System.Net.IPAddress!(NpgsqlTypes.NpgsqlCidr cidr) -> System.Net.IPAddress!
124124
static NpgsqlTypes.NpgsqlCidr.implicit operator NpgsqlTypes.NpgsqlInet(NpgsqlTypes.NpgsqlCidr cidr) -> NpgsqlTypes.NpgsqlInet
125+
*REMOVED*Npgsql.NpgsqlConnection.IntegratedSecurity.get -> bool
126+
*REMOVED*Npgsql.NpgsqlConnectionStringBuilder.BackendTimeouts.get -> bool
127+
*REMOVED*Npgsql.NpgsqlConnectionStringBuilder.BackendTimeouts.set -> void
128+
*REMOVED*Npgsql.NpgsqlConnectionStringBuilder.ClientCertificate.get -> string?
129+
*REMOVED*Npgsql.NpgsqlConnectionStringBuilder.ClientCertificate.set -> void
130+
*REMOVED*Npgsql.NpgsqlConnectionStringBuilder.ClientCertificateKey.get -> string?
131+
*REMOVED*Npgsql.NpgsqlConnectionStringBuilder.ClientCertificateKey.set -> void
132+
*REMOVED*Npgsql.NpgsqlConnectionStringBuilder.ContinuousProcessing.get -> bool
133+
*REMOVED*Npgsql.NpgsqlConnectionStringBuilder.ContinuousProcessing.set -> void
134+
*REMOVED*Npgsql.NpgsqlConnectionStringBuilder.ConvertInfinityDateTime.get -> bool
135+
*REMOVED*Npgsql.NpgsqlConnectionStringBuilder.ConvertInfinityDateTime.set -> void
136+
*REMOVED*Npgsql.NpgsqlConnectionStringBuilder.IncludeErrorDetails.get -> bool
137+
*REMOVED*Npgsql.NpgsqlConnectionStringBuilder.IncludeErrorDetails.set -> void
138+
*REMOVED*Npgsql.NpgsqlConnectionStringBuilder.IntegratedSecurity.get -> bool
139+
*REMOVED*Npgsql.NpgsqlConnectionStringBuilder.IntegratedSecurity.set -> void
140+
*REMOVED*Npgsql.NpgsqlConnectionStringBuilder.PreloadReader.get -> bool
141+
*REMOVED*Npgsql.NpgsqlConnectionStringBuilder.PreloadReader.set -> void
142+
*REMOVED*Npgsql.NpgsqlConnectionStringBuilder.UseExtendedTypes.get -> bool
143+
*REMOVED*Npgsql.NpgsqlConnectionStringBuilder.UseExtendedTypes.set -> void
144+
*REMOVED*Npgsql.NpgsqlConnectionStringBuilder.UsePerfCounters.get -> bool
145+
*REMOVED*Npgsql.NpgsqlConnectionStringBuilder.UsePerfCounters.set -> void
146+
*REMOVED*Npgsql.NpgsqlConnectionStringBuilder.UseSslStream.get -> bool
147+
*REMOVED*Npgsql.NpgsqlConnectionStringBuilder.UseSslStream.set -> void
148+
*REMOVED*Npgsql.NpgsqlNotificationEventArgs.AdditionalInformation.get -> string!
149+
*REMOVED*Npgsql.NpgsqlNotificationEventArgs.Condition.get -> string!
125150
*REMOVED*Npgsql.NpgsqlParameter.ConvertedValue.get -> object?
126151
*REMOVED*Npgsql.NpgsqlParameter.ConvertedValue.set -> void
152+
*REMOVED*Npgsql.PostgresException.Code.get -> string!
153+
*REMOVED*Npgsql.PostgresNotice.Code.get -> string!
127154
*REMOVED*Npgsql.PostgresTypes.PostgresArrayType.PostgresArrayType(string! ns, string! internalName, uint oid, Npgsql.PostgresTypes.PostgresType! elementPostgresType) -> void
128155
*REMOVED*Npgsql.PostgresTypes.PostgresBaseType.PostgresBaseType(string! ns, string! internalName, uint oid) -> void
129156
*REMOVED*Npgsql.PostgresTypes.PostgresType.PostgresType(string! ns, string! name, string! internalName, uint oid) -> void
130157
*REMOVED*Npgsql.PostgresTypes.PostgresType.PostgresType(string! ns, string! name, uint oid) -> void
158+
*REMOVED*Npgsql.Replication.PgOutput.Messages.DeleteMessage.RelationId.get -> uint
159+
*REMOVED*Npgsql.Replication.PgOutput.Messages.InsertMessage.RelationId.get -> uint
160+
*REMOVED*Npgsql.Replication.PgOutput.Messages.UpdateMessage.RelationId.get -> uint
131161
*REMOVED*Npgsql.TypeMapping.INpgsqlTypeMapper.AddTypeResolverFactory(Npgsql.Internal.TypeHandling.TypeHandlerResolverFactory! resolverFactory) -> void

0 commit comments

Comments
 (0)