Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 15 02:42
    natalie-perret-1986 commented #1283
  • Jun 15 02:42
    natalie-perret-1986 commented #1283
  • Jun 14 16:03
    dariogriffo edited #1843
  • Jun 14 16:03
    dariogriffo edited #1843
  • Jun 14 08:18
    dnfadmin commented #1843
  • Jun 14 08:18
    dnfadmin commented #1843
  • Jun 14 08:17
    dnfadmin commented #1843
  • Jun 14 08:17
    dnfadmin commented #1843
  • Jun 14 08:17
    dariogriffo opened #1843
  • Jun 14 08:17
    dariogriffo opened #1843
  • Jun 09 11:26
    VilleHakli edited #1842
  • Jun 09 11:26
    VilleHakli edited #1842
  • Jun 09 07:55
    VilleHakli opened #1842
  • Jun 09 07:55
    VilleHakli opened #1842
  • Jun 08 04:54

    mysticmind on master

    Bump up version to rc.2 (compare)

  • Jun 08 04:54

    mysticmind on master

    Bump up version to rc.2 (compare)

  • Jun 04 21:25

    jeremydmiller on master

    deleted some tests that are dup… (compare)

  • Jun 04 21:25

    jeremydmiller on master

    deleted some tests that are dup… (compare)

  • Jun 04 20:58
    jeremydmiller commented #1840
  • Jun 04 20:58
    jeremydmiller commented #1840
Jeremy D. Miller
@jeremydmiller
I've been a little burned out the past couple weeks, but I'm relatively free this week and should start back on writing docs for 4.0.
Thumann
@Thumann

Hi, consider the following query:
var entries = session.Query<DataEntry>().ToList();
foreach(var offsetGroups in entries.GroupBy(c=> c.StartDate.Offset))
{
Console.WriteLine($"{offsetGroups.Key}: {offsetGroups.Count()}");
}
I get:
02:00:00: 81442
01:00:00: 65792
But if I query directly:
SELECT json_agg(json_build_object('StartDate', mt_doc_dataentry.data ->> 'StartDate'::text, 'Id', Id))
FROM elva.mt_doc_dataentry
deserialize the resulting json and query againg i get:
00:00:00: 29688
02:00:00: 67064
01:00:00: 50482

This seems fishy!

bitbonk
@bitbonk
What would be good way to add some default data into marten's mt_doc_* tables, without starting the actual app that uses marten?
Using some sort of script, maybe?
Oskar Dudycz
@oskardudycz
Jeremy D. Miller
@jeremydmiller
@bitbonk Use a smaller app with the exact same Marten setup? You could do it through an Oakton command in the same app. If you try to insert data directly into the database without going through Marten itself, I'm going to say that you've voided the warranty:)
bitbonk
@bitbonk
@oskardudycz Thx, looks like a perfect fit.
@jeremydmiller Yes, after I saw the the output of store.Schema.ToDDL(), I immediately knew it's a bad idea to circumvent marten. ;)
bitbonk
@bitbonk
By the way: When I have everything set to AutoCreate.All so that any table is created on the fly, store.Schema.ToDDL() does not contain any of the mt_doc_ tables, even though these tables to already exist in the DB because I have already saved some objects.
Is that expected?
Does store.Schema.ToDDL() only work for those Types that are used/definied using _.Schema.For<TMyType>()
Jeremy D. Miller
@jeremydmiller
The last thing you said, yes. It's gotta "know" about the document types. We make that optional for a quicker getting started story, but you'd need it in order to make the schema migration story work.
bitbonk
@bitbonk
@jeremydmiller I see. But in theory it does know about the document type, because it literally just saved an instance of it before I called store.Schema.ToDDL().
Jeremy D. Miller
@jeremydmiller
That's be a bug then.
bitbonk
@bitbonk
I'll see if I get around creating an easy repro and then reporting it.
Mark Warpool
@CodingGorilla
Does marten have any built in automatic retry mechanisms for transient connection failures?
darraghjones
@darraghjones
is there a way to query for just the Ids of document type?
Jeremy D. Miller
@jeremydmiller
session.Query<YourType>().Select(x => x.Id).ToList()
Oskar Dudycz
@oskardudycz
Default policy should retry Postgres failures
Hamish Crittenden
@hamishcrittenden
@oskardudycz - Hey Oskar - I've got an issue with an implementation of the GoldenEye framework - I'm wiring up according to your working samples and have three version of each event in my mt_events table in Marten - are you aware of any bugs around event propagation?
bitbonk
@bitbonk
I see that store.Schema.ToDDL() contains a lot of JavaScript ($$ LANGUAGE plv8 IMMUTABLE STRICT;)
Does that mean Marten really always requires plv8? Or only for a certain small subset like JSON transformations?
If so, what features are that, "how well" does Marten work if I dont't have plv8 ?
It is surprisingly hard to find the plv8 binaries for postgres 13 on windows
Cathal Golden
@goldenc

