Lotus.Source.Adapters.Ecto.Dialects.ClickHouse (Lotus ClickHouse v0.1.0)

Copy Markdown View Source

Lotus.Source.Adapters.Ecto.Dialect implementation for ClickHouse.

Everything that differs from the SQL dialects Lotus ships lives here:

  • Identifiers and parameters — double-quoted identifiers, and ClickHouse's {$0:Type} placeholders rather than $1 or ?.
  • Type mappingdb_type_to_lotus_type/1 covers the integer, float, decimal, date, string, array, map and tuple families, through the Nullable and LowCardinality wrappers.
  • Query plansquery_plan/4 runs EXPLAIN.
  • Safety defaultsbuiltin_denies/1 and builtin_schema_denies/1 keep the system database and the migration table out of reach, before any host visibility rule is considered.
  • Editor and AI — ClickHouse keywords, types and functions, and an ai_context/0 carrying the syntax notes that keep a model away from the patterns that perform badly here (PREWHERE, FINAL, approximate aggregations, column-oriented shapes).

Host applications do not call this module. It is reached through Lotus.Source.Adapters.ClickHouse, which the Lotus pipeline drives.