These are chat archives for damianh/Cedar

20th
Jul 2015
Damian Hickey
@damianh
Jul 20 2015 08:02
lol
Assign version from outside.. need to think how that would work for ExpectedVersion.Any
Dan Barua
@danbarua
Jul 20 2015 08:40
We're currently assigning from "outside" (as in the lib) but yeah, as Damian says ExpectedVersion.Any is a bit tricky
And as you say, quite rightly, I'm not comfortable with having my database hand me my event version numbers
João Bragança
@thefringeninja
Jul 20 2015 10:03
so let em
Dan Barua
@danbarua
Jul 20 2015 14:22
almost imported all my events into postgres
now to see if i can write projections using recursive sql queries
select ((json_data->'TimeStamp')::text)::timestamptz as timestamp, json_data->'Version' as Version
Damian Hickey
@damianh
Jul 20 2015 14:23
oh nice
Dan Barua
@danbarua
Jul 20 2015 14:23
ces.eventstore may be partially baked but it's already 1million x more usefel than NES
Damian Hickey
@damianh
Jul 20 2015 14:23
lol
:heart:
Dan Barua
@danbarua
Jul 20 2015 14:23
well, with postgres at least
i have a little, shall we say, refactoring of the past to do
Damian Hickey
@damianh
Jul 20 2015 14:24
Will get a chance to do the subscription api in next week or so
Will prob change the metadata api bits, but will ping before hand.
Dan Barua
@danbarua
Jul 20 2015 14:25
cool, i'm going to go with System.Timer.Tick + checkpoint for now
it's all good, i'm using postgres so my data is refactor-friendly
Damian Hickey
@damianh
Jul 20 2015 14:25
nice work
Dan Barua
@danbarua
Jul 20 2015 14:51
although i have just come across this: https://github.com/jeremydmiller/pg-events
Dan Barua
@danbarua
Jul 20 2015 15:21
SELECT streams.id_internal,
           streams.is_deleted,
           (SELECT max(events.stream_version) from events where events.stream_id_internal = streams.id_internal)
    FROM streams
    WHERE streams.id = _stream_id;
using a subquery instead of a join == much quicker - might have solved the ExpectedVersion.Any question
0.1ms vs 1200ms quicker