Skip to content

Commit

Permalink
Merge pull request #49 from henryhueske/task/add-exists-clause-to-dro…
Browse files Browse the repository at this point in the history
…p-view

 Add IF EXISTS clause to DROP VIEW statements
  • Loading branch information
PeterDKay authored Mar 7, 2024
2 parents 99e1e31 + 0705217 commit aa4b0ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.idea/

# End of https://www.toptal.com/developers/gitignore/api/python,macos

Expand Down
3 changes: 3 additions & 0 deletions src/databricks/sqlalchemy/dialect/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ def visit_drop_table(self, drop, **kw):

return text + self.preparer.format_table(drop.element)

def visit_drop_view(self, drop, **kw):
return "\nDROP VIEW IF EXISTS " + self.preparer.format_table(drop.element)


@compiles(ColumnComment, "databricks")
def visit_column_comment(
Expand Down

0 comments on commit aa4b0ff

Please sign in to comment.