Hi, I've got to so some aggregations on a marten table as follows:

SELECT * FROM (
SELECT data #>> array['Id'] AS Id, data #>> array['A'] AS A, data #>> array['B'] AS B, row_number() over (
    partition by data #>> array['A'], data #>> array['B'], data #>> array['C']
    order by data #>> array['C'] DESC
    ) AS row_number 
WHERE {predicatesSql}
FROM index) x
WHERE x.row_number = 1

Is it possible to run this query through the ILightweightSession interface?

Cathal Golden
@goldenc
or how am I meant to do this kind of aggregation using Marten ?
Oskar Dudycz
@oskardudycz
@hamishcrittenden might be better move the discussion around that to the GoldenEye gitter https://gitter.im/oskardudycz/GoldenEye
@bitbonk yes, you can disable it https://martendb.io/documentation/troubleshoot/
As I recall it might be disabled by default in v4 (not sure tho)
If you disable plv8 then you'll loose JSON Patch capabilities, the rest should work the same
bitbonk
@bitbonk
looks like it might be disabled in v4 since it seems it is becoming an extra package: https://www.nuget.org/packages/Marten.PLv8/2.0.0-rc.2
@oskardudycz Why is that package at version 2 though?
Oskar Dudycz
@oskardudycz
@goldenc if you're using v4 then you could use session.Database.ExecuteReaderAsync method
Yup, we're planning to phase out plv8 as it's getting harder and harder to get the custom builds
Regarding 2.0.0 I'm not sure. @jeremydmiller would need to answer that. Might be that's oversight
Cathal Golden
@goldenc
@oskardudycz thanks, my sql was invalid, sorry for the noise
Oskar Dudycz
@oskardudycz
:+1:
Hamish Crittenden
@hamishcrittenden
Thanks @oskardudycz - i didnt realise that existed
Jeremy D. Miller
@jeremydmiller
@bitbonk What version of Marten are you using? If you were on the latest, that wouldn't exist.
And I'm also not sure why the plv8 package is at 2.0 either. Think that's just an oversight
@oskardudycz Remember that we pulled all the PLv8 related stuff to a separate package now. So all the Patch() methods and Transform() methods are extension methods now
Oskar Dudycz
@oskardudycz
:+1:
bitbonk
@bitbonk
@jeremydmiller I am using Marten 3.13.3, it shouldn't exist in that version?
or do you mean the 4 RC ?
Jeremy D. Miller
@jeremydmiller
It wouldn't exist in 4RC because we separated out the PLV8 support. It's not clear that the plv8 project has legs right now, so we pulled that out of core. Google seems to be pulling the plug on the support, not the plv8 team themselves.
Julien PERIGNON
@julienperignon
Hey everyone ! Just noticing some "problems" with the memory usage of a simple app with Async projection Daemon running ( and with maybe 100 events in PG) using marten V4 on local. I noticed a quite large memory consumption on startup (and quite a big spike a 1.6gb) that takes a bit of time to be released. I was reading old posts about code generation happening at runtime that could be leading to high memory usage. . Is there any way to avoid that ?
3 replies
image.png
Jeremy D. Miller
@jeremydmiller
Look in the GitHub issues. We have a workaround planned, but I was hoping to leave that until 4.1
Oskar Dudycz
@oskardudycz
I’m also on vacations this week
JT
@Hawxy
In my own experience, the memory usage is only really apparent within the VS debugger as the GC takes ages to kick in. Whilst running in production the server GC is far more aggressive and it quickly cleans up.