Automatically purge autoimport.db when there is schema change
lieryan opened this issue · 2 comments
lieryan commented
Is your feature request related to a problem? Please describe.
Currently, rope/contrib/autoimport/sqlite.py creates an sqlite database at autoimport.db that caches the result of scanning site-packages
for names that are useful during autoimport.
Currently, when you upgrade rope version and the database schema has changed, it doesn't have any way to know that it should purge the database and do a re-scan.
Describe the solution you'd like
-
version_hash
should be calculated fromrope.VERSION
, a hash ofrope/contrib/autoimport/models.py
file, and a hash of user preferences. (#631) - create a new
metadata
table, this table should contain a single column namedversion_hash
- if the
version_hash
changes, then the database should be considered outdated and autoimport should re-scan the environment
Additional context
bagel897 commented
Can we also version the config so we can handle updates to settings like underlined?