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

Migration to scaffold framework for code-generation #82

Merged
merged 38 commits into from
Apr 22, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
4e5a3ac
- initial project refactoring
MaceWindu Oct 9, 2022
5b7484a
move non-code files from project folder
MaceWindu Oct 9, 2022
23eebd0
ifdefs refactoring
MaceWindu Oct 9, 2022
eb8da3b
code refactoring/cleanup (in progress)
MaceWindu Oct 19, 2022
1e5ee82
refactoring
MaceWindu Oct 21, 2022
dfb86fa
refactor settings UI
MaceWindu Nov 6, 2022
16c04c5
update dependencies, fix build
MaceWindu Mar 25, 2023
e6cc65f
convert settings control tabs to usercontrol
MaceWindu Mar 25, 2023
83c2e48
fix configuration dialogs styling
MaceWindu Mar 25, 2023
d8772c6
implement #58, fixes, Access testing done
MaceWindu Mar 26, 2023
234f55e
sqlite tested
MaceWindu Mar 26, 2023
5516e32
- packages support
MaceWindu Apr 1, 2023
10dfe3d
sqlce (v5) fixes, v7 is not ready yet
MaceWindu Apr 1, 2023
e771ff1
sqlce v7 fixes
MaceWindu Apr 2, 2023
3fd654f
- sybase support
MaceWindu Apr 2, 2023
ceaf634
clickhouse support
MaceWindu Apr 2, 2023
cd07fef
sql server support (partially)
MaceWindu Apr 2, 2023
7ec1119
sql server support
MaceWindu Apr 8, 2023
62c1635
postgresql linqpad 5 fix
MaceWindu Apr 8, 2023
432854b
npgsql types rendering
MaceWindu Apr 9, 2023
8e0b5d4
mysql/mariadb support
MaceWindu Apr 9, 2023
cc78d54
oracle support
MaceWindu Apr 10, 2023
66ff88f
sap hana support
MaceWindu Apr 10, 2023
9314e5b
db2/informix support
MaceWindu Apr 10, 2023
9e8130f
cleanup
MaceWindu Apr 10, 2023
a54590f
pre-built context support
MaceWindu Apr 11, 2023
77d3e76
update dependencies
MaceWindu Apr 11, 2023
093abd1
code cleanup
MaceWindu Apr 11, 2023
9bcd385
finalize release notes
MaceWindu Apr 11, 2023
b935f02
Update Build/README.md
MaceWindu Apr 12, 2023
6856519
Update README.md
MaceWindu Apr 12, 2023
f1be439
Update release-notes.md
MaceWindu Apr 12, 2023
d882ab8
add clickhouse provider information to UI
MaceWindu Apr 12, 2023
00ed2cc
[clickhouse] add FixedString to string mapping option
MaceWindu Apr 12, 2023
da53028
add polysharp
MaceWindu Apr 12, 2023
b277a03
sql logger: don't log RecordsAffected when it is not set
MaceWindu Apr 15, 2023
9593c31
Database -> Database Type
MaceWindu Apr 15, 2023
a0b3754
dialect detection for sql server, oracle, pgsql
MaceWindu Apr 15, 2023
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
5 changes: 3 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
; What is EditorConfig? http://editorconfig.org/

root = true

; use tabs identation for all files
Expand Down Expand Up @@ -227,6 +225,9 @@ dotnet_diagnostic.IDE0079.severity = none # IDE0079: Remove unnecessary suppress
dotnet_diagnostic.IDE0080.severity = none # IDE0080: Remove unnecessary suppression operator
dotnet_diagnostic.IDE0081.severity = none # IDE0081: Remove ByVal
dotnet_diagnostic.IDE0083.severity = none # IDE0083: Use pattern matching (not operator)
dotnet_diagnostic.IDE0130.severity = none # IDE0130: Namespace does not match folder structure
dotnet_diagnostic.IDE0160.severity = none # IDE0160: Use block-scoped namespace
dotnet_diagnostic.IDE0161.severity = error # IDE0161: Use file-scoped namespace
dotnet_diagnostic.IDE1006.severity = none # IDE1006: Naming rule violation

