Last active
February 24, 2022 17:19
-
-
Save dave-connors-3/e1677b80419d9f4e05fbfb0124a5f578 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% macro check_dupes(model, column_name) %} | |
with errors as ( | |
{{ test_unique(model, column_name) }} | |
) | |
select * from {{ model }} | |
inner join errors on {{ model.name }}.{{ column_name }} = errors.unique_field | |
order by {{ column_name }} | |
{% endmacro %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment