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
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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
nuke :add-package SqlToSharp --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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:
--dbmsSpecifies the DBMS type, e.g. SqlServer, Postgres (Currently only SqlServer is supported)--conn-stringSpecifies the target database connection string--output-dirPath to the directory where the classes will be generated--namespaceNamespace under which the classes will be generated--ignoreOptional 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 | Versions 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.