pub async fn setup_schema(
clickhouse_client: &Client,
pool: &Pool<MySql>,
) -> Result<()>
Expand description
Loads and initializes the ClickHouse schema from SQL files.
- Retrieves the current schema version from the MySQL metadata table.
- Constructs the path to the schema file based on the version.
- Initializes the ClickHouse schema by executing the SQL file.
- Panics if schema initialization fails.
§Arguments
clickhouse_client
- Reference to the ClickHouse client.pool
- Reference to the MySQL connection pool.
§Errors
Returns an error if schema loading or initialization fails.