dotnet_diagnostic.CS1998.severity = error # CS1998: Async method lacks 'await' operators and will run synchronously
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#Ignore files build by Visual Studio
.vs/
bin/
obj/
Expand Down
2 changes: 1 addition & 1 deletion 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-2020 ' + $authors
$child.InnerText = 'Copyright © 2016-2022 ' + $authors
$xml.package.metadata.AppendChild($child)

$child = $xml.CreateElement('authors', $nsUri)
Expand Down
11 changes: 6 additions & 5 deletions Build/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
## LINQ to DB LINQPad 6 and 7 Driver
# LINQ to DB LINQPad 6 and 7 Driver

This nuget package is a driver for [LINQPad 6 and 7](http://www.linqpad.net).

Following databases supported:

- **ClickHouse** (Binary, HTTP and MySQL interfaces)
- **DB2** (LUW, z/OS) (only 64-bit version)
- **Firebird**
- **Informix** (only 64-bit version)
- **Microsoft Access** *(supports both OleDb and ODBC)*
- **Microsoft Sql Server** 2005+ *(including **Microsoft Sql Azure**)*
- **Microsoft Sql Server Compact (SqlCe)**
- **MySql/MariaDB**
- **MariaDB**
- **MySql**
- **Oracle**
- **PostgreSQL**
- **SQLite**
- **SAP HANA** *(client software must be installed, supports both Native and ODBC providers)*
- **SAP/Sybase ASE**
- **SQLite**

### Installation
## Installation

- Click "Add connection" in LINQPad.
- In the "Choose Data Context" dialog, press the "View more drivers..." button.
Expand All @@ -26,4 +28,3 @@ Following databases supported:
- In the "Choose Data Context" dialog, select the "LINQ to DB" driver and click the "Next" button.
- In the "LINQ to DB connection" dialog, supply your connection information.
- You're done.

24 changes: 15 additions & 9 deletions Build/linq2db.LINQPad.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,32 @@
<readme>README.md</readme>
<dependencies>
<group targetFramework=".NETCoreApp3.1">
<dependency id="linq2db" version="4.3.0" />
<dependency id="linq2db.Tools" version="4.3.0" />

<dependency id="LINQPad.Reference" version="1.3.0" />
<dependency id="linq2db" version="4.2.0" />

<dependency id="Humanizer.Core" version="2.14.1" />
<dependency id="CodeJam" version="4.1.0" />
<dependency id="System.Configuration.ConfigurationManager" version="6.0.0" />
<dependency id="Microsoft.CodeAnalysis.CSharp" version="4.3.0" />
<dependency id="System.Text.Json" version="6.0.5" />
<dependency id="dotMorten.Microsoft.SqlServer.Types" version="1.5.0" />
<dependency id="System.Configuration.ConfigurationManager" version="6.0.1" />
<dependency id="Microsoft.CodeAnalysis.CSharp" version="4.3.1" />
<dependency id="System.Text.Json" version="6.0.6" />

<dependency id="dotMorten.Microsoft.SqlServer.Types" version="2.5.0" />

<dependency id="FirebirdSql.Data.FirebirdClient" version="9.0.2" />
<dependency id="MySqlConnector" version="2.1.13" />
<dependency id="AdoNetCore.AseClient" version="0.19.2" />
<dependency id="System.Data.SQLite.Core" version="1.0.116" />
<dependency id="System.Data.SqlClient" version="4.8.3" />
<dependency id="System.Data.Odbc" version="5.0.0" />
<dependency id="System.Data.OleDb" version="5.0.0" />
<dependency id="Npgsql" version="6.0.6" />
<dependency id="Microsoft.Data.SqlClient" version="5.0.1" />
<dependency id="System.Data.Odbc" version="6.0.1" />
<dependency id="System.Data.OleDb" version="6.0.0" />
<dependency id="Npgsql" version="6.0.7" />
<dependency id="Oracle.ManagedDataAccess.Core" version="3.21.70" />
<dependency id="IBM.Data.DB2.Core" version="3.1.0.600" />
<dependency id="ClickHouse.Client" version="5.1.1" />
<dependency id="Octonica.ClickHouseClient" version="2.2.9" />
<dependency id="linq2db4iSeries" version="4.3.0" />
</group>
</dependencies>
<frameworkReferences>
Expand Down
40 changes: 18 additions & 22 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,42 +1,38 @@
<Project>
<ItemGroup>
<PackageVersion Include="linq2db" Version="4.2.0" />
<PackageVersion Include="linq2db" Version="4.3.0" />
<PackageVersion Include="linq2db.Tools" Version="4.3.0" />

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

<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.3.1" />
<PackageVersion Include="Humanizer.Core" Version="2.14.1" />
<PackageVersion Include="CodeJam" Version="4.1.0" />
<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="6.0.0" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="6.0.1" />
<PackageVersion Include="System.Text.Json" Version="6.0.6" />

<PackageVersion Include="System.Data.SQLite.Core" Version="1.0.116" />
<PackageVersion Include="System.Data.Odbc" Version="6.0.1" />
<PackageVersion Include="System.Data.OleDb" Version="6.0.0" />
<PackageVersion Include="MySqlConnector" Version="2.1.13" />
<PackageVersion Include="AdoNetCore.AseClient" Version="0.19.2" />
<PackageVersion Include="IBM.Data.DB.Provider" Version="11.5.5010.4" GeneratePathProperty="true" />
<PackageVersion Include="System.Data.SQLite.Core" Version="1.0.116" />
<PackageVersion Include="System.Data.SqlClient" Version="4.8.3" />
<PackageVersion Include="Oracle.ManagedDataAccess" Version="19.14.0" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.0.1" />
<PackageVersion Include="Oracle.ManagedDataAccess" Version="21.7.0" />
<PackageVersion Include="Oracle.ManagedDataAccess.Core" Version="3.21.70" />
<PackageVersion Include="System.Data.Odbc" Version="6.0.0" />
<PackageVersion Include="System.Data.OleDb" Version="6.0.0" />
<PackageVersion Include="IBM.Data.DB2.Core" Version="3.1.0.600" />
<PackageVersion Include="dotMorten.Microsoft.SqlServer.Types" Version="1.5.0" />
<PackageVersion Include="Microsoft.SqlServer.Types" Version="14.0.1016.290" />
<!--<PackageVersion Include="linq2db4iSeries" Version="2.9.0" />-->
</ItemGroup>
<PackageVersion Include="ClickHouse.Client" Version="5.1.1" />
<PackageVersion Include="FirebirdSql.Data.FirebirdClient" Version="9.0.2" />
<PackageVersion Include="Npgsql" Version="6.0.7" />
<PackageVersion Include="Octonica.ClickHouseClient" Version="2.2.9" />
<PackageVersion Include="linq2db4iSeries" Version="4.3.0" />

<ItemGroup Condition=" '$(TargetFramework)' == 'net461'">
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="2.10.0" />
<PackageVersion Include="Npgsql" Version="4.1.10" />
<PackageVersion Include="FirebirdSql.Data.FirebirdClient" Version="7.10.1" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' != 'net461' ">
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.3.0" />
<PackageVersion Include="Npgsql" Version="6.0.6" />
<PackageVersion Include="FirebirdSql.Data.FirebirdClient" Version="9.0.2" />
<PackageVersion Include="System.Text.Json" Version="6.0.5" />
<PackageVersion Include="Microsoft.SqlServer.Types" Version="160.900.6-rc0" />
<PackageVersion Include="dotMorten.Microsoft.SqlServer.Types" Version="2.5.0" />
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions LinqToDB.Templates/NotifyPropertyChanged.ttinclude
Original file line number Diff line number Diff line change
Expand Up @@ -219,16 +219,16 @@ void NotifyPropertyChangedImpl()
{
new Event("PropertyChangedEventHandler", "PropertyChanged", true)
{
IsVirtual = true,
IsVirtual = false,
Attributes = { new Attribute("field : NonSerialized") }
},
new Method(() => "void", "OnPropertyChanged", new Func<string>[] { () => "string propertyName" }, () => OnPropertyChangedBody)
{
AccessModifier = AccessModifier.Protected
AccessModifier = AccessModifier.Private
},
new Method(() => "void", "OnPropertyChanged", new Func<string>[] { () => "PropertyChangedEventArgs arg" }, () => OnPropertyChangedArgBody)
{
AccessModifier = AccessModifier.Protected
AccessModifier = AccessModifier.Private
},
}
});
Expand Down
1 change: 1 addition & 0 deletions LinqToDB.Templates/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Folder contains helper templates for WPF view generation.
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
## LINQ to DB LINQPad Driver
# LINQ to DB LINQPad Driver

