Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 02:41
    Hawxy commented #130
  • Dec 05 19:12

    jeremydmiller on master

    relaxed the hosting version con… (compare)

  • Dec 05 18:57

    jeremydmiller on master

    consolidated dependencies on Ja… updated to JasperFx.Core to fix… bumping to 6.0-alpha-5 and 1 more (compare)

  • Dec 05 18:57

    jeremydmiller on master

    consolidated dependencies on Ja… updated to JasperFx.Core to fix… bumping to 6.0-alpha-5 and 1 more (compare)

  • Dec 05 18:57

    jeremydmiller on consolidation

    (compare)

  • Dec 05 18:57

    jeremydmiller on consolidation

    (compare)

  • Dec 05 18:57
    jeremydmiller closed #2417
  • Dec 05 18:57
    jeremydmiller closed #2417
  • Dec 05 18:41
    jeremydmiller synchronize #2417
  • Dec 05 18:41
    jeremydmiller synchronize #2417
  • Dec 05 18:41

    jeremydmiller on consolidation

    upgraded weasel.commandline to … (compare)

  • Dec 05 18:41

    jeremydmiller on consolidation

    upgraded weasel.commandline to … (compare)

  • Dec 05 18:07
    jeremydmiller synchronize #2417
  • Dec 05 18:07
    jeremydmiller synchronize #2417
  • Dec 05 18:07

    jeremydmiller on consolidation

    bumping to 6.0-alpha-5 (compare)

  • Dec 05 18:07

    jeremydmiller on consolidation

    bumping to 6.0-alpha-5 (compare)

  • Dec 05 17:56
    jeremydmiller synchronize #2417
  • Dec 05 17:56
    jeremydmiller synchronize #2417
  • Dec 05 17:56

    jeremydmiller on consolidation

    updated to JasperFx.Core to fix… (compare)

  • Dec 05 17:56

    jeremydmiller on consolidation

    updated to JasperFx.Core to fix… (compare)

Oskar Dudycz
@oskardudycz
Do you think that being able to do custom serialization like in my PR would help? JasperFx/marten#2314
2 replies
In theory, it’s more for event schema migration, but I was thinking of making it more generic also for documents as the next step
Phillip Haydon
@phillip-haydon

Have I ever mentioned how much I appreciate you & @phillip-haydon taking the lead on STJ issues? :-)

not to me :D still waiting on a reply to know if we can set casing to be insensitive by default to match newtonsoft and fix my projection issue :D

