Skip to content

Commit

Permalink
fix: implement ITenancy to match changed interface
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexZeitler committed May 24, 2024
1 parent 1283769 commit 32f5146
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Marten/Storage/WildcardSingleServerMultiTenancy.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using JasperFx.Core;
using Marten.Schema;
using Npgsql;
using Weasel.Core.Migrations;

namespace Marten.Storage;
Expand All @@ -23,11 +23,11 @@ string prefix
options.Policies.AllDocumentsAreMultiTenanted();
_database = new MartenDatabase(
options,
new ConnectionFactory(connectionString),
NpgsqlDataSource.Create(connectionString),
identifier
);
_prefix = prefix;
Cleaner = new CompositeDocumentCleaner(this);
Cleaner = new CompositeDocumentCleaner(this, options);
}

public ValueTask<IReadOnlyList<IDatabase>> BuildDatabases()
Expand Down Expand Up @@ -76,4 +76,9 @@ string tenantId
var tenant = GetTenant(tenantId);
return ReferenceEquals(database, tenant.Database);
}

public void Dispose()
{
_database.Dispose();
}
}

0 comments on commit 32f5146

Please sign in to comment.