dotnet-pgroutiner
1.0.0
See the version list below for details.
dotnet tool install --global dotnet-pgroutiner --version 1.0.0
dotnet new tool-manifest # if you are setting up this repo dotnet tool install --local dotnet-pgroutiner --version 1.0.0
#tool dotnet:?package=dotnet-pgroutiner&version=1.0.0
nuke :add-package dotnet-pgroutiner --version 1.0.0
PgRoutiner
.NET Core tool for easy scaffolding of your PostgreSQL server.
Make your .NET Core project to do a static type checking - on your PostgreSQL.
This tool will generate all the necessary source code files needed to make a simple execution of your PostgreSQL routines (functions or procedures):
Simple execution - or data retrieval - in C#, sync, or async.
All the necessary data-access code as connection object extension.
All related model classes (or Data Transfer Object) for data retrieval operations (function returning recordset or physical table returned from a function).
You can use this tool to enforce static type checking over PostgreSQL programable routines (functions or procedures) - in your .NET Core project.
Simply add the code generation command with this tool to your pre-build event.
Or, you can simply just generate the code you need with a simple command.
It will take care of things like:
PostgreSQL function overload for multiple versions.
PostgreSQL array types for complex input and output.
Serialization of results into class models faster than any standard mapping mechanism (like Dapper or EF) and without any caching. Thanks to the innovative mapping mechanism by position implemented in Norm.net data access.
Installation
.NET global tool install:
> dotnet tool install --global dotnet-pgroutiner
You will receive a message:
You can invoke the tool using the following command: PgRoutiner
Tool 'dotnet-pgroutiner' (version '1.0.0') was successfully installed.
Running
PgRoutiner
It is enough to just type PgRoutiner
(case-insensitive) and it will look for .NET Core project file (.csproj
) in the current directory - and start source file generation by using first available connection string in your configuration.
Or... you may supply additional configuration settings trough either:
- Custom JSON configuration settings section
PgRoutiner
. It is your standardappsettings.json
orappsettings.Development.json
from your project. For example, to configure the connection that will be used:
{
"PgRoutiner": {
"Connection": "MyConnection",
}
}
- Standard command-line interface, by supplying command-line arguments. Example from above, to configure the connection that will be used:
pgroutiner connection=MyConnection
The command-line settings if supplied - will always override JSON configuration settings.
Configuration
Name | Description | Default |
---|---|---|
Connection | Connection string name from your configuration connection string to be used. | First available connection string. |
Project | Relative path to project .csproj file. |
First available .csproj file from the current dir. |
OutputDir | Relative path where generated source files will be saved. | Current dir. |
ModelDir | Relative path where model classes source files will be saved. | Default value saves model classes in the same file as a related data-access code. |
Schema | PostgreSQL schema name used to search for routines. | public |
Overwrite | Should existing generated source file be overwritten (true) or skipped if they exist (false) | true |
Namespace | Root namespace for generated source files. | Project root namespace. |
NotSimilarTo | NOT SIMILAR TO SQL regular expression used to search routine names. |
Default skips this matching. |
SimilarTo | SIMILAR TO SQL regular expression used to search routine names. |
Default skips this matching. |
SourceHeader | Insert the following content to the start of each generated source code file. | // <auto-generated at timestamp /> |
SyncMethod | Generate a sync method, true or false. |
True. |
AsyncMethod | Generate a async method, true or false. |
True. |
Mapping * | Key-values to override default type mapping. Key is PostgreSQL UDT type name and value is the corresponding C# type name. | See default mapping here |
- Key-values are JSON object in JSON configuration. For command-line, use following format:
pgroutiner mapping:Key=Value
Examples
...
Required dependencies for project
- Npgsql
- Norm.net >= 15.1.
- System.Linq.Async (only for async operations)
Currently supported platforms
- .NET Core 3.0
- .NET Core 3.1
Support
This is open-source software developed and maintained freely without any compensation whatsoever.
If you find it useful please consider rewarding me on my effort by buying me a beer🍻 or buying me a pizza🍕
Or if you prefer bitcoin: bitcoincash:qp93skpzyxtvw3l3lqqy7egwv8zrszn3wcfygeg0mv
Licence
Copyright (c) Vedran Bilopavlović - VB Consulting and VB Software 2020 This source code is licensed under the MIT license.
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. |
.NET Core | netcoreapp3.1 is compatible. |
This package has no dependencies.
Version | Downloads | Last updated |
---|---|---|
5.4.0 | 542 | 2/5/2024 |
5.3.7 | 947 | 8/1/2023 |
5.3.6 | 1,063 | 8/1/2023 |
5.3.5 | 1,051 | 7/23/2023 |
5.3.4 | 945 | 7/20/2023 |
5.3.3 | 1,407 | 3/28/2023 |
5.3.2 | 1,074 | 2/20/2023 |
5.3.1 | 1,261 | 2/18/2023 |
5.3.0 | 1,093 | 2/11/2023 |
5.2.2 | 1,029 | 2/5/2023 |
5.2.1 | 1,197 | 2/5/2023 |
5.2.0 | 1,058 | 2/5/2023 |
5.1.2 | 1,061 | 1/16/2023 |
5.1.1 | 1,249 | 1/14/2023 |
5.1.0 | 1,111 | 1/14/2023 |
5.0.11 | 1,079 | 1/6/2023 |
5.0.10 | 1,123 | 1/6/2023 |
5.0.9 | 1,111 | 1/6/2023 |
5.0.8 | 1,140 | 1/6/2023 |
5.0.7 | 1,088 | 12/29/2022 |
5.0.6 | 950 | 12/29/2022 |
5.0.5 | 1,163 | 12/28/2022 |
5.0.4 | 1,090 | 12/28/2022 |
5.0.3 | 1,090 | 12/28/2022 |
5.0.2 | 1,092 | 12/27/2022 |
5.0.1 | 1,022 | 12/27/2022 |
5.0.0 | 921 | 12/25/2022 |
4.3.1 | 977 | 12/20/2022 |
4.3.0 | 1,049 | 12/15/2022 |
4.2.2 | 1,164 | 12/14/2022 |
4.2.1 | 916 | 12/13/2022 |
4.2.0 | 911 | 12/11/2022 |
4.1.5 | 1,171 | 12/11/2022 |
4.1.4 | 968 | 12/5/2022 |
4.1.3 | 981 | 12/4/2022 |
4.1.2 | 1,253 | 12/2/2022 |
4.1.1 | 973 | 12/2/2022 |
4.1.0 | 1,139 | 12/1/2022 |
4.0.0 | 1,117 | 11/30/2022 |
3.19.0 | 1,083 | 11/25/2022 |
3.18.4 | 1,171 | 10/20/2022 |
3.18.3 | 1,403 | 10/3/2022 |
3.18.2 | 1,192 | 10/3/2022 |
3.18.1 | 1,048 | 9/26/2022 |
3.18.0 | 1,159 | 9/20/2022 |
3.17.1 | 1,222 | 9/19/2022 |
3.17.0 | 1,020 | 9/18/2022 |
3.16.9 | 1,396 | 9/14/2022 |
3.16.8 | 1,112 | 9/12/2022 |
3.16.7 | 1,068 | 9/11/2022 |
3.16.6 | 986 | 9/9/2022 |
3.16.5 | 1,082 | 9/8/2022 |
3.16.4 | 1,190 | 9/8/2022 |
3.16.3 | 1,069 | 9/7/2022 |
3.16.2 | 1,044 | 9/5/2022 |
3.16.1 | 1,256 | 9/5/2022 |
3.16.0 | 1,105 | 9/5/2022 |
3.15.0 | 1,015 | 9/4/2022 |
3.14.3 | 1,195 | 9/2/2022 |
3.14.2 | 1,028 | 9/2/2022 |
3.14.1 | 1,154 | 9/2/2022 |
3.14.0 | 1,239 | 9/1/2022 |
3.13.0 | 1,192 | 8/31/2022 |
3.12.7 | 1,163 | 8/10/2022 |
3.12.6 | 1,209 | 8/10/2022 |
3.12.5 | 1,124 | 8/8/2022 |
3.12.4 | 1,115 | 8/8/2022 |
3.12.3 | 1,112 | 8/7/2022 |
3.12.2 | 1,138 | 8/7/2022 |
3.12.1 | 1,031 | 8/6/2022 |
3.12.0 | 1,025 | 8/6/2022 |
3.11.5 | 1,163 | 8/4/2022 |
3.11.4 | 1,148 | 8/3/2022 |
3.11.3 | 1,311 | 8/3/2022 |
3.11.2 | 1,080 | 8/1/2022 |
3.11.1 | 1,240 | 7/28/2022 |
3.11.0 | 1,064 | 7/28/2022 |
3.10.1 | 1,107 | 7/27/2022 |
3.10.0 | 1,161 | 7/27/2022 |
3.9.10 | 1,087 | 7/27/2022 |
3.9.9 | 1,180 | 7/24/2022 |
3.9.8 | 1,161 | 7/24/2022 |
3.9.7 | 1,080 | 7/23/2022 |
3.9.6 | 1,205 | 7/23/2022 |
3.9.5 | 1,223 | 7/13/2022 |
3.9.4 | 1,164 | 7/12/2022 |
3.9.3 | 992 | 7/11/2022 |
3.9.2 | 1,224 | 7/9/2022 |
3.9.1 | 1,219 | 7/6/2022 |
3.9.0 | 1,256 | 6/26/2022 |
3.8.0 | 1,195 | 6/2/2022 |
3.7.6 | 1,228 | 4/24/2022 |
3.7.5 | 1,275 | 4/13/2022 |
3.7.4 | 1,099 | 4/12/2022 |
3.7.3 | 1,244 | 4/12/2022 |
3.7.2 | 1,233 | 3/30/2022 |
3.7.1 | 1,129 | 2/20/2022 |
3.7.0 | 1,090 | 2/19/2022 |
3.6.3 | 1,243 | 1/10/2022 |
3.6.2 | 1,005 | 1/3/2022 |
3.6.1 | 857 | 12/15/2021 |
3.6.0 | 1,254 | 9/25/2021 |
3.5.7 | 1,204 | 6/30/2021 |
3.5.6 | 1,010 | 6/28/2021 |
3.5.5 | 1,193 | 6/9/2021 |
3.5.4 | 1,096 | 6/8/2021 |
3.5.3 | 1,164 | 5/21/2021 |
3.5.2 | 1,148 | 5/19/2021 |
3.5.1 | 1,056 | 5/18/2021 |
3.5.0 | 1,043 | 5/17/2021 |
3.4.1 | 1,138 | 5/4/2021 |
3.4.0 | 1,208 | 5/3/2021 |
3.3.13 | 1,250 | 5/2/2021 |
3.3.12 | 1,080 | 4/30/2021 |
3.3.11 | 1,164 | 4/23/2021 |
3.3.9 | 1,234 | 4/23/2021 |
3.3.8 | 1,292 | 4/23/2021 |
3.3.7 | 1,139 | 4/19/2021 |
3.3.6 | 1,331 | 4/19/2021 |
3.3.5 | 1,102 | 4/19/2021 |
3.3.4 | 1,115 | 4/19/2021 |
3.3.3 | 1,151 | 4/19/2021 |
3.3.2 | 1,023 | 4/19/2021 |
3.3.1 | 1,102 | 4/18/2021 |
3.3.0 | 1,203 | 4/17/2021 |
3.2.0 | 1,115 | 4/4/2021 |
3.1.16 | 1,153 | 3/27/2021 |
3.1.15 | 1,210 | 3/26/2021 |
3.1.14 | 1,133 | 3/22/2021 |
3.1.13 | 1,192 | 3/22/2021 |
3.1.12 | 1,088 | 3/21/2021 |
3.1.11 | 1,136 | 3/21/2021 |
3.1.10 | 1,162 | 3/21/2021 |
3.1.9 | 1,265 | 3/19/2021 |
3.1.8 | 1,262 | 3/18/2021 |
3.1.7 | 1,141 | 3/18/2021 |
3.1.6 | 1,433 | 3/18/2021 |
3.1.5 | 1,271 | 3/18/2021 |
3.1.4 | 1,231 | 3/18/2021 |
3.1.3 | 1,181 | 3/18/2021 |
3.1.2 | 1,398 | 3/18/2021 |
3.1.1 | 1,285 | 3/17/2021 |
3.1.0 | 1,401 | 3/15/2021 |
3.0.7 | 1,285 | 3/15/2021 |
3.0.6 | 1,317 | 3/8/2021 |
3.0.5 | 1,308 | 3/3/2021 |
3.0.4 | 1,310 | 2/23/2021 |
3.0.3 | 1,586 | 2/22/2021 |
3.0.2 | 1,318 | 2/19/2021 |
3.0.1 | 1,330 | 2/18/2021 |
3.0.0 | 1,432 | 2/18/2021 |
2.0.0 | 1,344 | 1/12/2021 |
1.4.1 | 1,505 | 11/27/2020 |
1.4.0 | 1,373 | 11/27/2020 |
1.3.3 | 1,220 | 11/25/2020 |
1.3.2 | 1,306 | 11/24/2020 |
1.3.1 | 1,433 | 11/24/2020 |
1.3.0 | 1,511 | 11/24/2020 |
1.2.0 | 1,444 | 11/19/2020 |
1.1.2 | 1,605 | 11/19/2020 |
1.1.1 | 1,580 | 11/19/2020 |
1.1.0 | 1,577 | 11/19/2020 |
1.0.0 | 1,697 | 6/14/2020 |