Lyo.FileMetadataStore.Postgres
2.0.0
dotnet add package Lyo.FileMetadataStore.Postgres --version 2.0.0
NuGet\Install-Package Lyo.FileMetadataStore.Postgres -Version 2.0.0
<PackageReference Include="Lyo.FileMetadataStore.Postgres" Version="2.0.0" />
<PackageVersion Include="Lyo.FileMetadataStore.Postgres" Version="2.0.0" />
<PackageReference Include="Lyo.FileMetadataStore.Postgres" />
paket add Lyo.FileMetadataStore.Postgres --version 2.0.0
#r "nuget: Lyo.FileMetadataStore.Postgres, 2.0.0"
#:package Lyo.FileMetadataStore.Postgres@2.0.0
#addin nuget:?package=Lyo.FileMetadataStore.Postgres&version=2.0.0
#tool nuget:?package=Lyo.FileMetadataStore.Postgres&version=2.0.0
Lyo.FileMetadataStore.Postgres
OLTP IFileMetadataStore plus adjunct services richer file pipelines use.
PostgresFileMetadataStore
Transactional CRUD for canonical metadata rows. SaveMetadataAsync upserts. FindByHashAsync uses indexed digest columns. Check those migration indices before huge imports. FindByKeyIdAndVersion drives rotation reporting. Rows support logical delete via nullable deleted_at. GetMetadataAsync, duplicate hash lookup, and key-rotation enumeration ignore tombstoned rows. Physical blob lifecycle stays with Lyo.FileStorage.
Register as scoped so each ASP.NET HTTP request gets its own FileMetadataStoreDbContext. Do not share a context across requests.
Auxiliary stores
Implementations packaged here also cover:
| Type | Implements | Purpose | |-------------------------------------------|------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | PostgresFileAuditSink | IFileAuditEventHandler | Writes immutable audit timelines for uploads/downloads/deletes surfaced by Lyo.FileStorage. | | PostgresMultipartUploadSessionStore | IMultipartUploadSessionStore | Tracks staged multipart uploads (part manifests, TTL cleanup policies). | | PostgresFileDownloadAccessService | IFileDownloadAccessService | Issues and consumes opaque, time-boxed download tokens. Used by hosts that wrap presigned reads with their own access audit (CreateFileDownloadAccessLinkRequest / ConsumeFileDownloadAccessLinkResult). |
Health
PostgresFileMetadataStore implements Lyo.Health.IHealth (HealthCheckName = "PostgresFileMetadataStore"): a SELECT 1-style probe via the EF Core context. Reports connection issues without scanning rows.
Options. PostgresFileMetadataStoreOptions
SectionName(PostgresFileMetadataStore). Default appsettings section. -Schema(filemetadata). Postgres schema.__EFMigrationsHistoryis rooted here. -ConnectionString. Required. -EnableAutoMigrations(viaIPostgresMigrationConfig). When true,AddPostgresMigrations<FileMetadataStoreDbContext, PostgresFileMetadataStoreOptions>()runs migrations at host start through Lyo.Postgres.
DI. Extensions
| Extension | Purpose | |-------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | AddFileMetadataStoreDbContext(connectionString) | Register the FileMetadataStoreDbContext only (no store). | | AddFileMetadataStoreDbContextFactory(Action<PostgresFileMetadataStoreOptions>) / (PostgresFileMetadataStoreOptions) | Register only the EF DbContext factory + auto-migrations through Lyo.Postgres. | | AddFileMetadataStoreDbContextFactoryFromConfiguration(configuration, sectionName) | Same, but bound from a configuration section. | | AddPostgresFileMetadataStore() / (Action<DbContextOptionsBuilder>) / (connectionString) | Register PostgresFileMetadataStore + IFileMetadataStore (scoped). | | AddPostgresFileMetadataStoreKeyed(keyName, Action<DbContextOptionsBuilder>) / (keyName, connectionString) | Keyed registration. Both PostgresFileMetadataStore and IFileMetadataStore are exposed under keyName. | | AddPostgresFileMetadataStoreKeyed(keyName) | Returns a PostgresFileMetadataStoreBuilder (ConfigurePostgresFileStore, Build()) that merges configuration sections + programmatic overrides. Used by gateways hosting per-tenant metadata silos. | | AddPostgresFileAuditSink() | Adds PostgresFileAuditSink as scoped IFileAuditEventHandler. | | AddPostgresMultipartUploadSessionStore() | Adds the Postgres IMultipartUploadSessionStore. Builder usually does this for you when no session store is registered yet. | | AddPostgresFileDownloadAccessService() | Adds PostgresFileDownloadAccessService and IFileDownloadAccessService. |
Logs via ILogger<PostgresFileMetadataStore> at Debug and Warning.
Failure handling
Maps Postgres unique violations (23505) into predictable outcomes where possible (duplicate hash insert collisions). Inspect catch scopes before mapping to 409 Conflict externally.
Migrations / schema coupling
Changing column layout needs coordinated releases with Lyo.FileStorage expectations. Serialized JSON blobs should grow additively.
See also
Dependencies
Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).
Lyo.Configuration(direct, lyo)Lyo.Exceptions(direct, lyo)Lyo.FileMetadataStore(direct, lyo)Lyo.FileStorage(direct, lyo)Lyo.Health(direct, lyo)Lyo.Lock(direct, lyo)Lyo.Postgres(direct, lyo)Microsoft.EntityFrameworkCore10.0.5(direct, microsoft)Microsoft.EntityFrameworkCore.Design10.0.5(direct, microsoft)Lyo.Common.Core(transitive, lyo)Lyo.Common.Metadata(transitive, lyo)Lyo.Compression(transitive, lyo)Lyo.Encryption(transitive, lyo)Lyo.Hashing(transitive, lyo)Lyo.IO.Temp(transitive, lyo)Lyo.KeyStore(transitive, lyo)Lyo.Metrics(transitive, lyo)Lyo.Result(transitive, lyo)Lyo.Streams(transitive, lyo)BouncyCastle.Cryptography2.6.2(transitive, third-party, netstandard2.0)EasyCompressor2.1.0(transitive, third-party)Konscious.Security.Cryptography.Argon21.3.1(transitive, third-party)Microsoft.Bcl.AsyncInterfaces10.0.5(transitive, microsoft, netstandard2.0)Microsoft.EntityFrameworkCore.Relational10.0.5(transitive, microsoft)Microsoft.Extensions.Configuration.Binder10.0.5(transitive, microsoft)Microsoft.Extensions.DependencyInjection.Abstractions10.0.5(transitive, microsoft, net10.0, netstandard2.0)Microsoft.Extensions.Hosting.Abstractions10.0.5(transitive, microsoft)Microsoft.Extensions.Logging.Abstractions10.0.5(transitive, microsoft)Microsoft.Extensions.Options10.0.5(transitive, microsoft)Microsoft.Extensions.Options.ConfigurationExtensions10.0.5(transitive, microsoft)Microsoft.Extensions.Options.DataAnnotations10.0.5(transitive, microsoft)Npgsql.EntityFrameworkCore.PostgreSQL10.0.3(transitive, third-party)System.Buffers4.6.1(transitive, microsoft, netstandard2.0)System.IO.Hashing10.0.5(transitive, microsoft, net10.0)System.Memory4.6.3(transitive, microsoft, netstandard2.0)System.Text.Json10.0.5(transitive, microsoft, netstandard2.0)System.Threading.Tasks.Extensions4.6.3(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.Configuration (>= 2.0.0)
- Lyo.Exceptions (>= 2.0.0)
- Lyo.FileMetadataStore (>= 2.0.0)
- Lyo.FileStorage (>= 2.0.0)
- Lyo.Health (>= 2.0.0)
- Lyo.Lock (>= 2.0.0)
- Lyo.Postgres (>= 2.0.0)
- Microsoft.EntityFrameworkCore (>= 10.0.5)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Lyo.FileMetadataStore.Postgres:
| Package | Downloads |
|---|---|
|
Lyo.Api.FileStorage
HTTP API surface for Lyo file storage: file routes, stream upload, archive, and FileMetadata QueryProject. |
GitHub repositories
This package is not used by any popular GitHub repositories.