Skip to content

Update dependencies #104

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

Merged
merged 1 commit into from
Mar 9, 2024
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
7 changes: 6 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,13 @@ dotnet_diagnostic.CA3076.severity = none # CA3076: Insecure XSLT Script Executio
dotnet_diagnostic.CA1000.severity = none # CA1000: Do not declare static members on generic types
dotnet_diagnostic.CA1001.severity = none # CA1001: Types that own disposable fields should be disposable
dotnet_diagnostic.CA1010.severity = none # CA1010: Collections should implement generic interface
dotnet_diagnostic.CA1050.severity = none # CA1050: Declare types in namespaces
dotnet_diagnostic.CA1031.severity = none # CA1031: Catch more specific exception
dotnet_diagnostic.CA1032.severity = none # CA1032: Add constructors to exception
dotnet_diagnostic.CA1036.severity = none # CA1036: Override methods on comparable types
dotnet_diagnostic.CA1050.severity = none # CA1050: Declare types in namespaces
dotnet_diagnostic.CA1051.severity = none # CA1051: Do not declare visible instance fields
dotnet_diagnostic.CA1062.severity = none # CA1062: Vaidate aruments of public API
dotnet_diagnostic.CA1064.severity = none # CA1064: Exception should be public
dotnet_diagnostic.CA1067.severity = none # CA1067: Override Equals when implementing IEquatable
dotnet_diagnostic.CA1068.severity = none # CA1068: CancellationToken parameters must come last
dotnet_diagnostic.CA1069.severity = none # CA1069: Enums should not have duplicate values
Expand All @@ -156,6 +160,7 @@ dotnet_diagnostic.CA1720.severity = none # CA1720: Identifiers should not contai
dotnet_diagnostic.CA1806.severity = none # CA1806: Do not ignore method results
dotnet_diagnostic.CA1822.severity = none # CA1822: Mark members as static
dotnet_diagnostic.CA2211.severity = none # CA2211: Non-constant fields should not be visible
dotnet_diagnostic.CA2237.severity = none # CA2237: add [Serializable] (no way)

