linq2db.cli
5.4.1
See the version list below for details.
dotnet tool install --global linq2db.cli --version 5.4.1
dotnet new tool-manifest # if you are setting up this repo dotnet tool install --local linq2db.cli --version 5.4.1
#tool dotnet:?package=linq2db.cli&version=5.4.1
nuke :add-package linq2db.cli --version 5.4.1
LINQ to DB CLI tools
NOTE: This is not a library you could reference from your project, but command line utility, installed using
dotnet tool
command (see installation notes).
See this page for more detailed help.
Installation
Requires .NET Core 3.1 or higher.
Install as global tool:
dotnet tool install -g linq2db.cli
Update:
dotnet tool update -g linq2db.cli
General information on .NET Tools could be found here
Use
To invoke tool use dotnet-linq2db <PARAMETERS>
or dotnet linq2db <PARAMETERS>
command.
Available commands:
dotnet linq2db help
: prints general helpdotnet linq2db help scaffold
: prints help forscaffold
commanddotnet linq2db scaffold <options>
: performs database model scaffoldingdotnet linq2db template [-o template_path]
: creates base T4 template file for scaffolding customization code
For list of available options, use dotnet linq2db help scaffold
command.
Usage Examples
Generate SQLite database model in current folder
This command uses minimal set of options, required for scaffolding (database provider and connection string) and generates database model classes in current folder.
dotnet linq2db scaffold -p SQLite -c "Data Source=c:\Databases\MyDatabase.sqlite"
Generate SQLite database model using response file
This command demonstrates use of configuration file with scaffold options combined with command line options.
dotnet linq2db scaffold -i database.json -c "Data Source=c:\Databases\MyDatabase.sqlite"
database.json file:
{
"general": {
"provider": "SQLite",
"connection": "Data Source=c:\\Databases\\TestDatabase.sqlite",
"output": "c:\\MyProject\\DbModel",
"overwrite": true
}
}
Here you can see that connection string passed using both command line and json
config file. In such cases option passed in command line takes precedence.
Scaffold configs (response files) are convenient in many ways:
- you can store scaffolding options for your project in source control and share with other developers
- with many options it is hard to work with command line
- some options not available from CLI or hard to use due to CLI nature (e.g. various issues with escaping of parameters)
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. 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 is compatible. 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 is compatible. 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. |
.NET Core | netcoreapp3.1 is compatible. |
This package has no dependencies.
Version | Downloads | Last updated |
---|---|---|
6.0.0-preview.1 | 77 | 6/17/2024 |
5.4.1 | 8,194 | 4/7/2024 |
5.4.0 | 4,018 | 2/20/2024 |
5.3.2 | 4,557 | 10/18/2023 |
5.3.1 | 438 | 10/16/2023 |
5.3.0 | 520 | 10/12/2023 |
5.2.2 | 4,429 | 6/8/2023 |
5.2.1 | 513 | 5/18/2023 |
5.2.0 | 717 | 5/4/2023 |
5.1.1 | 4,617 | 3/25/2023 |
5.1.0 | 844 | 3/16/2023 |
5.0.0 | 1,327 | 2/23/2023 |
5.0.0-rc.2 | 198 | 2/16/2023 |
5.0.0-rc.1 | 230 | 2/9/2023 |
5.0.0-preview.2 | 301 | 2/2/2023 |
5.0.0-preview.1 | 279 | 1/12/2023 |
4.4.1 | 3,835 | 2/2/2023 |
4.4.0 | 3,147 | 12/15/2022 |
4.3.0 | 1,225 | 10/1/2022 |
4.2.0 | 657 | 9/1/2022 |
4.1.1 | 967 | 7/7/2022 |
4.1.0 | 574 | 6/16/2022 |
4.0.1 | 653 | 5/27/2022 |
4.0.0 | 654 | 5/19/2022 |
4.0.0-rc.2 | 180 | 5/15/2022 |
4.0.0-rc.1 | 173 | 4/29/2022 |