AshClickhouse.Migration (AshClickhouse v0.1.0)

Copy Markdown View Source

Generates ClickHouse CREATE TABLE statements from Ash resources.

ClickHouse tables require an engine and an ORDER BY key. This module maps Ash primary keys and attributes to ClickHouse column definitions and produces a CREATE TABLE IF NOT EXISTS statement using the engine configured in the resource's clickhouse DSL block.

Summary

Functions

Generates the CREATE TABLE SQL for a resource.

Generates all migration statements (table creation) for a list of resources.

Functions

create_table_cql(resource)

@spec create_table_cql(module()) :: String.t()

Generates the CREATE TABLE SQL for a resource.

generate_resource_cql(resource)

@spec generate_resource_cql(module()) :: [String.t()]

Generates all migration statements (table creation) for a list of resources.