Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 03 19:40
    smbecker edited #2362
  • Oct 03 19:40
    smbecker edited #2362
  • Oct 03 19:38
    smbecker opened #2362
  • Oct 03 19:38
    smbecker opened #2362
  • Oct 03 00:35
    dnfadmin commented #1843
  • Oct 03 00:35
    dnfadmin commented #1843
  • Oct 01 13:40
    dnfadmin commented #1746
  • Oct 01 13:40
    dnfadmin commented #1746
  • Oct 01 05:23
    dnfadmin commented #1846
  • Oct 01 05:23
    dnfadmin commented #1846
  • Sep 30 01:33
    dnfadmin commented #1706
  • Sep 30 01:33
    dnfadmin commented #1706
  • Sep 29 16:22
    dnfadmin commented #2149
  • Sep 29 16:22
    dnfadmin commented #2149
  • Sep 29 09:31
    NikiforovAll commented #2360
  • Sep 29 09:31
    NikiforovAll commented #2360
  • Sep 28 21:38
    dnfadmin commented #1728
  • Sep 28 21:38
    dnfadmin commented #1728
  • Sep 28 02:11
    kuanpak opened #70
  • Sep 27 10:46
    dnfadmin commented #1580
Jannik Buschke
@jannikbuschke
Ok, seems this happens when I have issues saving/applying events (using system.text.json + custom converter)
Jeremy D. Miller
@jeremydmiller
I'm shocked that STJ could ever be a problem. Shocked I tell you!
Marten should be putting tombstone events in place of the failed events, but maybe we've never tested that workflow in the case of serialization failures earlier in the SaveChanges() call.
Oskar Dudycz
@oskardudycz
@jeremydmiller, you're trying to push me from the 1st place for the biggestSTJ hater? :D
Jeremy D. Miller
@jeremydmiller
Have I ever mentioned how much I appreciate you & @phillip-haydon taking the lead on STJ issues? :-)
Oskar Dudycz
@oskardudycz
You did :P
Jannik Buschke
@jannikbuschke
Im using System.text.json + https://github.com/Tarmil/FSharp.SystemTextJson and I actually like it. It gives some errors as kind of expected but actually now I have a model that I am happy with. I.e. strings are now not nullable but need to be "string option" (FsharpOption) and null will error on de/serializing
Oskar Dudycz
@oskardudycz
Sorry to be that guy, but did you consider using a battle tested Newtonsoft?
To balance that, F# user experience will be my next goal after merging Upcasters PR. If you could write up all of your challenges in the GH issue, then I could try to include that.
Still, I need to learn F# language and idiomatic approach better, so it’ll take some time
Ben Edwards
@elexisvenator
Speaking of STJ, anyone ever had the problem when calling GetHeader() on an event will sometimes return a STJ object instead of the header string, even when marten is not configured to use STJ?
It's not something that always happens and I haven't been able to reliably recreate it, but ive taken to putting an extra ToString on all my header calls
Oskar Dudycz
@oskardudycz
I’m not aware of such an issue. But if you were able to reproduce it, we’ll give it a look. Are you sure that’s STJ JsonDocument, and not Newtonsoft JObject?
JObject could be returned if there was an unknown type and it did dynamic deserialisation. It can be cast to the specific type.
Jannik Buschke
@jannikbuschke
Tested with Newtonsoft and fsharp types are serialized okish, however the deserialization format for options and discriminated unions is imho not ideal. For both types are different json representations possible, Ill try write a blogpost about my experiences but not yet sure when...
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!