django-snowflake
django-snowflake copied to clipboard
Add support for INTERVAL math where the interval is a column
A queryset like:
Experiment.objects.filter(start=F('start') + F('estimated_time')
where estimated_time
is a DurationField
, generates SQL:
WHERE "experiment"."start" = ("experiment"."start" + INTERVAL '"expressions_ExPeRiMeNt"."estimated_time" MICROSECONDS')
but INTERVAL
doesn't support column names. (SQL compilation error: syntax error line 1 at position 0 unexpected '"experiment"'.
)
Perhaps Snowflake could add support for this. For example, MySQL allows:
INTERVAL `experiment`.`estimated_time` MICROSECOND