###################################################################################
# VS analyzers #
Expand Down
4 changes: 2 additions & 2 deletions Build/BuildNuspecs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if ($version) {
$xml.package.metadata.AppendChild($child)

$child = $xml.CreateElement('copyright', $nsUri)
$child.InnerText = 'Copyright © 2016-2023 ' + $authors
$child.InnerText = 'Copyright © 2016-2024 ' + $authors
$xml.package.metadata.AppendChild($child)

$child = $xml.CreateElement('authors', $nsUri)
Expand Down Expand Up @@ -72,7 +72,7 @@ if ($version) {

$child = $xml.CreateElement('file', $nsUri)
$attr = $xml.CreateAttribute('src')
$attr.Value = 'icon64.png'
$attr.Value = 'icon.png'
$child.Attributes.Append($attr)
$attr = $xml.CreateAttribute('target')
$attr.Value = 'images\icon.png'
Expand Down
8 changes: 4 additions & 4 deletions Build/azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
variables:
solution: 'linq2db.LINQPad.sln'
build_configuration: 'Release'
assemblyVersion: 5.1.0.0
nugetVersion: 5.1.0
nugetDevVersion: 5.1.1
nugetPRVersion: 5.1.1
assemblyVersion: 5.2.0.0
nugetVersion: 5.2.0
nugetDevVersion: 5.2.1
nugetPRVersion: 5.2.1
artifact_lpx: 'lpx'
artifact_lpx6: 'lpx6'
artifact_nuget: 'nuget'
Expand Down
Binary file added Build/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Build/icon64.png
Binary file not shown.
37 changes: 19 additions & 18 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
<Project>
<ItemGroup>
<PackageVersion Include="linq2db" Version="5.2.2" />
<PackageVersion Include="linq2db.Tools" Version="5.2.2" />
<PackageVersion Include="linq2db" Version="5.4.0" />
<PackageVersion Include="linq2db.Tools" Version="5.4.0" />

<PackageVersion Include="LINQPad.Reference" Version="1.3.0" />

<PackageVersion Include="PolySharp" Version="1.13.2" />
<PackageVersion Include="PolySharp" Version="1.14.1" />

<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.6.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" />
<PackageVersion Include="System.ValueTuple" Version="4.5.0" />
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageVersion Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageVersion Include="System.Memory" Version="4.5.5" />
<PackageVersion Include="System.Buffers" Version="4.5.1" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="7.0.0" />
<PackageVersion Include="System.Text.Json" Version="7.0.2" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
<PackageVersion Include="System.Text.Json" Version="8.0.2" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />

<PackageVersion Include="System.Data.SQLite.Core" Version="1.0.117" />
<PackageVersion Include="System.Data.Odbc" Version="7.0.0" />
<PackageVersion Include="System.Data.OleDb" Version="7.0.0" />
<PackageVersion Include="MySqlConnector" Version="2.2.6" />
<PackageVersion Include="System.Data.SQLite.Core" Version="1.0.118" />
<PackageVersion Include="System.Data.Odbc" Version="8.0.0" />
<PackageVersion Include="System.Data.OleDb" Version="8.0.0" />
<PackageVersion Include="MySqlConnector" Version="2.3.5" />
<PackageVersion Include="AdoNetCore.AseClient" Version="0.19.2" />
<PackageVersion Include="IBM.Data.DB.Provider" Version="11.5.5010.4" GeneratePathProperty="true" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.1.1" />
<PackageVersion Include="Oracle.ManagedDataAccess" Version="21.10.0" />
<PackageVersion Include="Oracle.ManagedDataAccess.Core" Version="3.21.100" />
<PackageVersion Include="Net.IBM.Data.Db2" Version="7.0.0.200" />
<PackageVersion Include="ClickHouse.Client" Version="6.6.0" />
<PackageVersion Include="FirebirdSql.Data.FirebirdClient" Version="9.1.1" />
<PackageVersion Include="Npgsql" Version="7.0.4" />
<PackageVersion Include="IBM.Data.DB.Provider" Version="11.5.9000.4" GeneratePathProperty="true" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.2.0" />
<PackageVersion Include="Oracle.ManagedDataAccess" Version="21.13.0" />
<PackageVersion Include="Oracle.ManagedDataAccess.Core" Version="3.21.130" />
<PackageVersion Include="Net.IBM.Data.Db2" Version="7.0.0.400" />
<PackageVersion Include="ClickHouse.Client" Version="7.1.1" />
<PackageVersion Include="FirebirdSql.Data.FirebirdClient" Version="10.0.0" />
<PackageVersion Include="Npgsql" Version="8.0.2" />
<PackageVersion Include="Octonica.ClickHouseClient" Version="2.2.9" />
<!--<PackageVersion Include="linq2db4iSeries" Version="5.1.0" />-->

Expand Down
2 changes: 1 addition & 1 deletion MIT-LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2016-2023 Linq To DB Team
Copyright (c) 2016-2024 Linq To DB Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
29 changes: 11 additions & 18 deletions Source/Compat/ReadOnlyHashSet.cs
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
#if !NET5_0_OR_GREATER
namespace System.Collections.Generic;

internal sealed class ReadOnlyHashSet<T> : IReadOnlySet<T>
internal sealed class ReadOnlyHashSet<T>(ISet<T> set) : IReadOnlySet<T>
{
private readonly ISet<T> _set;
int IReadOnlyCollection<T>.Count => set.Count;

public ReadOnlyHashSet(ISet<T> set)
{
_set = set;
}
bool IReadOnlySet<T>.Contains(T item) => set.Contains(item);

int IReadOnlyCollection<T>.Count => _set.Count;
IEnumerator<T> IEnumerable<T>.GetEnumerator() => set.GetEnumerator();

bool IReadOnlySet<T>.Contains(T item) => _set.Contains(item);
IEnumerator IEnumerable.GetEnumerator() => ((IEnumerable)set).GetEnumerator();

IEnumerator<T> IEnumerable<T>.GetEnumerator() => _set.GetEnumerator();
bool IReadOnlySet<T>.IsProperSubsetOf(IEnumerable<T> other) => set.IsProperSubsetOf(other);

IEnumerator IEnumerable.GetEnumerator() => ((IEnumerable)_set).GetEnumerator();
bool IReadOnlySet<T>.IsProperSupersetOf(IEnumerable<T> other) => set.IsProperSupersetOf(other);

bool IReadOnlySet<T>.IsProperSubsetOf(IEnumerable<T> other) => _set.IsProperSubsetOf(other);
bool IReadOnlySet<T>.IsSubsetOf(IEnumerable<T> other) => set.IsSubsetOf(other);

bool IReadOnlySet<T>.IsProperSupersetOf(IEnumerable<T> other) => _set.IsProperSupersetOf(other);
bool IReadOnlySet<T>.IsSupersetOf(IEnumerable<T> other) => set.IsSupersetOf(other);

bool IReadOnlySet<T>.IsSubsetOf(IEnumerable<T> other) => _set.IsSubsetOf(other);
bool IReadOnlySet<T>.Overlaps(IEnumerable<T> other) => set.Overlaps(other);

bool IReadOnlySet<T>.IsSupersetOf(IEnumerable<T> other) => _set.IsSupersetOf(other);

bool IReadOnlySet<T>.Overlaps(IEnumerable<T> other) => _set.Overlaps(other);

bool IReadOnlySet<T>.SetEquals(IEnumerable<T> other) => _set.SetEquals(other);
bool IReadOnlySet<T>.SetEquals(IEnumerable<T> other) => set.SetEquals(other);


}
Expand Down
2 changes: 2 additions & 0 deletions Source/Compat/ReadOnlySetExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

internal static class ReadOnlySetExtensions
{
#pragma warning disable CA1859 // change return type
public static IReadOnlySet<T> AsReadOnly<T>(this HashSet<T> set)
#pragma warning restore CA1859 // change return type
{
#if NET5_0_OR_GREATER
return set;
Expand Down
41 changes: 16 additions & 25 deletions Source/Configuration/AppConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ namespace LinqToDB.LINQPad;
/// Implements Linq To DB connection settings provider, which use data from JSON config.
/// Used as settings source for static data context.
/// </summary>
internal sealed class AppConfig : ILinqToDBSettings
internal sealed class AppConfig(IConnectionStringSettings[] connectionStrings) : ILinqToDBSettings
{
#pragma warning disable CA1859 // change return type
public static ILinqToDBSettings LoadJson(string configPath)
#pragma warning restore CA1859 // change return type
{
var config = JsonSerializer.Deserialize<JsonConfig>(File.ReadAllText(configPath));

if (config?.ConnectionStrings?.Count is null or 0)
return new AppConfig(Array.Empty<IConnectionStringSettings>());
return new AppConfig([]);

var connections = new Dictionary<string, ConnectionStringSettings>(StringComparer.InvariantCultureIgnoreCase);
foreach (var cn in config.ConnectionStrings)
Expand All @@ -40,15 +42,18 @@ public static ILinqToDBSettings LoadJson(string configPath)
return new AppConfig(connections.Values.ToArray());
}

#pragma warning disable CA1859 // change return type
public static ILinqToDBSettings LoadAppConfig(string configPath)
#pragma warning restore CA1859 // change return type
{
var xml = new XmlDocument() { XmlResolver = null };
xml.Load(XmlReader.Create(new StringReader(File.ReadAllText(configPath)), new XmlReaderSettings() { XmlResolver = null }));
using var reader = XmlReader.Create(new StringReader(File.ReadAllText(configPath)), new XmlReaderSettings() { XmlResolver = null });
xml.Load(reader);

var connections = xml.SelectNodes("/configuration/connectionStrings/add");

if (connections?.Count is null or 0)
return new AppConfig(Array.Empty<IConnectionStringSettings>());
return new AppConfig([]);

var settings = new List<ConnectionStringSettings>();

Expand All @@ -65,36 +70,22 @@ public static ILinqToDBSettings LoadAppConfig(string configPath)
return new AppConfig(settings.ToArray());
}

private readonly IConnectionStringSettings[] _connectionStrings;

public AppConfig(IConnectionStringSettings[] connectionStrings)
{
_connectionStrings = connectionStrings;
}

IEnumerable<IDataProviderSettings> ILinqToDBSettings.DataProviders => Array.Empty<IDataProviderSettings>();
IEnumerable<IDataProviderSettings> ILinqToDBSettings.DataProviders => [];
string? ILinqToDBSettings.DefaultConfiguration => null;
string? ILinqToDBSettings.DefaultDataProvider => null;
IEnumerable<IConnectionStringSettings> ILinqToDBSettings.ConnectionStrings => _connectionStrings;
IEnumerable<IConnectionStringSettings> ILinqToDBSettings.ConnectionStrings => connectionStrings;

#pragma warning disable CA1812 // Remove unused type
private sealed class JsonConfig
#pragma warning restore CA1812 // Remove unused type
{
public IDictionary<string, string>? ConnectionStrings { get; set; }
}

private sealed class ConnectionStringSettings : IConnectionStringSettings
private sealed class ConnectionStringSettings(string name, string connectionString) : IConnectionStringSettings
{
private readonly string _name;
private readonly string _connectionString;

public ConnectionStringSettings(string name, string connectionString)
{
_name = name;
_connectionString = connectionString;
}

string IConnectionStringSettings.ConnectionString => _connectionString;
string IConnectionStringSettings.Name => _name;
string IConnectionStringSettings.ConnectionString => connectionString;
string IConnectionStringSettings.Name => name;
bool IConnectionStringSettings.IsGlobal => false;

public string? ProviderName { get; set; }
Expand Down
10 changes: 5 additions & 5 deletions Source/Configuration/ConnectionSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ internal sealed class ConnectionSettings

private static readonly JsonSerializerOptions _jsonOptions;

#pragma warning disable CA1810 // Initialize reference type static fields inline
static ConnectionSettings()
#pragma warning restore CA1810 // Initialize reference type static fields inline
{
_jsonOptions = new()
{
Expand Down Expand Up @@ -133,7 +135,7 @@ public void Save(IConnectionInfo cxInfo)
private static class Legacy
{
// list item separators for legacy options
private static readonly char[] _listSeparators = new[]{ ',', ';' };
private static readonly char[] _listSeparators = [',', ';'];

// legacy options
private const string ProviderName = "providerName";
Expand All @@ -147,9 +149,7 @@ private static class Legacy
private const string ExcludeCatalogs = "excludeCatalogs";
private const string OptimizeJoins = "optimizeJoins";
private const string UseProviderSpecificTypes = "useProviderSpecificTypes";
private const string UseCustomFormatter = "useCustomFormatter";
private const string CommandTimeout = "commandTimeout";
private const string NormalizeNames = "normalizeNames";
private const string CustomConfiguration = "customConfiguration";

public static ConnectionSettings Load(IConnectionInfo cxInfo)
Expand Down Expand Up @@ -264,8 +264,8 @@ or PN.SqlServer
settings.Scaffold.AsIsNames = !isNew;

// ignored options:
// UseCustomFormatter - removed in v5
// NormalizeNames - not used in pre-v5 and v5 (never used?)
// useCustomFormatter - removed in v5
// normalizeNames - not used in pre-v5 and v5 (never used?)

return settings;
}
Expand Down
6 changes: 3 additions & 3 deletions Source/DatabaseProviders/AccessProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ namespace LinqToDB.LINQPad;

internal sealed class AccessProvider : DatabaseProviderBase
{
private static readonly IReadOnlyList<ProviderInfo> _providers = new ProviderInfo[]
{
private static readonly IReadOnlyList<ProviderInfo> _providers =
[
new (ProviderName.Access , "OLE DB"),
new (ProviderName.AccessOdbc, "ODBC" ),
};
];

public AccessProvider()
: base(ProviderName.Access, "Microsoft Access", _providers)
Expand Down
6 changes: 3 additions & 3 deletions Source/DatabaseProviders/ClickHouseProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ namespace LinqToDB.LINQPad;

internal sealed class ClickHouseProvider : DatabaseProviderBase
{
private static readonly IReadOnlyList<ProviderInfo> _providers = new ProviderInfo[]
{
private static readonly IReadOnlyList<ProviderInfo> _providers =
[
new (ProviderName.ClickHouseClient , "HTTP(S) Interface (ClickHouse.Client)" ),
new (ProviderName.ClickHouseMySql , "MySQL Interface (MySqlConnector)" ),
#if !NETFRAMEWORK
// octonica provider doesn't support NETFX or NESTANDARD
new (ProviderName.ClickHouseOctonica, "Binary (TCP) Interface (Octonica.ClickHouseClient)"),
#endif
};
];

public ClickHouseProvider()
: base(ProviderName.ClickHouse, "ClickHouse", _providers)
Expand Down
6 changes: 3 additions & 3 deletions Source/DatabaseProviders/DB2Provider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ namespace LinqToDB.LINQPad;

internal sealed class DB2Provider : DatabaseProviderBase
{
private static readonly IReadOnlyList<ProviderInfo> _providers = new ProviderInfo[]
{
private static readonly IReadOnlyList<ProviderInfo> _providers =
[
new (ProviderName.DB2LUW , "DB2 for Linux, UNIX and Windows (LUW)"),
// zOS provider not tested at all as we don't have access to database instance
new (ProviderName.DB2zOS , "DB2 for z/OS" ),
//new (DB2iSeriesProviderName.DB2, "DB2 for i (iSeries)" ),
};
];

public DB2Provider()
//: base(ProviderName.DB2, "IBM DB2 (LUW, z/OS or iSeries)", _providers)
Expand Down
Loading