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,18 +1,10 @@
|
||||
// Licensed to StellaOps under the BUSL-1.1 license.
|
||||
using Npgsql;
|
||||
|
||||
namespace StellaOps.ReachGraph.Persistence;
|
||||
|
||||
public sealed partial class PostgresReachGraphRepository
|
||||
{
|
||||
private static async Task SetTenantContextAsync(
|
||||
NpgsqlConnection connection,
|
||||
string tenantId,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
await using var command = connection.CreateCommand();
|
||||
command.CommandText = "SELECT set_config('app.tenant_id', @TenantId, false);";
|
||||
command.Parameters.AddWithValue("TenantId", tenantId);
|
||||
await command.ExecuteNonQueryAsync(cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
// Tenant context is now managed by DataSourceBase.OpenConnectionAsync(tenantId, role).
|
||||
// The base class sets app.tenant_id and app.current_tenant via ConfigureSessionAsync.
|
||||
// No per-repository tenant context setup is needed.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user