dogsheep / github-to-sqlite

Save data from GitHub to a SQLite database
https://github-to-sqlite.dogsheep.net/
Apache License 2.0
402 stars 43 forks source link

Mechanism for creating views if they don't yet exist #37

Closed simonw closed 4 years ago

simonw commented 4 years ago

Needed for #36 #10 #12

simonw commented 4 years ago

This will check if the view exists and has the exact same matching definition as the one we want. If it doesn't, we will drop it (if it exists) and recreate it.

simonw commented 4 years ago

It should only create views if the underlying tables exist.

simonw commented 4 years ago

I can use the new .create_view(..., replace=True) parameter in sqlite-utils 2.7.2 for this.