Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<Version>9.0.2</Version>
<Version>9.2.0</Version>
<LangVersion>13.0</LangVersion>
<Authors>Jeremy D. Miller;Babu Annamalai;Jaedyn Tonee</Authors>
<PackageIconUrl>https://martendb.io/logo.png</PackageIconUrl>
Expand Down
8 changes: 4 additions & 4 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="FSharp.Core" Version="9.0.100" />
<PackageVersion Include="FSharp.SystemTextJson" Version="1.3.13" />
<PackageVersion Include="JasperFx" Version="2.1.2" />
<PackageVersion Include="JasperFx.Events" Version="2.1.2" />
<PackageVersion Include="JasperFx.Events.SourceGenerator" Version="2.1.2">
<PackageVersion Include="JasperFx" Version="2.2.0" />
<PackageVersion Include="JasperFx.Events" Version="2.2.0" />
<PackageVersion Include="JasperFx.Events.SourceGenerator" Version="2.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="JasperFx.SourceGenerator" Version="2.1.2" />
<PackageVersion Include="JasperFx.SourceGenerator" Version="2.2.0" />
<PackageVersion Include="Jil" Version="3.0.0-alpha2" />
<PackageVersion Include="Lamar" Version="7.1.1" />
<PackageVersion Include="Lamar.Microsoft.DependencyInjection" Version="15.0.0" />
Expand Down
9 changes: 9 additions & 0 deletions src/Marten/DocumentStore.EventStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ bool IEventStore.HasMultipleTenants
}
}

async ValueTask<IReadOnlyList<IEventDatabase>> IEventStore.AllDatabases()
{
// Straight delegation to ITenancy, mirroring IMartenStorage.AllDatabases(). The IMartenDatabase
// interface does not itself extend IEventDatabase (only the concrete MartenDatabase does), so this
// projects rather than returning the list directly. See #4570.
var databases = await Tenancy.BuildDatabases().ConfigureAwait(false);
return databases.OfType<IEventDatabase>().ToList();
}

public EventStoreIdentity Identity { get; }

IEventRegistry IEventStore<IDocumentOperations, IQuerySession>.Registry => Options.EventGraph;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Linq;
using System.Threading.Tasks;
using JasperFx.Core;
using JasperFx.Events;
using Marten;
using Marten.Testing.Documents;
using Marten.Testing.Harness;
Expand Down Expand Up @@ -155,6 +156,23 @@ public async Task all_databases_can_return()
var databases = await theStore.Storage.AllDatabases();
databases.Count.ShouldBe(3);
}

[Fact]
public async Task event_store_all_databases_returns_one_event_database_per_database()
{
// IEventStore.AllDatabases() is the store-agnostic mirror of IMartenStorage.AllDatabases() (#4570).
// A Marten + Wolverine host registers IEventStore (the concrete DocumentStore) in DI but not
// IEventDatabase, so this is how store-neutral tooling reaches every database.
var databases = await ((IEventStore)theStore).AllDatabases();
databases.Count.ShouldBe(3);

// Each IEventDatabase can serve the store-neutral read abstractions
foreach (var database in databases)
{
(await database.AllProjectionProgress()).ShouldNotBeNull();
(await database.FetchDeadLetterCountsAsync()).ShouldNotBeNull();
}
}
}

public record RandomEvent{}
Loading