Lyo.Comic.Postgres
1.0.2
See the version list below for details.
dotnet add package Lyo.Comic.Postgres --version 1.0.2
NuGet\Install-Package Lyo.Comic.Postgres -Version 1.0.2
<PackageReference Include="Lyo.Comic.Postgres" Version="1.0.2" />
<PackageVersion Include="Lyo.Comic.Postgres" Version="1.0.2" />
<PackageReference Include="Lyo.Comic.Postgres" />
paket add Lyo.Comic.Postgres --version 1.0.2
#r "nuget: Lyo.Comic.Postgres, 1.0.2"
#:package Lyo.Comic.Postgres@1.0.2
#addin nuget:?package=Lyo.Comic.Postgres&version=1.0.2
#tool nuget:?package=Lyo.Comic.Postgres&version=1.0.2
Lyo.Comic.Postgres
PostgreSQL + EF Core implementation of Lyo.Comic.IComicStore (PostgresComicStore) backed by ComicDbContext, PostgresComicOptions, and AddPostgresMigrations<ComicDbContext, PostgresComicOptions> so deployments can auto-upgrade schema similarly to other Lyo feature modules.
PostgresComicStore also implements Lyo.Health.IHealth so orchestrators can probe relational connectivity.
Schema & migrations
Entities under Database/ cover the full domain: SeriesEntity, AlternateTitleEntity, VolumeEntity, ChapterEntity, PageEntity, and CharacterEntity, each with an *EntityConfiguration (Fluent API mappings, indexes, and cascading deletes wired so removing a series prunes its volumes/chapters/pages/characters/alternate titles). Migrations live under Migrations/ (InitialCreate is the current baseline) and use the comic schema declared on PostgresComicOptions.Schema. Never hand-edit migrated columns in production — ship code-first migrations alongside API changes.
DI registration (Extensions)
All six entry points are exposed as IServiceCollection extensions in Lyo.Comic.Postgres.Extensions:
| Entry point | What it does |
|---|---|
AddComicDbContextFactory(Action<PostgresComicOptions>) |
Registers IOptions<PostgresComicOptions>, AddPostgresMigrations<ComicDbContext, PostgresComicOptions>(), and an IDbContextFactory<ComicDbContext> (UseNpgsql + migrations history under the configured schema). DbContext only — does not register IComicStore. |
AddComicDbContextFactoryFromConfiguration(IConfiguration, string sectionName = PostgresComicOptions.SectionName) |
Same as above; binds from the configuration section (default "PostgresComic"). |
AddComicDbContextFactory(PostgresComicOptions options) |
Same as above with a pre-built options instance. |
AddPostgresComicStore(Action<PostgresComicOptions>) |
Calls AddComicDbContextFactory(...) then registers IComicStore → singleton PostgresComicStore. |
AddPostgresComicStoreFromConfiguration(IConfiguration, string sectionName = PostgresComicOptions.SectionName) |
Same as above; binds from configuration. |
AddPostgresComicStore(PostgresComicOptions options) |
Same as above with a pre-built options instance — for tests / integration harnesses. |
PostgresComicOptions
| Member | Default | Notes |
|---|---|---|
ConnectionString |
empty | Required (validated by all entry points). |
EnableAutoMigrations |
false |
Consumed by AddPostgresMigrations<> to gate the hosted startup migration runner. |
SectionName (const) |
"PostgresComic" |
Default appsettings section for the FromConfiguration overloads. |
Schema (const) |
"comic" |
Used for the EF migrations history table and entity configurations. |
Runtime expectations
PostgresComicStore opens a fresh ComicDbContext per call via the registered IDbContextFactory<ComicDbContext>, so it is safe as a singleton under concurrent request load. Each Save*Async runs SaveChangesAsync inside the using-scope of that single context — callers that need cross-entity atomicity (for example saving a series together with its chapters) should orchestrate transactions above the store. When hosting under Lyo.Comic.Api (Lyo-Comic repo): - Mapper layers translate HTTP DTO ↔ domain records. - Enrichment pipelines may batch external metadata — ensure those respect transaction boundaries imposed by callers around Save*Async groupings.
See also
Lyo.Comic— domain contract reference.Lyo.Postgres— sharedAddPostgresMigrations<,>host helper leveraged here.Lyo.Health— health-probe abstraction implemented byPostgresComicStore.
Dependencies
Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).
Lyo.Comic— (direct, lyo)Lyo.Exceptions— (direct, lyo)Lyo.Health— (direct, lyo)Lyo.Postgres— (direct, lyo)Microsoft.EntityFrameworkCore10.0.5— (direct, microsoft)Microsoft.EntityFrameworkCore.Design10.0.5— (direct, microsoft)Microsoft.Extensions.Configuration.Binder10.0.5— (direct, microsoft)Lyo.Common— (transitive, lyo)Microsoft.EntityFrameworkCore.Relational10.0.5— (transitive, microsoft)Microsoft.Extensions.Hosting.Abstractions10.0.5— (transitive, microsoft)Microsoft.Extensions.Logging.Abstractions10.0.5— (transitive, microsoft)Microsoft.Extensions.Options10.0.5— (transitive, microsoft)Npgsql.EntityFrameworkCore.PostgreSQL10.0.3— (transitive, third-party)System.Memory4.6.3— (transitive, microsoft, netstandard2.0)System.Text.Json10.0.5— (transitive, microsoft, netstandard2.0)
| 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
- Lyo.Comic (>= 1.0.2)
- Lyo.Exceptions (>= 1.0.2)
- Lyo.Health (>= 1.0.2)
- Lyo.Postgres (>= 1.0.2)
- Microsoft.EntityFrameworkCore (>= 10.0.5)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.5)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Lyo.Comic.Postgres:
| Package | Downloads |
|---|---|
|
Lyo.Comic.Api
HTTP API surface for Lyo Comic: series, alternate titles, volumes, chapters, pages, and characters. |
GitHub repositories
This package is not used by any popular GitHub repositories.