PetToys.DbAssistant.Postgres
1.0.1
Prefix Reserved
dotnet add package PetToys.DbAssistant.Postgres --version 1.0.1
NuGet\Install-Package PetToys.DbAssistant.Postgres -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PetToys.DbAssistant.Postgres" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PetToys.DbAssistant.Postgres --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: PetToys.DbAssistant.Postgres, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install PetToys.DbAssistant.Postgres as a Cake Addin #addin nuget:?package=PetToys.DbAssistant.Postgres&version=1.0.1 // Install PetToys.DbAssistant.Postgres as a Cake Tool #tool nuget:?package=PetToys.DbAssistant.Postgres&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Database Assistant (Postgres)
DbAssistant.Postgres is the open source .net library with nice wrappers for Ngsql.
Key features:
- High-performance insertion of large data into a table (
COPY table(column definitions) FROM STDIN BINARY;
feature)- Accepts
IEnumerable<TEntity>
andIAsyncEnumerable<TEntity>
- Supports mapping of entity properties to table columns (e.g.
MapJson
,MapMoney
,MapDateTime
, etc.) - For better performance, it is recommended to insert data into a temporary table that has no indexes or keys. After that, you can copy data from the temporary table to the target table.
- Accepts
Usage
using PetToys.DbAssistant.Postgres;
await using var connection = new NpgsqlConnection(connectionString);
var result = await connection.CreateBulkContext<BusinessEntity>("table_name")
.MapJson("column_json", entity => entity.Data)
.MapMoney("column_money", entity => entity.Money)
/* ... */
.InsertAsync(entities);
Roadmap:
- High-performance binary import/export between table and stream (coming soon)
- CSV import/export (may be)
- There may be something else
This package is created for my own needs. Requests for additional functionality and pull requests are welcome.
Provided under the Apache License, Version 2.0.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
stable release