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 535 2/5/2024
5.3.7 942 8/1/2023
5.3.6 1,058 8/1/2023
5.3.5 1,047 7/23/2023
5.3.4 935 7/20/2023
5.3.3 1,404 3/28/2023
5.3.2 1,067 2/20/2023
5.3.1 1,257 2/18/2023
5.3.0 1,088 2/11/2023
5.2.2 1,018 2/5/2023
5.2.1 1,192 2/5/2023
5.2.0 1,036 2/5/2023
5.1.2 1,056 1/16/2023
5.1.1 1,244 1/14/2023
5.1.0 1,107 1/14/2023
5.0.11 1,077 1/6/2023
5.0.10 1,118 1/6/2023
5.0.9 1,108 1/6/2023
5.0.8 1,120 1/6/2023
5.0.7 1,083 12/29/2022
5.0.6 946 12/29/2022
5.0.5 1,159 12/28/2022
5.0.4 1,088 12/28/2022
5.0.3 1,079 12/28/2022
5.0.2 1,087 12/27/2022
5.0.1 1,017 12/27/2022
5.0.0 918 12/25/2022
4.3.1 972 12/20/2022
4.3.0 1,045 12/15/2022
4.2.2 1,158 12/14/2022
4.2.1 910 12/13/2022
4.2.0 905 12/11/2022
4.1.5 1,168 12/11/2022
4.1.4 963 12/5/2022
4.1.3 975 12/4/2022
4.1.2 1,249 12/2/2022
4.1.1 968 12/2/2022
4.1.0 1,136 12/1/2022
4.0.0 1,114 11/30/2022
3.19.0 1,079 11/25/2022
3.18.4 1,161 10/20/2022
3.18.3 1,398 10/3/2022
3.18.2 1,183 10/3/2022
3.18.1 1,043 9/26/2022
3.18.0 1,149 9/20/2022
3.17.1 1,218 9/19/2022
3.17.0 1,016 9/18/2022
3.16.9 1,393 9/14/2022
3.16.8 1,109 9/12/2022
3.16.7 1,065 9/11/2022
3.16.6 982 9/9/2022
3.16.5 1,079 9/8/2022
3.16.4 1,186 9/8/2022
3.16.3 1,066 9/7/2022
3.16.2 1,041 9/5/2022
3.16.1 1,252 9/5/2022
3.16.0 1,101 9/5/2022
3.15.0 1,006 9/4/2022
3.14.3 1,191 9/2/2022
3.14.2 1,024 9/2/2022
3.14.1 1,151 9/2/2022
3.14.0 1,236 9/1/2022
3.13.0 1,188 8/31/2022
3.12.7 1,160 8/10/2022
3.12.6 1,206 8/10/2022
3.12.5 1,120 8/8/2022
3.12.4 1,112 8/8/2022
3.12.3 1,109 8/7/2022
3.12.2 1,135 8/7/2022
3.12.1 1,027 8/6/2022
3.12.0 1,021 8/6/2022
3.11.5 1,160 8/4/2022
3.11.4 1,145 8/3/2022
3.11.3 1,307 8/3/2022
3.11.2 1,076 8/1/2022
3.11.1 1,237 7/28/2022
3.11.0 1,061 7/28/2022
3.10.1 1,098 7/27/2022
3.10.0 1,158 7/27/2022
3.9.10 1,084 7/27/2022
3.9.9 1,177 7/24/2022
3.9.8 1,158 7/24/2022
3.9.7 1,077 7/23/2022
3.9.6 1,202 7/23/2022
3.9.5 1,220 7/13/2022
3.9.4 1,160 7/12/2022
3.9.3 989 7/11/2022
3.9.2 1,221 7/9/2022
3.9.1 1,215 7/6/2022
3.9.0 1,252 6/26/2022
3.8.0 1,190 6/2/2022
3.7.6 1,225 4/24/2022
3.7.5 1,271 4/13/2022
3.7.4 1,095 4/12/2022
3.7.3 1,241 4/12/2022
3.7.2 1,229 3/30/2022
3.7.1 1,126 2/20/2022
3.7.0 1,086 2/19/2022
3.6.3 1,240 1/10/2022
3.6.2 1,002 1/3/2022
3.6.1 853 12/15/2021
3.6.0 1,250 9/25/2021
3.5.7 1,201 6/30/2021
3.5.6 1,006 6/28/2021
3.5.5 1,190 6/9/2021
3.5.4 1,093 6/8/2021
3.5.3 1,154 5/21/2021
3.5.2 1,144 5/19/2021
3.5.1 1,053 5/18/2021
3.5.0 1,040 5/17/2021
3.4.1 1,135 5/4/2021
3.4.0 1,205 5/3/2021
3.3.13 1,246 5/2/2021
3.3.12 1,074 4/30/2021
3.3.11 1,160 4/23/2021
3.3.9 1,230 4/23/2021
3.3.8 1,282 4/23/2021
3.3.7 1,135 4/19/2021
3.3.6 1,328 4/19/2021
3.3.5 1,099 4/19/2021
3.3.4 1,106 4/19/2021
3.3.3 1,147 4/19/2021
3.3.2 1,017 4/19/2021
3.3.1 1,097 4/18/2021
3.3.0 1,200 4/17/2021
3.2.0 1,112 4/4/2021
3.1.16 1,143 3/27/2021
3.1.15 1,207 3/26/2021
3.1.14 1,130 3/22/2021
3.1.13 1,187 3/22/2021
3.1.12 1,085 3/21/2021
3.1.11 1,133 3/21/2021
3.1.10 1,157 3/21/2021
3.1.9 1,260 3/19/2021
3.1.8 1,259 3/18/2021
3.1.7 1,136 3/18/2021
3.1.6 1,428 3/18/2021
3.1.5 1,265 3/18/2021
3.1.4 1,227 3/18/2021
3.1.3 1,178 3/18/2021
3.1.2 1,393 3/18/2021
3.1.1 1,281 3/17/2021
3.1.0 1,395 3/15/2021
3.0.7 1,280 3/15/2021
3.0.6 1,314 3/8/2021
3.0.5 1,302 3/3/2021
3.0.4 1,304 2/23/2021
3.0.3 1,583 2/22/2021
3.0.2 1,315 2/19/2021
3.0.1 1,326 2/18/2021
3.0.0 1,428 2/18/2021
2.0.0 1,340 1/12/2021
1.4.1 1,502 11/27/2020
1.4.0 1,367 11/27/2020
1.3.3 1,217 11/25/2020
1.3.2 1,303 11/24/2020
1.3.1 1,427 11/24/2020
1.3.0 1,507 11/24/2020
1.2.0 1,435 11/19/2020
1.1.2 1,601 11/19/2020
1.1.1 1,577 11/19/2020
1.1.0 1,566 11/19/2020
1.0.0 1,685 6/14/2020