Jeremy D. Miller
@jeremydmiller
Okay, that's a "no", that needs to be opt in
Phillip Haydon
@phillip-haydon
:+1: no worries, i shall add some docs somewhere so if i didn't already add it so it's not forgotten
Egor Pavlikhin
@EgorPavlikhin_twitter
What is the default for 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)
My assumption is that the default is None, but why is it then trying to apply migrations
Looking at the sauce the default appears to be CreateOrUpdate ouch
Oskar Dudycz
@oskardudycz
Yes, if you'd like to use None then you need to specify that explicitly
Jeremy D. Miller
@jeremydmiller
@EgorPavlikhin_twitter It's CreateOrUpdate to enable quick developer starts. Check out this topic maybe: https://martendb.io/configuration/optimized_artifact_workflow.html
Jakob Stengård
@pnjakste
Hello. Does marten support PostgreSQL 14?
I was thinking about upgrading an applicaiton we have in development but i just want to know if it will break things that might effect our release date.
JT
@Hawxy
Works fine. I currently use Marten in production with 14.3.
Maciej G.
@grzybsonssg
Hi! Can I extend Marten's OrderBy with IMethodCallParser? I need to order documents by simple arithmetic expression: e.VotesUp - e.VotesDown...
Jakob Stengård
@pnjakste
In our old postgre we had the pl8 extension installed. I wonder, is this still a requirement for marten, or can you skip it?
What are the implications if you don't have plv8 installed?
Oskar Dudycz
@oskardudycz
@pnjakste it's not requirement, and it's disabled by default.
The only implication is that patching documents won't work
Jeremy D. Miller
@jeremydmiller
@grzybsonssg No, the method call parser business is only used for Where() clauses -- but feel free to open an issue for some kind of extension for this. I think we've added an OrderBy() overload extension method that lets you feed in raw SQL. That might be easier than mucking with Linq.
Or, easiest, make a read-only getter property that calculates that value and it'll get serialized into the JSON and you'll be able to order or search on that at will. Kinda like building an index for that expression
@pnjakste Here's a rundown of the functionality that won't exist w/o PLv8: https://martendb.io/documents/plv8.html.
Phillip Haydon
@phillip-haydon
i can't for the life of me figure out how to get a ToListAsync from a compiled query
Jeremy D. Miller
@jeremydmiller
@phillip-haydon The compiled query class itself just defines the SQL and the “plan” to get results out of the SQL. To run a compiled query asynchronously, it’s just this method: https://github.com/JasperFx/marten/blob/master/src/Marten/IQuerySession.cs#L204
Phillip Haydon
@phillip-haydon
so on the compiled query i would just set it to IReadOnlyList and then call ToListAsync?
Jeremy D. Miller
@jeremydmiller
Use this parent class: https://github.com/JasperFx/marten/blob/master/src/Marten/Linq/ICompiledQuery.cs#L38. Then pass that into IQuerySession.QueryAsync(compiled query) and you get Task<IReadOnlyList<T>>
Jeremy D. Miller
@jeremydmiller
There are some examples in the docs. You never have to call ToList() in the actual compiled query
Phillip Haydon
@phillip-haydon
:+1:
thanks
Oskar Dudycz
@oskardudycz
Folks, today's International Marten's Day. We'll be giving today talks with @jeremydmiller showcasing Marten. See details:
Feel invited! :)
Phillip Haydon
@phillip-haydon
bit late for me :'( do you know if its recorded?
3 replies
Oskar Dudycz
@oskardudycz
It should be
Tomas Tichy
@ttichy
Is there a way to query the MartenRegistry? I'd like to know what Subclass has been added with AddSubClass
Jeremy D. Miller
@jeremydmiller
Look off of IDocumentStore.Options. It’s a read-only view over the underlying StoreOptions. Should give you access to look at doc type by doc type.
2 replies
Sam
@iamjustsam

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
Jeremy D. Miller
@jeremydmiller
@iamjustsam I'm not aware of any issues like that -- and we would have fixed them if we had known. I think I need to ask you to open a GH issue with repro steps and we'll try to get any necessary fixes into 5.9. Which might be next week (definitely not this week)
1 reply
Sam
@iamjustsam
Allright, I'll try to make some clear examples and open a GH issue. Thanks!
Jeremy D. Miller
@jeremydmiller
And I can't say that I've ever tried exactly those permutations with the compiled query.
Sam
@iamjustsam
The "funny" thing is that the queries themselves actually work, it is only the registration of the types for pre-building them that fails.
Jeremy D. Miller
@jeremydmiller
Doesn't strike me as all that surprising having been the guy who implemented the compiled query feature:)
Sam
@iamjustsam
:D
Jeremy D. Miller
@jeremydmiller
At some point we should probably stick @oskardudycz 's extension methods for writing events or documents in one line of code directly against IDocumentStore / IDocumentSession and just put them in the box.
4 replies
John Tesh
@johnteshnats_twitter

hey all, trying to time constrain the events using query all raw events and running into a System.InvalidCastException: 'Can't write CLR type System.Int32 with handler type TimestampTzHandler'

var @events = _documentSession.Events
.QueryAllRawEvents()
.Where(x =>
x.MatchesSql($"data->> 'Test' = '{foo}'") &&
x.Timestamp.CompareTo(DateTimeOffset.UtcNow.AddDays(-30)) > 0);

any thoughts on how to achieve this?

Jeremy D. Miller
@jeremydmiller
Yeah, the Linq support doesn’t know anything about the CompareTo() function.
do var cutoff = DateTimeOffset.UtcNow.AddDays(-30) and
Where(x => x.Timestamp > cutoff).*******) and see if that’s any happier
1 reply
ddivita
@ddivita

We have an app that is still using Marten 3. We have an event that contains a collection of references we want to project to their own view without having separate child events. We are concerned about the volume of child events in the DB.

    public class CostAllocatedToPlantGroup : IEvent
    {
        public Guid PlantGroupId { get; set; }       
        public List<PlantReference> Plants { get; set; }         
        public decimal AmountAllocated { get; set; } 
        public Guid StreamId => PlantGroupId;

    }

    public class PlantReference
    {
       public Guid PlantId {get; set; }
       public string PlantName {get;set;}            
    }

Is it possible to project each PlantReference into its own view projection, when the CostAllocatedToPlantGroup is applied? One idea was to inject a DocumentSession to store the individual references, but there may be a better way of managing this via the event pipeline.

1 reply
craigjcox
@craigjcox
Great talks today! When appending events to a stream w Marten, is there a way to return the current/max global position of the event store? Looking for something similar to LogPosition as part of the IWriteResult for the event store client or CurrentPosition as part of the AppendResult for SqlStreamStore
Jeremy D. Miller
@jeremydmiller
Haven't looked at SqlStreamStore in years, so can't really compare. You could get that information off the StreamAction that gets returned from Append() or StartStream(), but that information wouldn't exist until after you call SaveChangesAsync();
1 reply
Jackson Cribb
@JacksonCribb
StreamAction has the version of the stream itself but not the global position, If events in the StreamAction are updated after write could you get the Sequence from the last event?
1 reply
Jeremy D. Miller
@jeremydmiller
2 replies