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 471 2/5/2024
5.3.7 917 8/1/2023
5.3.6 1,029 8/1/2023
5.3.5 1,015 7/23/2023
5.3.4 912 7/20/2023
5.3.3 1,370 3/28/2023
5.3.2 1,046 2/20/2023
5.3.1 1,240 2/18/2023
5.3.0 1,061 2/11/2023
5.2.2 994 2/5/2023
5.2.1 1,169 2/5/2023
5.2.0 1,028 2/5/2023
5.1.2 1,030 1/16/2023
5.1.1 1,224 1/14/2023
5.1.0 1,074 1/14/2023
5.0.11 1,043 1/6/2023
5.0.10 1,083 1/6/2023
5.0.9 1,088 1/6/2023
5.0.8 1,102 1/6/2023
5.0.7 1,061 12/29/2022
5.0.6 918 12/29/2022
5.0.5 1,133 12/28/2022
5.0.4 1,064 12/28/2022
5.0.3 1,059 12/28/2022
5.0.2 1,061 12/27/2022
5.0.1 994 12/27/2022
5.0.0 894 12/25/2022
4.3.1 951 12/20/2022
4.3.0 1,012 12/15/2022
4.2.2 1,136 12/14/2022
4.2.1 894 12/13/2022
4.2.0 879 12/11/2022
4.1.5 1,147 12/11/2022
4.1.4 932 12/5/2022
4.1.3 953 12/4/2022
4.1.2 1,226 12/2/2022
4.1.1 943 12/2/2022
4.1.0 1,110 12/1/2022
4.0.0 1,087 11/30/2022
3.19.0 1,061 11/25/2022
3.18.4 1,136 10/20/2022
3.18.3 1,366 10/3/2022
3.18.2 1,159 10/3/2022
3.18.1 1,005 9/26/2022
3.18.0 1,128 9/20/2022
3.17.1 1,191 9/19/2022
3.17.0 982 9/18/2022
3.16.9 1,361 9/14/2022
3.16.8 1,079 9/12/2022
3.16.7 1,041 9/11/2022
3.16.6 959 9/9/2022
3.16.5 1,051 9/8/2022
3.16.4 1,164 9/8/2022
3.16.3 1,043 9/7/2022
3.16.2 1,017 9/5/2022
3.16.1 1,237 9/5/2022
3.16.0 1,080 9/5/2022
3.15.0 984 9/4/2022
3.14.3 1,169 9/2/2022
3.14.2 1,004 9/2/2022
3.14.1 1,127 9/2/2022
3.14.0 1,210 9/1/2022
3.13.0 1,169 8/31/2022
3.12.7 1,131 8/10/2022
3.12.6 1,177 8/10/2022
3.12.5 1,105 8/8/2022
3.12.4 1,086 8/8/2022
3.12.3 1,084 8/7/2022
3.12.2 1,105 8/7/2022
3.12.1 1,007 8/6/2022
3.12.0 994 8/6/2022
3.11.5 1,133 8/4/2022
3.11.4 1,121 8/3/2022
3.11.3 1,285 8/3/2022
3.11.2 1,047 8/1/2022
3.11.1 1,213 7/28/2022
3.11.0 1,035 7/28/2022
3.10.1 1,077 7/27/2022
3.10.0 1,127 7/27/2022
3.9.10 1,066 7/27/2022
3.9.9 1,146 7/24/2022
3.9.8 1,131 7/24/2022
3.9.7 1,049 7/23/2022
3.9.6 1,174 7/23/2022
3.9.5 1,195 7/13/2022
3.9.4 1,142 7/12/2022
3.9.3 966 7/11/2022
3.9.2 1,196 7/9/2022
3.9.1 1,199 7/6/2022
3.9.0 1,228 6/26/2022
3.8.0 1,169 6/2/2022
3.7.6 1,202 4/24/2022
3.7.5 1,241 4/13/2022
3.7.4 1,076 4/12/2022
3.7.3 1,211 4/12/2022
3.7.2 1,209 3/30/2022
3.7.1 1,104 2/20/2022
3.7.0 1,069 2/19/2022
3.6.3 1,217 1/10/2022
3.6.2 975 1/3/2022
3.6.1 830 12/15/2021
3.6.0 1,225 9/25/2021
3.5.7 1,179 6/30/2021
3.5.6 981 6/28/2021
3.5.5 1,151 6/9/2021
3.5.4 1,073 6/8/2021
3.5.3 1,132 5/21/2021
3.5.2 1,120 5/19/2021
3.5.1 1,033 5/18/2021
3.5.0 1,023 5/17/2021
3.4.1 1,113 5/4/2021
3.4.0 1,179 5/3/2021
3.3.13 1,224 5/2/2021
3.3.12 1,049 4/30/2021
3.3.11 1,133 4/23/2021
3.3.9 1,205 4/23/2021
3.3.8 1,263 4/23/2021
3.3.7 1,117 4/19/2021
3.3.6 1,297 4/19/2021
3.3.5 1,069 4/19/2021
3.3.4 1,088 4/19/2021
3.3.3 1,105 4/19/2021
3.3.2 985 4/19/2021
3.3.1 1,080 4/18/2021
3.3.0 1,176 4/17/2021
3.2.0 1,085 4/4/2021
3.1.16 1,118 3/27/2021
3.1.15 1,181 3/26/2021
3.1.14 1,102 3/22/2021
3.1.13 1,148 3/22/2021
3.1.12 1,059 3/21/2021
3.1.11 1,111 3/21/2021
3.1.10 1,138 3/21/2021
3.1.9 1,238 3/19/2021
3.1.8 1,234 3/18/2021
3.1.7 1,116 3/18/2021
3.1.6 1,407 3/18/2021
3.1.5 1,250 3/18/2021
3.1.4 1,207 3/18/2021
3.1.3 1,154 3/18/2021
3.1.2 1,374 3/18/2021
3.1.1 1,251 3/17/2021
3.1.0 1,373 3/15/2021
3.0.7 1,252 3/15/2021
3.0.6 1,291 3/8/2021
3.0.5 1,282 3/3/2021
3.0.4 1,287 2/23/2021
3.0.3 1,559 2/22/2021
3.0.2 1,288 2/19/2021
3.0.1 1,303 2/18/2021
3.0.0 1,404 2/18/2021
2.0.0 1,314 1/12/2021
1.4.1 1,472 11/27/2020
1.4.0 1,344 11/27/2020
1.3.3 1,197 11/25/2020
1.3.2 1,280 11/24/2020
1.3.1 1,400 11/24/2020
1.3.0 1,481 11/24/2020
1.2.0 1,408 11/19/2020
1.1.2 1,579 11/19/2020
1.1.1 1,551 11/19/2020
1.1.0 1,545 11/19/2020
1.0.0 1,662 6/14/2020