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 | 541 | 2/5/2024 |
5.3.7 | 946 | 8/1/2023 |
5.3.6 | 1,062 | 8/1/2023 |
5.3.5 | 1,050 | 7/23/2023 |
5.3.4 | 944 | 7/20/2023 |
5.3.3 | 1,406 | 3/28/2023 |
5.3.2 | 1,073 | 2/20/2023 |
5.3.1 | 1,260 | 2/18/2023 |
5.3.0 | 1,092 | 2/11/2023 |
5.2.2 | 1,028 | 2/5/2023 |
5.2.1 | 1,196 | 2/5/2023 |
5.2.0 | 1,055 | 2/5/2023 |
5.1.2 | 1,060 | 1/16/2023 |
5.1.1 | 1,248 | 1/14/2023 |
5.1.0 | 1,108 | 1/14/2023 |
5.0.11 | 1,078 | 1/6/2023 |
5.0.10 | 1,122 | 1/6/2023 |
5.0.9 | 1,110 | 1/6/2023 |
5.0.8 | 1,139 | 1/6/2023 |
5.0.7 | 1,087 | 12/29/2022 |
5.0.6 | 949 | 12/29/2022 |
5.0.5 | 1,160 | 12/28/2022 |
5.0.4 | 1,089 | 12/28/2022 |
5.0.3 | 1,089 | 12/28/2022 |
5.0.2 | 1,089 | 12/27/2022 |
5.0.1 | 1,019 | 12/27/2022 |
5.0.0 | 920 | 12/25/2022 |
4.3.1 | 976 | 12/20/2022 |
4.3.0 | 1,048 | 12/15/2022 |
4.2.2 | 1,161 | 12/14/2022 |
4.2.1 | 913 | 12/13/2022 |
4.2.0 | 910 | 12/11/2022 |
4.1.5 | 1,170 | 12/11/2022 |
4.1.4 | 967 | 12/5/2022 |
4.1.3 | 978 | 12/4/2022 |
4.1.2 | 1,252 | 12/2/2022 |
4.1.1 | 972 | 12/2/2022 |
4.1.0 | 1,138 | 12/1/2022 |
4.0.0 | 1,116 | 11/30/2022 |
3.19.0 | 1,082 | 11/25/2022 |
3.18.4 | 1,170 | 10/20/2022 |
3.18.3 | 1,402 | 10/3/2022 |
3.18.2 | 1,191 | 10/3/2022 |
3.18.1 | 1,047 | 9/26/2022 |
3.18.0 | 1,158 | 9/20/2022 |
3.17.1 | 1,221 | 9/19/2022 |
3.17.0 | 1,019 | 9/18/2022 |
3.16.9 | 1,395 | 9/14/2022 |
3.16.8 | 1,111 | 9/12/2022 |
3.16.7 | 1,067 | 9/11/2022 |
3.16.6 | 985 | 9/9/2022 |
3.16.5 | 1,081 | 9/8/2022 |
3.16.4 | 1,189 | 9/8/2022 |
3.16.3 | 1,068 | 9/7/2022 |
3.16.2 | 1,043 | 9/5/2022 |
3.16.1 | 1,255 | 9/5/2022 |
3.16.0 | 1,104 | 9/5/2022 |
3.15.0 | 1,014 | 9/4/2022 |
3.14.3 | 1,194 | 9/2/2022 |
3.14.2 | 1,027 | 9/2/2022 |
3.14.1 | 1,153 | 9/2/2022 |
3.14.0 | 1,238 | 9/1/2022 |
3.13.0 | 1,191 | 8/31/2022 |
3.12.7 | 1,162 | 8/10/2022 |
3.12.6 | 1,208 | 8/10/2022 |
3.12.5 | 1,123 | 8/8/2022 |
3.12.4 | 1,114 | 8/8/2022 |
3.12.3 | 1,111 | 8/7/2022 |
3.12.2 | 1,137 | 8/7/2022 |
3.12.1 | 1,030 | 8/6/2022 |
3.12.0 | 1,024 | 8/6/2022 |
3.11.5 | 1,162 | 8/4/2022 |
3.11.4 | 1,147 | 8/3/2022 |
3.11.3 | 1,310 | 8/3/2022 |
3.11.2 | 1,079 | 8/1/2022 |
3.11.1 | 1,239 | 7/28/2022 |
3.11.0 | 1,063 | 7/28/2022 |
3.10.1 | 1,106 | 7/27/2022 |
3.10.0 | 1,160 | 7/27/2022 |
3.9.10 | 1,086 | 7/27/2022 |
3.9.9 | 1,179 | 7/24/2022 |
3.9.8 | 1,160 | 7/24/2022 |
3.9.7 | 1,079 | 7/23/2022 |
3.9.6 | 1,204 | 7/23/2022 |
3.9.5 | 1,222 | 7/13/2022 |
3.9.4 | 1,163 | 7/12/2022 |
3.9.3 | 991 | 7/11/2022 |
3.9.2 | 1,223 | 7/9/2022 |
3.9.1 | 1,218 | 7/6/2022 |
3.9.0 | 1,255 | 6/26/2022 |
3.8.0 | 1,194 | 6/2/2022 |
3.7.6 | 1,227 | 4/24/2022 |
3.7.5 | 1,274 | 4/13/2022 |
3.7.4 | 1,098 | 4/12/2022 |
3.7.3 | 1,243 | 4/12/2022 |
3.7.2 | 1,232 | 3/30/2022 |
3.7.1 | 1,128 | 2/20/2022 |
3.7.0 | 1,089 | 2/19/2022 |
3.6.3 | 1,242 | 1/10/2022 |
3.6.2 | 1,004 | 1/3/2022 |
3.6.1 | 856 | 12/15/2021 |
3.6.0 | 1,253 | 9/25/2021 |
3.5.7 | 1,203 | 6/30/2021 |
3.5.6 | 1,009 | 6/28/2021 |
3.5.5 | 1,192 | 6/9/2021 |
3.5.4 | 1,095 | 6/8/2021 |
3.5.3 | 1,163 | 5/21/2021 |
3.5.2 | 1,147 | 5/19/2021 |
3.5.1 | 1,055 | 5/18/2021 |
3.5.0 | 1,042 | 5/17/2021 |
3.4.1 | 1,137 | 5/4/2021 |
3.4.0 | 1,207 | 5/3/2021 |
3.3.13 | 1,249 | 5/2/2021 |
3.3.12 | 1,079 | 4/30/2021 |
3.3.11 | 1,163 | 4/23/2021 |
3.3.9 | 1,233 | 4/23/2021 |
3.3.8 | 1,291 | 4/23/2021 |
3.3.7 | 1,138 | 4/19/2021 |
3.3.6 | 1,330 | 4/19/2021 |
3.3.5 | 1,101 | 4/19/2021 |
3.3.4 | 1,114 | 4/19/2021 |
3.3.3 | 1,150 | 4/19/2021 |
3.3.2 | 1,020 | 4/19/2021 |
3.3.1 | 1,101 | 4/18/2021 |
3.3.0 | 1,202 | 4/17/2021 |
3.2.0 | 1,114 | 4/4/2021 |
3.1.16 | 1,152 | 3/27/2021 |
3.1.15 | 1,209 | 3/26/2021 |
3.1.14 | 1,132 | 3/22/2021 |
3.1.13 | 1,191 | 3/22/2021 |
3.1.12 | 1,087 | 3/21/2021 |
3.1.11 | 1,135 | 3/21/2021 |
3.1.10 | 1,161 | 3/21/2021 |
3.1.9 | 1,264 | 3/19/2021 |
3.1.8 | 1,261 | 3/18/2021 |
3.1.7 | 1,140 | 3/18/2021 |
3.1.6 | 1,430 | 3/18/2021 |
3.1.5 | 1,270 | 3/18/2021 |
3.1.4 | 1,230 | 3/18/2021 |
3.1.3 | 1,180 | 3/18/2021 |
3.1.2 | 1,397 | 3/18/2021 |
3.1.1 | 1,284 | 3/17/2021 |
3.1.0 | 1,398 | 3/15/2021 |
3.0.7 | 1,284 | 3/15/2021 |
3.0.6 | 1,316 | 3/8/2021 |
3.0.5 | 1,307 | 3/3/2021 |
3.0.4 | 1,309 | 2/23/2021 |
3.0.3 | 1,585 | 2/22/2021 |
3.0.2 | 1,317 | 2/19/2021 |
3.0.1 | 1,329 | 2/18/2021 |
3.0.0 | 1,431 | 2/18/2021 |
2.0.0 | 1,343 | 1/12/2021 |
1.4.1 | 1,504 | 11/27/2020 |
1.4.0 | 1,372 | 11/27/2020 |
1.3.3 | 1,219 | 11/25/2020 |
1.3.2 | 1,305 | 11/24/2020 |
1.3.1 | 1,432 | 11/24/2020 |
1.3.0 | 1,510 | 11/24/2020 |
1.2.0 | 1,443 | 11/19/2020 |
1.1.2 | 1,604 | 11/19/2020 |
1.1.1 | 1,579 | 11/19/2020 |
1.1.0 | 1,576 | 11/19/2020 |
1.0.0 | 1,696 | 6/14/2020 |