Skip to main content

generate_view_query_key

Function generate_view_query_key 

Source
pub fn generate_view_query_key(
    view: &str,
    where_clause: Option<&WhereClause>,
    limit: Option<u32>,
    offset: Option<u32>,
    order_by: Option<&[OrderByClause]>,
    schema_version: &str,
) -> u64
Expand description

Fast cache key for a view query — zero heap allocations.

Hashes view + where_clause + limit + offset + schema_version directly without constructing an intermediate String or serde_json::Value. Use this instead of generate_cache_key in the cache adapter hot path.

Domain tag "v:" separates these keys from projection keys ("p:") and generic query keys ("q:"), preventing cross-path collisions.

§Arguments

  • view - Database view / table name
  • where_clause - Optional WHERE filter (e.g. from RLS injection)
  • limit - Optional row limit
  • offset - Optional row offset
  • schema_version - Schema hash from CompiledSchema::content_hash()