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

Enable default inclusion of views in MetaData object (SQL database) #459

Closed
dat-a-man opened this issue May 11, 2024 · 1 comment · Fixed by #468
Closed

Enable default inclusion of views in MetaData object (SQL database) #459

dat-a-man opened this issue May 11, 2024 · 1 comment · Fixed by #468
Assignees

Comments

@dat-a-man
Copy link
Collaborator

dat-a-man commented May 11, 2024

Feature description

Please enable the MetaData.reflect function in dlt to include views by default when accessing database resources. Currently, views are not included by default, requiring additional steps to configure, leading to potential oversight.

Are you a dlt user?

Yes, I run dlt in production.

Use case

When extracting and loading views from a SQL database, users need to manually enable view inclusion by setting MetaData.reflect(bind=engine, views=True) method. This additional step can be overlooked and is not initially intuitive.

Proposed solution

Modify the default behavior of the MetaData object to include views by default by setting views=True in the MetaData.reflect method. This would streamline processes for users who manage databases and want to load views.

Related issues

No response

@dat-a-man dat-a-man changed the title Enable Default Inclusion of Views in MetaData Object (SQL database) Enable default inclusion of views in MetaData object (SQL database) May 11, 2024
@rudolfix rudolfix transferred this issue from dlt-hub/dlt May 13, 2024
@rudolfix
Copy link
Contributor

To implement that correctly:

  1. check that sql_table can extract a view by writing a test even without setting any flags in sql alchemy
  2. add a flag to sql_database to include views in reflection (default: false)
  3. write tests that check if the flag works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Ready for Deployment
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants