-
Notifications
You must be signed in to change notification settings - Fork 0
Enable package to use Snowflake Organisation Account views #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 27 commits
5a9028b
1c2e124
e1aa209
9f3ae59
9441a6b
b454928
c622d6f
f575b39
eec7af9
665d6b2
05986b9
f6596b1
da2a75b
2d5b055
940683f
b48479a
920a041
b89364e
fdd0501
ee96481
f0a7fff
bf5679c
b53faa9
cb5585c
5576c07
f76aca5
2cd82b7
a2b34c0
701fe29
29d325e
62cb54b
2add855
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{% macro add_account_columns() %} | ||
{% if var('uses_org_view', false) %} | ||
organization_name, | ||
account_name, | ||
account_locator, | ||
{% else %} | ||
current_organization_name() as organization_name, | ||
current_account_name() as account_name, | ||
current_account() as account_locator, | ||
{% endif %} | ||
{% endmacro %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{% macro generate_scoped_unique_key(base_fields) %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just realised that if we're now adding the account_name column everywhere, we can always add the account_name to the unique key config! :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just realised this too!! 😆 my only concern was for backwards compatibility for incremental models, account_name would be null for historical data but I think in this case it might be ok to have nulls in the unique_key since the other fields will be unique anyway. other option would be to create a new column called _unique_key that uses There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think a composite PK works totally fine without making a new column - honestly I could go either way. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. perfect - lets leave it as it! thanks Niall! |
||
{% if var('uses_org_view', false) %} | ||
['account_name', {{ base_fields|join(', ') }}] | ||
{% else %} | ||
{{ base_fields }} | ||
{% endif %} | ||
{% endmacro %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