Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microsoft.Data.Sqlite: Target .NET Standard 2.0 again #23713

Merged
merged 1 commit into from
Dec 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Microsoft.Data.Sqlite.SqliteException
Microsoft.Data.Sqlite.SqliteFactory
Microsoft.Data.Sqlite.SqliteParameter
Microsoft.Data.Sqlite.SqliteTransaction</Description>
<TargetFramework>net5.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net5.0</TargetFrameworks>
<MinClientVersion>3.6</MinClientVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<CodeAnalysisRuleSet>Microsoft.Data.Sqlite.Core.ruleset</CodeAnalysisRuleSet>
Expand Down
14 changes: 14 additions & 0 deletions src/Microsoft.Data.Sqlite.Core/SqliteTransaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,21 @@ public override void Rollback()
RollbackInternal();
}

#if NET
/// <inheritdoc />
public override bool SupportsSavepoints => true;
#endif

/// <summary>
/// Creates a savepoint in the transaction. This allows all commands that are executed after the savepoint was
/// established to be rolled back, restoring the transaction state to what it was at the time of the savepoint.
/// </summary>
/// <param name="savepointName">The name of the savepoint to be created.</param>
#if NET
public override void Save(string savepointName)
#else
public virtual void Save(string savepointName)
#endif
{
if (savepointName is null)
{
Expand All @@ -146,7 +152,11 @@ public override void Save(string savepointName)
/// Rolls back all commands that were executed after the specified savepoint was established.
/// </summary>
/// <param name="savepointName">The name of the savepoint to roll back to.</param>
#if NET
public override void Rollback(string savepointName)
#else
public virtual void Rollback(string savepointName)
#endif
{
if (savepointName is null)
{
Expand All @@ -171,7 +181,11 @@ public override void Rollback(string savepointName)
/// reclaim some resources before the transaction ends.
/// </summary>
/// <param name="savepointName">The name of the savepoint to release.</param>
#if NET
public override void Release(string savepointName)
#else
public virtual void Release(string savepointName)
#endif
{
if (savepointName is null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.Data.Sqlite.Core/SqliteValueReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public virtual string GetString(int ordinal)
return (T)(object)checked((ushort)GetInt64(ordinal));
}

return (T)GetValue(ordinal);
return (T)GetValue(ordinal)!;
}

public virtual object? GetValue(int ordinal)
Expand Down
14 changes: 14 additions & 0 deletions src/Microsoft.Data.Sqlite.Core/Utilities/AllowNullAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

#if !NET

namespace System.Diagnostics.CodeAnalysis
{
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)]
internal sealed class AllowNullAttribute : Attribute
{
}
}

#endif
2 changes: 1 addition & 1 deletion src/Microsoft.Data.Sqlite/Microsoft.Data.Sqlite.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Microsoft.Data.Sqlite.SqliteFactory
Microsoft.Data.Sqlite.SqliteParameter
Microsoft.Data.Sqlite.SqliteTransaction</Description>
<IncludeBuildOutput>false</IncludeBuildOutput>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<MinClientVersion>3.6</MinClientVersion>
<PackageTags>SQLite;Data;ADO.NET</PackageTags>
<IncludeSymbols>false</IncludeSymbols>
Expand Down