Skip to content

Commit 774bb4e

Browse files
author
Michael Myaskovsky
committed
added macros relevant to the cloud
1 parent 2cfcbd3 commit 774bb4e

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

macros/utils/cross_db_utils/generate_elementary_profile_args.sql

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,19 @@
6868
]) %}
6969
{% endmacro %}
7070

71+
{% macro clickhouse__generate_elementary_profile_args(method, elementary_database, elementary_schema) %}
72+
{% do return([
73+
_parameter("type", target.type),
74+
_parameter("host", target.host),
75+
_parameter("port", target.port),
76+
_parameter("user", target.user),
77+
_parameter("password", "<PASSWORD>"),
78+
_parameter("dbname", elementary_database),
79+
_parameter("schema", elementary_schema),
80+
_parameter("threads", target.threads),
81+
]) %}
82+
{% endmacro %}
83+
7184
{% macro databricks__generate_elementary_profile_args(method, elementary_database, elementary_schema) %}
7285
{% set parameters = [
7386
_parameter("type", target.type),

macros/utils/cross_db_utils/get_profile_creation_query.sql

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,15 @@ ALTER DEFAULT PRIVILEGES IN SCHEMA {{ parameters["schema"] }} GRANT SELECT ON TA
9292
{% endmacro %}
9393

9494

95+
{% macro clickhouse__get_profile_creation_query(parameters) %}
96+
-- Create clickhouse user
97+
CREATE USER {{ parameters["user"] }} identified by '{{ parameters["password"] }}';
98+
99+
-- Grant select on all tables in the Elementary schema to the user
100+
grant select on {{ parameters["schema"] }}.* to {{ parameters["user"] }}
101+
{% endmacro %}
102+
103+
95104
{# Databricks, BigQuery, Spark #}
96105
{% macro default__get_profile_creation_query(parameters) %}
97106
{% do exceptions.raise_compiler_error('User creation not supported through sql using ' ~ target.type) %}

0 commit comments

Comments
 (0)