cat_gateway::db::index::schema

Function generate_cql_schema_version

Source
fn generate_cql_schema_version() -> String
Expand description

Generates a unique schema version identifier based on the content of all CQL schemas.

This function processes each CQL schema, removes comments from its lines and joins them into a single string. It then sorts these processed strings to ensure consistency in schema versions regardless of their order in the list. Finally, it generates a UUID from a 127 bit hash of this sorted collection of schema contents, which serves as a unique identifier for the current version of all schemas.

ยงReturns

A string representing the UUID derived from the concatenated and cleaned CQL schema contents.