- This tool is a Visual Studio extension which helps migrating the Microsoft C# ADO.NET code that is connected to Microsoft SQL Server to PostgreSQL database.
- This extension is built using Roslyn framework (https://docs.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/) and .Net Standard 2.0.
- Along with converting the existing code, this tool also extracts inline queries if required.
- It will download and install the required NuGet packages related to PostgreSQL.
- Visual Studio
- Visual Studio extension development
- .NET framework that supports ADO.NET
- Modifies the ADO.NET C# Microsoft SQL Server application code to support PostgreSQL
- Extract inline queries
Install the vsix file to add this tool as extension to Visual Studio.
- Hover the C# component that require conversion. Select "Convert To Postgres".
- The tool displays the changes that it is going to apply to the existing C# code.
- Select the option again to apply the changes.
At present, the tool applies the below C# components:
- Class
- Method
- Property
- Constructor
- ADO.NET code
All ADO.NET SQLClient related components(SQLConnection
, SQLCommand
, SQLDataReader
, SQLDataAdapter
, SQLDataTypes
, SQLParameter
,
SQLException
) will be converted to corresponding PostgreSQL Npgsql components (NpgsqlConnection
, NpgsqlCommand
, NpgsqlDataReader
,
NpgsqlDataAdapter
, NpgsqlDataTypes
, NpgsqlParameters
, NpgsqlException
) using this extension.
Build and run the SQLServerToPostgresCodeRefactor.Vsix project. When the application asks for a solution to open, navigate to VsixTestProject folder and open the solution. The solution created only for testing the conversion. It may not build successfully. The SampleClass.cs has test code that can be used for testing the tool.
The tool is still in developing stage and enhancements and extensions are still in progress.
See CONTRIBUTING for more information.
This library is licensed under the MIT-0 License. See the LICENSE file.