Skip to content

create_view(..., ignore=True, replace=True) parameters #106

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

Closed
simonw opened this issue May 2, 2020 · 1 comment
Closed

create_view(..., ignore=True, replace=True) parameters #106

simonw opened this issue May 2, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@simonw
Copy link
Owner

simonw commented May 2, 2020

Two new parameters which specify what should happen if the view already exists. I want this for dogsheep/github-to-sqlite#37

Here's the current create_view() implementation:

def create_view(self, name, sql):
self.conn.execute(
"""
CREATE VIEW {name} AS {sql}
""".format(
name=name, sql=sql
)
)

ignore=True will not do anything if the view exists already.

replace=True will drop and redefine the view - but only if its SQL definition differs, otherwise it will be left alone.

@simonw simonw added the enhancement New feature or request label May 2, 2020
@simonw simonw closed this as completed in 5c1df4e May 2, 2020
simonw added a commit that referenced this issue May 2, 2020
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

1 participant