427 allows passing schema name in create_view() and create_materialized_view() #597
Open
nestguti wants to merge 5 commits intokvesteri:masterfrom
Open
427 allows passing schema name in create_view() and create_materialized_view() #597nestguti wants to merge 5 commits intokvesteri:masterfrom
nestguti wants to merge 5 commits intokvesteri:masterfrom
Conversation
|
Hi, reviewing the code I wonder if DropView has support for schema as CreateView. Maybe I'm wrong but it appears it doesn't. |
Author
Yes, It does: @compiler.compiles(DropView)
def compile_drop_materialized_view(element, compiler, **kw):
return 'DROP {}VIEW IF EXISTS {} {}'.format(
'MATERIALIZED ' if element.materialized else '',
compiler.dialect.identifier_preparer.format_table(element.table, use_schema=True),
'CASCADE' if element.cascade else ''
) |
Collaborator
|
@nestguti thanks for pointing that out. I edited your comment so it would show up as highlighted Python. In the future you can use this syntax to accomplish the same thing: ```python
for code in example:
print("Use three backticks and the name of the language!")
print("Then end the code block with another three backticks!")
``` |
Author
Thanks! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update create_view() and create_materialized_view() functions to pass schema name for Postgres DB
add test unit test_views_schema.py and update test_views.py