tink_sql icon indicating copy to clipboard operation
tink_sql copied to clipboard

Filter Date order is important

Open hypersurge opened this issue 5 years ago • 1 comments

A Filter with Date > Field creates "Cannot compare Date and tink.sql.Field<Date,...>", whereas flipping the order to Field < Date completes as expected. Same with ==. The issue did not present on Int and VarChar fields.

The workaround is easy enough so this little note is probably enough to help others avoid the issue.

hypersurge avatar Sep 25 '20 04:09 hypersurge

I wonder why though. Because even for Float there are only Field <op> Float operator overloads but not Float <op> Field, so I expect this will work only one way but the other way round:

https://github.com/haxetink/tink_sql/blob/097c652f7be854385e933730c17f7f376595156f/src/tink/sql/expr/Field.hx#L152

kevinresol avatar Nov 17 '20 07:11 kevinresol