Path: redb/redb.Tests.Integration/Tests/PostgresPro/PostgresProIndexCatalogTests.cs
Snapshot: redb, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb
Page: https://redbase.app/src/dev-2026-12-06/redb/redb.Tests.Integration/Tests/PostgresPro/PostgresProIndexCatalogTests.cs
----
using Microsoft.Extensions.DependencyInjection;
using redb.Core.Models;
using redb.Core.Models.Configuration;
using redb.Postgres.Pro.Sql;
using redb.Postgres.Sql;
using redb.Tests.Integration.Tests.Postgres;
namespace redb.Tests.Integration.Tests.PostgresPro;
///
/// PostgresProIndexCatalog.Pro, the indexes of the streams query form, against a fresh PostgreSQL Pro database of this
/// build with the planner on (see ).
///
public class PostgresProIndexCatalogTests : PostgresIndexCatalogTests
{
protected override void AddRedb(IServiceCollection services, string connectionString, Action configure)
=> redb.Core.Pro.Extensions.RedbProServiceCollectionExtensions.AddRedbPro(services,
o => redb.Postgres.Pro.Extensions.PostgresProOptionsExtensions.UsePostgres(o, connectionString).Configure(configure));
protected override IReadOnlyList Catalog => PostgresProIndexCatalog.Pro;
protected override IReadOnlyList CoveredElsewhere => PostgresIndexCatalog.Base;
protected override (string File, string Namespace, string Class, string Member, RedbIndexOrigin Origin) Target =>
("redb.Postgres.Pro/Sql/PostgresProIndexCatalog.g.cs", "redb.Postgres.Pro.Sql", "PostgresProIndexCatalog", "Pro", RedbIndexOrigin.ProModule);
}
/// The streams indexes of PostgreSQL Pro are built once (see ).
public class PostgresProStreamsIndexOnceTests : Base.StreamsIndexOnceTestsBase
{
protected override async Task CreateDatabaseAsync(string name)
{
await PostgresIndexCatalogTests.ExecAdminAsync($"CREATE DATABASE \"{name}\"");
return new Npgsql.NpgsqlConnectionStringBuilder(PostgresIndexCatalogTests.AdminBase) { Database = name }.ConnectionString;
}
protected override async Task DropDatabaseAsync(string name)
{
Npgsql.NpgsqlConnection.ClearAllPools();
await PostgresIndexCatalogTests.ExecAdminAsync($"DROP DATABASE IF EXISTS \"{name}\" WITH (FORCE)");
}
protected override void AddRedbPro(IServiceCollection services, string connectionString, Action configure)
=> redb.Core.Pro.Extensions.RedbProServiceCollectionExtensions.AddRedbPro(services,
o => redb.Postgres.Pro.Extensions.PostgresProOptionsExtensions.UsePostgres(o, connectionString).Configure(configure));
protected override string StreamsIndex => "IX__objects__scheme_id";
protected override string DropStreamsIndexSql => "DROP INDEX \"IX__objects__scheme_id\"";
}