You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've seen in #71 that there is a rom.NOT_NULL. However, from the code I can see that it only works for OneToOne or ManyToOne columns.
Is there a way to query for any other column type?
In my case I'm trying to add a column deactivated_at of type DateTime. I want to filter all active items by querying when deactivated_at doesn't exists or current time it's lower than deactivated_at value. But I still can't get it done.
I like January 1, 1970, because it's a convenient DEFAULT_MISSING_DATE = datetime.datetime.utcfromtimestamp(0) global define (used via DateTime(index=True, default=DEFAULT_MISSING_DATE). But you can pick any arbitrary date that DateTime supports and is before your valid data range.
I get there are other ways to implement it. But I think would be a good feature request to be able to query if a column is not None. There're pretty common use cases.
In the case of SqlAlchemy you're able to query like: filter(deactivated_at!=None)
The problem: how to represent None in an inverted index, when historically we've not stored it, because None is missing data?
I will add an index_None=False option for columns, and if it is true, I will keep a separate "these entities store None" sets for every column. To ensure that this doesn't break folks weirdly, we'll allow duplicate None values in the case where index_None=True, unique=True.
That should solve your problem, and hopefully I'll get to it some time in the next week or two.
I've seen in #71 that there is a
rom.NOT_NULL
. However, from the code I can see that it only works forOneToOne
orManyToOne
columns.Is there a way to query for any other column type?
In my case I'm trying to add a column
deactivated_at
of typeDateTime
. I want to filter all active items by querying whendeactivated_at
doesn't exists or current time it's lower thandeactivated_at
value. But I still can't get it done.Thanks in advance
The text was updated successfully, but these errors were encountered: