tink_sql
tink_sql copied to clipboard
Filter Date order is important
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.
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