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
to enable quick developer starts. Check out this topic maybe: https://martendb.io/configuration/optimized_artifact_workflow.html
OrderBy()
overload extension method that lets you feed in raw SQL. That might be easier than mucking with Linq.
IQuerySession.QueryAsync(compiled query)
and you get Task<IReadOnlyList<T>>
Hi! I have some questions regarding compiled queries
Should it be possible to correctly use compiled queries without parameters? When I do so and try to register the query type for code generation, it complains that the query is not a valid compiled query. If I add a parameter AND use it in the query, the registration seems to work fine.
Is it possible to use the tenancy helpers in a compiled query? e.g. .Where(x => x.AnyTenant())
. Same situation as above, when registering the query type.
Should a where clause like this be possible: .Where(x => x.ChildCollection.Any())
?
We have all scenario's above in compiled queries and have not had any issues with them but we are now experimenting with up-front code generation and any query that uses any of the features above fail registration with storeOptions.RegisterCompiledQueryType()
ERROR: System.ArgumentOutOfRangeException: Application.SomeCompiledQuery.<>c is not a valid Marten compiled query type (Parameter 'queryType')
at Marten.StoreOptions.RegisterCompiledQueryType(Type queryType)
at Application.MartenServiceCollectionExtensions.RegisterCompiledQueryTypes(StoreOptions options) in ***\Startup.Marten.cs:line 94