FCO / Red

A WiP ORM for Raku

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Provide for `date(timestamp_column) = '2021-06-28'`

jonathanstowe opened this issue · comments

I find myself using this pattern quite often and it's quite difficult to implement with what there is right now.

I see it being implemented in two ways: firstly as an explicit .date column method on DateTime typed columns much the same as e.g. .day so it can be used in comparisons with a Str for instance, and also a new candidate for the eq (or ==,) operator where the LHS is a Red::Column with a type of `DateTime and presumably under the hood applies the first under the hood.

I can see where it needs to go, though I may not get to making a PR right away.

I'll try to take a look at it as soon as possible! (Sorry for not seeing this before)

Yes, I think we can do something like the .day() method

The PR'd implementation would probably be enough for me to be honest.

I've just have done this:

image

I've asked, on your PR, to rename that to .yyyy-mm-aa() what do you think?