Fork me on GitHub
#xtdb
<
2019-09-25
>
hoppy01:09:37

so, I got a surprise, now I'm confused.

hoppy01:09:24

I stumbled into the fact that when I do a put, crux is running my document through spec (I have specs registered for some namespaced keywords).

hoppy01:09:37

So, here is my boggle, maybe you guys can clear it up.

hoppy01:09:16

I have some timestamps in my data. In my internal structures, these manifest as clj-date kinda things. That is what my spec was written to enforce.

hoppy01:09:04

by the time I put the document into crux, I have morphed these into ISO date strings, with the hope of being able to get inequality help on crux queries treating them as strings.

hoppy01:09:17

But alas, they bust specs when they are like that.

hoppy01:09:52

I was hesitant to put the "goofy" types in the document, and certainly wouldn't expect inequality comparisions to work on datatypes you guys know nothing about.

hoppy01:09:28

If you tell me that crux can handle an #inst type thing, I'm happy to roll with that.

hoppy01:09:48

If you tell me that I can write a clj-time/date-time object and compare on that, I will be floored.

hoppy01:09:20

ps, are you guys planning to show up to conj in Nov?

refset12:09:23

we're not certain who's heading to the Conj yet, but I think a few JUXTers have submitted talk proposals so 🤞 - I already know I won't be there myself unfortunately. Whilst it's probably the wrong continent for you, Håkan (lead dev) is speaking at ClojuTRE this week and will be there with a large JUXT contingent.

jjttjj01:09:23

@hoppy not a Crux expert yet but Crux can definitely out of the box handle #inst type things as well as any java.time objects (and anything else serializable by nippy)

hoppy01:09:52

there are no "crux experts" :face_with_cowboy_hat:

not-sure-fry 4
jjttjj01:09:55

I actually stumbled across the automatic spec'ing recently as well

hoppy01:09:46

I should probably just store #inst in my damn maps and be over it.

jjttjj01:09:53

I believe you can also create custom serializers/deserializers for anything via nippys interrace for that

hoppy01:09:40

I get that, but these are timecards, so we wanna query by date-range. If I can't do inequality comparisions, I'm hosed.

hoppy01:09:09

I'm lazy, I haven't tested whether it just works.

hoppy01:09:01

@jjttjj, you appear to be on my continent, where be you?

jjttjj01:09:28

You can use arbitrary predicates your Crux queries as well though there may be reasons you don't want that ( I'm currentlly doing kinda fancy date stuff with just/tick intervals right in my queries)

👍 4
jjttjj01:09:18

I'm in NYC USA

hoppy01:09:40

Nice, Houston back at ya

4
hoppy01:09:11

I guess I'll go have a lab with this. It's kinda nice that crux is verifying my specs, but I just wasn't sure what it wants to eat

refset12:09:13

@hoppy we don't have bandwidth this week to look into exactly what's possible, but I'm pretty certain @jjttjj is right that you can go a long way with custom predicates and readers currently (there has been some discussion about custom readers on the Official juxt-oss Zulip #crux too, so I'd recommend checking that out)

refset12:09:23

we're not certain who's heading to the Conj yet, but I think a few JUXTers have submitted talk proposals so 🤞 - I already know I won't be there myself unfortunately. Whilst it's probably the wrong continent for you, Håkan (lead dev) is speaking at ClojuTRE this week and will be there with a large JUXT contingent.