Naravel.Database.Postgres
0.2.0
dotnet add package Naravel.Database.Postgres --version 0.2.0
NuGet\Install-Package Naravel.Database.Postgres -Version 0.2.0
<PackageReference Include="Naravel.Database.Postgres" Version="0.2.0" />
<PackageVersion Include="Naravel.Database.Postgres" Version="0.2.0" />
<PackageReference Include="Naravel.Database.Postgres" />
paket add Naravel.Database.Postgres --version 0.2.0
#r "nuget: Naravel.Database.Postgres, 0.2.0"
#:package Naravel.Database.Postgres@0.2.0
#addin nuget:?package=Naravel.Database.Postgres&version=0.2.0
#tool nuget:?package=Naravel.Database.Postgres&version=0.2.0
Naravel.Database.Postgres
PostgreSQL driver for Naravel.Database, built on Npgsql.
| Fact | Detail |
|---|---|
| Install | dotnet add package Naravel.Database.Postgres |
| Targets | .NET 10 |
| Needs | Naravel.Database, which NuGet installs with it |
| Driver | pgsql, not postgres |
What you get
- A named connection per server. Every connection whose
Driverispgsqltakes its ownConnectionString, so one application can use several PostgreSQL databases. - Npgsql's own pooling. Each connection holds one
NpgsqlDataSource, Npgsql's recommended entry point, created without touching the network and disposed with the driver. - The whole query builder. Fluent queries, raw SQL and transactions from
Naravel.Database, written in PostgreSQL's dialect. - PostgreSQL's own SQL.
UpsertAsyncwriteson conflict (uniqueBy), which needs a unique index on those columns, and*ReturningAsyncwritesreturning.
Quick start
{ "Database": { "Default": "main", "Connections": {
"main": { "Driver": "pgsql", "ConnectionString": "Host=localhost;Port=5432;Database=app;Username=app" } } } }
builder.Services.AddNaravelDatabase(builder.Configuration); // from Naravel.Database; the order of the two calls does not matter
builder.Services.AddNaravelPostgresDatabase(builder.Configuration);
ConnectionString is required: without it the first use fails with an InvalidOperationException that names the key. Keep the password out of the file, for example in user secrets or the variable Database__Connections__main__ConnectionString. PostgreSQL refuses a Having on a select alias.
Related packages
| Package | Adds |
|---|---|
Naravel.Database |
The query builder and named connections that this driver plugs into |
Naravel.Database.EntityFrameworkCore |
A DbContext and the query builder share one connection and one transaction |
Learn more
- Database: English guide
- Database dialect differences: English guide
- Changelog · Source and issues · MIT license
Part of Naravel: Laravel's names, .NET's type system. All Naravel packages share one version.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Naravel.Database (>= 0.2.0)
- Npgsql (>= 10.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Release notes: https://github.com/km-arc/Naravel/releases/tag/v0.2.0 - full history: https://github.com/km-arc/Naravel/blob/main/CHANGELOG.md