[![NuGet Version and Downloads count](https://buildstats.info/nuget/linq2db.LINQPad?includePreReleases=true)](https://www.nuget.org/packages/linq2db.LINQPad) [![License](https://img.shields.io/github/license/linq2db/linq2db.LINQPad)](MIT-LICENSE.txt)

[![Master branch build](https://img.shields.io/azure-devops/build/linq2db/linq2db/8/master?label=build%20(master))](https://dev.azure.com/linq2db/linq2db/_build?definitionId=8&_a=summary) [![Latest build](https://img.shields.io/azure-devops/build/linq2db/linq2db/8?label=build%20(latest))](https://dev.azure.com/linq2db/linq2db/_build?definitionId=8&_a=summary)

linq2db.LINQPad is a driver for [LINQPad 5 (.NET Framework)](http://www.linqpad.net) and [LINQPad 6-7 (.NET Core)](http://www.linqpad.net).
linq2db.LINQPad is a driver for [LINQPad 5 (.NET Framework)](http://www.linqpad.net) and [LINQPad 6-7 (.NET/Core)](http://www.linqpad.net).

Following databases supported (by all LINQPad versions if other not noted):

- **ClickHouse**: Binary (LINQPad 6+), HTTP and MySQL interfaces
- **DB2** (LUW, z/OS) (LINQPad 6+ supports only 64-bit version)
- **DB2 iSeries** (using [3rd-party provider](https://github.com/LinqToDB4iSeries/Linq2DB4iSeries)) *(iAccess 7.1+ software must be installed)*. **IMPORTANT:** currently available only for LINQPad 5 using linq2db.LINQPad version 2.9.3 or earlier
- **Firebird**
- **Informix** (LINQPad 6+ supports only 64-bit version)
- **Microsoft Access** *(supports both OleDb and ODBC)*
- **Microsoft Sql Server** 2000+ *(including **Microsoft Sql Azure**. LINQPad 6+ [doesn't support](https://stackoverflow.com/a/45418196) **Sql Server 2000**)*
- **Microsoft Sql Server** 2005+ *(including **Microsoft Sql Azure**)*
- **Microsoft Sql Server Compact (SqlCe)**
- **MySql/MariaDB**
- **MariaDB**
- **MySql**
- **Oracle**
- **PostgreSQL**
- **SQLite**
- **SAP HANA** *(client software must be installed, supports both Native and ODBC providers)*
- **SAP/Sybase ASE**
- **SQLite**

### Download
## Download

Releases are hosted on [Github](https://github.com/linq2db/linq2db.LINQPad/releases) and on [Nuget](https://www.nuget.org/packages/linq2db.LINQPad) for LINQPad 6+ driver.

Latest build is hosted on [Azure Artifacts](https://dev.azure.com/linq2db/linq2db/_packaging?_a=package&feed=linq2db%40Local&package=linq2db.LINQPad&protocolType=NuGet). Feed [URL](https://pkgs.dev.azure.com/linq2db/linq2db/_packaging/linq2db/nuget/v3/index.json) ([how to use](https://docs.microsoft.com/en-us/nuget/consume-packages/install-use-packages-visual-studio#package-sources)).

## Installation

### Installation

#### LINQPad 6+ (NuGet)
### LINQPad 6+ (NuGet)

- Click "Add connection" in LINQPad.
- In the "Choose Data Context" dialog, press the "View more drivers..." button.
Expand All @@ -41,7 +42,7 @@ Latest build is hosted on [Azure Artifacts](https://dev.azure.com/linq2db/linq2d
- In the "LINQ to DB connection" dialog, supply your connection information.
- You're done.

#### LINQPad 6+ (Manual)
### LINQPad 6+ (Manual)

- Download latest **.lpx6** file from the link provided above.
- Click "Add connection" in LINQPad.
Expand All @@ -52,7 +53,7 @@ Latest build is hosted on [Azure Artifacts](https://dev.azure.com/linq2db/linq2d
- In the "LINQ to DB connection" dialog, supply your connection information.
- You're done.

#### LINQPad 5 (Choose a driver)
### LINQPad 5 (Choose a driver)

- Click "Add connection" in LINQPad.
- In the "Choose Data Context" dialog, press the "View more drivers..." button.
Expand All @@ -62,7 +63,7 @@ Latest build is hosted on [Azure Artifacts](https://dev.azure.com/linq2db/linq2d
- In the "LINQ to DB connection" dialog, supply your connection information.
- You're done.

#### LINQPad 5 (Manual)
### LINQPad 5 (Manual)

- Download latest **.lpx** file from the link provided above.
- Click "Add connection" in LINQPad.
Expand Down
72 changes: 34 additions & 38 deletions Source/AppJsonConfig.cs
Original file line number Diff line number Diff line change
@@ -1,56 +1,52 @@
#if NETCORE
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.Json;
using LinqToDB.Configuration;

namespace LinqToDB.LINQPad
namespace LinqToDB.LINQPad;

internal sealed class AppJsonConfig : ILinqToDBSettings
{
internal class AppJsonConfig : ILinqToDBSettings
public static ILinqToDBSettings Load(string configPath)
{
public static ILinqToDBSettings Load(string configPath)
{
var config = JsonSerializer.Deserialize<JsonConfig>(File.ReadAllText(configPath));
var config = JsonSerializer.Deserialize<JsonConfig>(File.ReadAllText(configPath));

return new AppJsonConfig(config?.ConnectionStrings?.Select(entry => (IConnectionStringSettings)new ConnectionStringSettings(entry.Key, entry.Value)).ToArray()
?? Array.Empty<IConnectionStringSettings>());
}
return new AppJsonConfig(config?.ConnectionStrings?.Select(entry => (IConnectionStringSettings)new ConnectionStringSettings(entry.Key, entry.Value)).ToArray()
?? Array.Empty<IConnectionStringSettings>());
}

private readonly IConnectionStringSettings[] _connectionStrings;
private readonly IConnectionStringSettings[] _connectionStrings;

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

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

private class JsonConfig
{
public IDictionary<string, string>? ConnectionStrings { get; set; }
}
private sealed class JsonConfig
{
public IDictionary<string, string>? ConnectionStrings { get; set; }
}

private class ConnectionStringSettings : IConnectionStringSettings
private sealed class ConnectionStringSettings : IConnectionStringSettings
{
private readonly string _name;
private readonly string _connectionString;

public ConnectionStringSettings(string name, string connectionString)
{
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.ProviderName => null;
bool IConnectionStringSettings.IsGlobal => false;
_name = name;
_connectionString = connectionString;
}

string IConnectionStringSettings.ConnectionString => _connectionString;
string IConnectionStringSettings.Name => _name;
string? IConnectionStringSettings.ProviderName => null;
bool IConnectionStringSettings.IsGlobal => false;
}
}
#endif
Loading