Dapper.Postgres
0.0.6
dotnet add package Dapper.Postgres --version 0.0.6
NuGet\Install-Package Dapper.Postgres -Version 0.0.6
<PackageReference Include="Dapper.Postgres" Version="0.0.6" />
<PackageVersion Include="Dapper.Postgres" Version="0.0.6" />
<PackageReference Include="Dapper.Postgres" />
paket add Dapper.Postgres --version 0.0.6
#r "nuget: Dapper.Postgres, 0.0.6"
#:package Dapper.Postgres@0.0.6
#addin nuget:?package=Dapper.Postgres&version=0.0.6
#tool nuget:?package=Dapper.Postgres&version=0.0.6
Dapper.Postgres
An extension of NpgsqlConnection and Dapper to allow for easier use of Postgres functions.
Why?
If you aren't a fan of writing parameterized queries and would rather have your logic in functions in your database then this Dapper extension should benefit you.
What does it do?
Dapper.Postgres writes the parameterized query on the function for you so you don't have to write the statements yourself. It simply extends the functionality of DynamicParameters with a slightly different implementation to allow for use with functions.
Methods
QueryFunction<T>
QueryFunctionFirst<T>
ExecuteFunction<T>
QueryFunctionOrDefault<T>
QueryFunctionOrDefaultAsync<T>
QueryFunctionAsync<T>
QueryFunctionFirstAsync<T>
ExecuteFunctionAsync<T>
Examples
using Dapper;
using Dapper.Postgres;
string connectionString = "Host=localhost;Port=5432;Username=postgres;Password=admin;Database=test;";
using NpgsqlConnection connection = new NpgsqlConnection(connectionString);
var parameters = new DynamicFunctionParameters(new User("ieedan"));
Guid? userId = await connection.ExecuteFunctionAsync<Guid>("add_user", parameters);
Console.WriteLine(userId?.ToString());
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.