wip: doctor/cli/docs/api to vector db consolidation; api hardening for descriptions, tenant, and scopes; migrations and conversions of all DALs to EF v10
This commit is contained in:
@@ -1,17 +1,22 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using StellaOps.Evidence.Core;
|
||||
using StellaOps.Infrastructure.Postgres.Repositories;
|
||||
using StellaOps.Infrastructure.Postgres.Connections;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace StellaOps.Evidence.Persistence.Postgres;
|
||||
|
||||
/// <summary>
|
||||
/// PostgreSQL implementation of <see cref="IEvidenceStore"/>.
|
||||
/// PostgreSQL (EF Core) implementation of <see cref="IEvidenceStore"/>.
|
||||
/// Stores evidence records with content-addressed IDs and tenant isolation via RLS.
|
||||
/// </summary>
|
||||
public sealed partial class PostgresEvidenceStore : RepositoryBase<EvidenceDataSource>, IEvidenceStore
|
||||
public sealed partial class PostgresEvidenceStore : IEvidenceStore
|
||||
{
|
||||
private const int CommandTimeoutSeconds = 30;
|
||||
|
||||
private readonly EvidenceDataSource _dataSource;
|
||||
private readonly string _tenantId;
|
||||
private readonly ILogger<PostgresEvidenceStore> _logger;
|
||||
|
||||
private static readonly JsonSerializerOptions _jsonOptions = new()
|
||||
{
|
||||
PropertyNamingPolicy = JsonNamingPolicy.CamelCase
|
||||
@@ -27,9 +32,15 @@ public sealed partial class PostgresEvidenceStore : RepositoryBase<EvidenceDataS
|
||||
EvidenceDataSource dataSource,
|
||||
string tenantId,
|
||||
ILogger<PostgresEvidenceStore> logger)
|
||||
: base(dataSource, logger)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(dataSource);
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(tenantId);
|
||||
ArgumentNullException.ThrowIfNull(logger);
|
||||
|
||||
_dataSource = dataSource;
|
||||
_tenantId = tenantId;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
private string GetSchemaName() => EvidenceDataSource.DefaultSchemaName;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user