dotnet-pgroutiner 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global dotnet-pgroutiner --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 dotnet-pgroutiner --version 1.0.0                
This package contains a .NET tool you can call from the shell/command line.
#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:

  1. Custom JSON configuration settings section PgRoutiner. It is your standard appsettings.json or appsettings.Development.json from your project. For example, to configure the connection that will be used:
{
  "PgRoutiner": {
    "Connection": "MyConnection",
  }
}
  1. 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

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 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. 
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
5.4.0 544 2/5/2024
5.3.7 949 8/1/2023
5.3.6 1,065 8/1/2023
5.3.5 1,053 7/23/2023
5.3.4 947 7/20/2023
5.3.3 1,409 3/28/2023
5.3.2 1,076 2/20/2023
5.3.1 1,265 2/18/2023
5.3.0 1,095 2/11/2023
5.2.2 1,031 2/5/2023
5.2.1 1,199 2/5/2023
5.2.0 1,060 2/5/2023
5.1.2 1,063 1/16/2023
5.1.1 1,251 1/14/2023
5.1.0 1,113 1/14/2023
5.0.11 1,081 1/6/2023
5.0.10 1,125 1/6/2023
5.0.9 1,113 1/6/2023
5.0.8 1,142 1/6/2023
5.0.7 1,090 12/29/2022
5.0.6 952 12/29/2022
5.0.5 1,165 12/28/2022
5.0.4 1,092 12/28/2022
5.0.3 1,092 12/28/2022
5.0.2 1,094 12/27/2022
5.0.1 1,024 12/27/2022
5.0.0 925 12/25/2022
4.3.1 979 12/20/2022
4.3.0 1,051 12/15/2022
4.2.2 1,166 12/14/2022
4.2.1 918 12/13/2022
4.2.0 913 12/11/2022
4.1.5 1,173 12/11/2022
4.1.4 970 12/5/2022
4.1.3 983 12/4/2022
4.1.2 1,255 12/2/2022
4.1.1 975 12/2/2022
4.1.0 1,141 12/1/2022
4.0.0 1,119 11/30/2022
3.19.0 1,085 11/25/2022
3.18.4 1,173 10/20/2022
3.18.3 1,405 10/3/2022
3.18.2 1,194 10/3/2022
3.18.1 1,050 9/26/2022
3.18.0 1,161 9/20/2022
3.17.1 1,224 9/19/2022
3.17.0 1,022 9/18/2022
3.16.9 1,398 9/14/2022
3.16.8 1,114 9/12/2022
3.16.7 1,070 9/11/2022
3.16.6 988 9/9/2022
3.16.5 1,084 9/8/2022
3.16.4 1,192 9/8/2022
3.16.3 1,071 9/7/2022
3.16.2 1,046 9/5/2022
3.16.1 1,258 9/5/2022
3.16.0 1,107 9/5/2022
3.15.0 1,017 9/4/2022
3.14.3 1,197 9/2/2022
3.14.2 1,030 9/2/2022
3.14.1 1,156 9/2/2022
3.14.0 1,241 9/1/2022
3.13.0 1,194 8/31/2022
3.12.7 1,165 8/10/2022
3.12.6 1,211 8/10/2022
3.12.5 1,126 8/8/2022
3.12.4 1,117 8/8/2022
3.12.3 1,114 8/7/2022
3.12.2 1,140 8/7/2022
3.12.1 1,033 8/6/2022
3.12.0 1,027 8/6/2022
3.11.5 1,165 8/4/2022
3.11.4 1,150 8/3/2022
3.11.3 1,313 8/3/2022
3.11.2 1,082 8/1/2022
3.11.1 1,242 7/28/2022
3.11.0 1,066 7/28/2022
3.10.1 1,109 7/27/2022
3.10.0 1,163 7/27/2022
3.9.10 1,089 7/27/2022
3.9.9 1,182 7/24/2022
3.9.8 1,163 7/24/2022
3.9.7 1,082 7/23/2022
3.9.6 1,207 7/23/2022
3.9.5 1,225 7/13/2022
3.9.4 1,166 7/12/2022
3.9.3 994 7/11/2022
3.9.2 1,226 7/9/2022
3.9.1 1,221 7/6/2022
3.9.0 1,258 6/26/2022
3.8.0 1,197 6/2/2022
3.7.6 1,230 4/24/2022
3.7.5 1,277 4/13/2022
3.7.4 1,101 4/12/2022
3.7.3 1,246 4/12/2022
3.7.2 1,235 3/30/2022
3.7.1 1,131 2/20/2022
3.7.0 1,092 2/19/2022
3.6.3 1,245 1/10/2022
3.6.2 1,007 1/3/2022
3.6.1 859 12/15/2021
3.6.0 1,256 9/25/2021
3.5.7 1,206 6/30/2021
3.5.6 1,012 6/28/2021
3.5.5 1,195 6/9/2021
3.5.4 1,098 6/8/2021
3.5.3 1,166 5/21/2021
3.5.2 1,150 5/19/2021
3.5.1 1,058 5/18/2021
3.5.0 1,045 5/17/2021
3.4.1 1,140 5/4/2021
3.4.0 1,210 5/3/2021
3.3.13 1,252 5/2/2021
3.3.12 1,082 4/30/2021
3.3.11 1,166 4/23/2021
3.3.9 1,236 4/23/2021
3.3.8 1,294 4/23/2021
3.3.7 1,141 4/19/2021
3.3.6 1,333 4/19/2021
3.3.5 1,104 4/19/2021
3.3.4 1,117 4/19/2021
3.3.3 1,153 4/19/2021
3.3.2 1,025 4/19/2021
3.3.1 1,104 4/18/2021
3.3.0 1,205 4/17/2021
3.2.0 1,117 4/4/2021
3.1.16 1,155 3/27/2021
3.1.15 1,212 3/26/2021
3.1.14 1,135 3/22/2021
3.1.13 1,194 3/22/2021
3.1.12 1,090 3/21/2021
3.1.11 1,138 3/21/2021
3.1.10 1,164 3/21/2021
3.1.9 1,267 3/19/2021
3.1.8 1,264 3/18/2021
3.1.7 1,143 3/18/2021
3.1.6 1,435 3/18/2021
3.1.5 1,273 3/18/2021
3.1.4 1,233 3/18/2021
3.1.3 1,183 3/18/2021
3.1.2 1,400 3/18/2021
3.1.1 1,287 3/17/2021
3.1.0 1,403 3/15/2021
3.0.7 1,287 3/15/2021
3.0.6 1,319 3/8/2021
3.0.5 1,310 3/3/2021
3.0.4 1,312 2/23/2021
3.0.3 1,588 2/22/2021
3.0.2 1,320 2/19/2021
3.0.1 1,332 2/18/2021
3.0.0 1,434 2/18/2021
2.0.0 1,346 1/12/2021
1.4.1 1,507 11/27/2020
1.4.0 1,375 11/27/2020
1.3.3 1,222 11/25/2020
1.3.2 1,308 11/24/2020
1.3.1 1,435 11/24/2020
1.3.0 1,513 11/24/2020
1.2.0 1,446 11/19/2020
1.1.2 1,607 11/19/2020
1.1.1 1,582 11/19/2020
1.1.0 1,579 11/19/2020
1.0.0 1,699 6/14/2020