SqlToSharp 1.0.0

dotnet tool install --global SqlToSharp --version 1.0.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local SqlToSharp --version 1.0.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=SqlToSharp&version=1.0.0
                    
nuke :add-package SqlToSharp --version 1.0.0
                    

This tool lets you generate the C# model classes from existing SQL Database.

Parameters

Following parameters are required in order to run the generator successfully:

  • --dbms Specifies the DBMS type, e.g. SqlServer, Postgres (Currently only SqlServer is supported)
  • --conn-string Specifies the target database connection string
  • --output-dir Path to the directory where the classes will be generated
  • --namespace Namespace under which the classes will be generated
  • --ignore Optional argument that gives option to ignore specific tables

Installation

Install as a NuGet global tool: dotnet tool install --global SqlToSharp

Usage

Tool can be started from the project or published and installed as the .NET Core Global Tool.

If the Global Tool is installed then the generator can be invoked by sql2sharp command together with required arguments.

Command example

sql2sharp \
    --dbms "SqlServer" \
    --conn-string "Data Source=.;Initial Catalog=SampleDB;Integrated Security=true" \
    --output-dir "./Output" \
    --namespace "Sample.DbModel"

If you want to start it from source, first clone this repository, position yourself inside ./Src folder and run following command

Command example

dotnet run \
    --dbms "SqlServer" \
    --conn-string "Data Source=.;Initial Catalog=SampleDB;Integrated Security=true" \
    --output-dir "./Output" \
    --namespace "Sample.DbModel"
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 is compatible.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.0.0 647 1/23/2022
0.0.1 850 10/17/2020