Skip to content
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

alias models to change their names in the database #637

Closed
drewbanin opened this issue Jan 8, 2018 · 4 comments
Closed

alias models to change their names in the database #637

drewbanin opened this issue Jan 8, 2018 · 4 comments
Labels
enhancement New feature or request

Comments

@drewbanin
Copy link
Contributor

drewbanin commented Jan 8, 2018

This could be useful when paired with custom schemas. For example, there could be a users table in both the snowplow_analytics and product_analytics schemas. Behind these scenes, these models would be named something like snowplow_users.sql and product_users.sql, respectively.

Config would look like:

-- models/snowplow/snowplow_users.sql

{{ config(alias='users', schema='snowplow_analytics') }}

select * from ...

dbt would need to enforce uniqueness between schema + aliased_name

@drewbanin drewbanin added the enhancement New feature or request label Jan 8, 2018
@abelsonlive
Copy link
Contributor

👍 This would be tremendously helpful when migrating to dbt so as to ensure parity with existing data infrastructures that were not built with dbt in mind.

@abelsonlive
Copy link
Contributor

Happy to help contribute to this :)

@drewbanin
Copy link
Contributor Author

I just merged #800 which implements this feature. Thanks for all of your hard work @abelsonlive and @jon-rtr :)

This will go out in our 0.10.2 release!

@abelsonlive
Copy link
Contributor

abelsonlive commented Jul 4, 2018

thank you so much for bringing this one home! happy independence day. go eat a burger :p

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants