django-clickhouse-backend icon indicating copy to clipboard operation
django-clickhouse-backend copied to clipboard

support for "prewhere"

Open Fleapse opened this issue 1 year ago • 1 comments

hey, clickhouse lang has "prewhere" condition is there any way to set this condition using django-clickhouse-backend? and if there is no such method, is it possible to plan to add it for future releases?

Fleapse avatar Apr 05 '24 08:04 Fleapse

To support this:

  1. Add prewhere attribute to clickhouse_backend.models.sql.query.Query as a container for prewhere clauses.
  2. Add prewhere method to clickhouse_backend.models.query.QuerySet which update clickhouse_backend.models.sql.query.Query.prewhere.
  3. Generate prewhere SQL in clickhouse_backend.models.sql.query.compiler.*Compiler.as_sql.

This may take some time to implement.

jayvynl avatar Apr 07 '24 02:04 jayvynl