Skip to content

Commit

Permalink
Merge pull request #22 from wusanny/grant_select
Browse files Browse the repository at this point in the history
add grant select logic
  • Loading branch information
wusanny authored Jan 21, 2025
2 parents 8da9f90 + 6451e38 commit 872cbd5
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 15 deletions.
9 changes: 7 additions & 2 deletions dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,10 @@ flags:
models:
x_project:
# Applies to all files under models/example/
+materialized: table
+access: public
+materialized: view

# flags:
# warn_error_options:
# error:
# - DeprecatedModel
# - DeprecatedReference
Empty file removed dependencies.yml
Empty file.
2 changes: 1 addition & 1 deletion models/bar.sql
Original file line number Diff line number Diff line change
@@ -1 +1 @@
select 1 as foo
select 1 as whylikedat
6 changes: 1 addition & 5 deletions models/foo.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
{{ config(
snowflake_warehouse = get_warehouse('large')
)
}}
select 1 as id
select 1 as goddamit
1 change: 1 addition & 0 deletions models/potato.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select 1 as brown
31 changes: 24 additions & 7 deletions models/schema.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
version: 2

models:
- name: stg_orders
description: staging table for orders
columns:
- name: id
description: "The primary key for this table"
tests:
- unique
- name: bar
description: "Items dimensional model aggregating data from multiple sources for a unified view of item details."
config:
grants:
+select: ['{%- if target.name == "dev_re" -%} tester
{%- elif target.name == "prod" -%} sys_admin
{%- endif -%}'
]
- name: foo
description: "Items dimensional model aggregating data from multiple sources for a unified view of item details."
config:
grants:
+select: ['{%- if target.name == "dev_re" -%} tester
{%- elif target.name == "prod" -%} sys_admin
{%- endif -%}'
]
- name: potato
description: "Items dimensional model aggregating data from multiple sources for a unified view of item details."
config:
grants:
+select: ['{%- if target.name == "dev_re" -%} tester
{%- elif target.name == "prod" -%} sys_admin
{%- endif -%}'
]

0 comments on commit 872cbd5

Please sign in to comment.