Intersect
Linq operator. Is there any alternative way to achieve this functionality? I'm trying to check if two arrays intersect in Marten query.
@/all I started to work on the Marten API for Upcasting events data. I'd like to add a built-in tooling for simple payload transformations. You could use that if your event schema has changed and you'd like to use new event types in your aggregates and projections. Those transformations will be run during the serialisation phase, so upcasting on the fly old event data into the new one.
I added two types of upcasters:
I have an early draft, of it, I'd be grateful for your feedback, especially about the public API (e.g. accessibility, naming, etc.).
Technically, this is what I described in my blog article: https://event-driven.io/en/simple_events_versioning_patterns/
Thoughts?
Where(x => x == null)
, are probably not going to have explicit support.
public class ScopedSessionFactory: ISessionFactory
{
private readonly IDocumentStore store;
private readonly IUserService userService;
public ScopedSessionFactory(IDocumentStore store, IUserService userService)
{
this.store = store;
this.userService = userService;
}
public IQuerySession QuerySession()
{
return store.QuerySession();
}
public IDocumentSession OpenSession()
{
var session = store.LightweightSession();
var userId = userService.GetUserId();
session.SetHeader("UserId", userId);
return session;
}
}
Are these diagnostic messages normal/expected? I get them several times per second
`
[14:31:51 INF] High Water agent is stale after threshold of 3 seconds, skipping gap to events marked after 08/08/2022 12:30:20 +00:00
[14:31:51 INF] Daemon projection high water detection skipping a gap in event sequence, determined that the 'safe harbor' sequence is at null
`
AutoCreateSchemaObjects
if it's not specified? I have queries periodically failing for a service running in Google Cloud Run with timeouts like so. Just wondering what could be the reason.---> System.TimeoutException: The operation has timed out.
at Weasel.Core.Migrations.TimedLock.Lock(TimeSpan timeout)
at Weasel.Core.Migrations.DatabaseBase`1.generateOrUpdateFeature(Type featureType, IFeatureSchema feature, CancellationToken token)
at Weasel.Core.Migrations.DatabaseBase`1.ensureStorageExists(IList`1 types, Type featureType, CancellationToken token)
at Marten.Linq.MartenLinqQueryProvider.ensureStorageExistsAsync(LinqHandlerBuilder builder, CancellationToken cancellationToken)
at Marten.Linq.MartenLinqQueryProvider.ExecuteAsync[TResult](Expression expression, CancellationToken token)
None
, but why is it then trying to apply migrations
CreateOrUpdate
ouch
CreateOrUpdate
to enable quick developer starts. Check out this topic maybe: https://martendb.io/configuration/optimized_artifact_workflow.html