Skip to content
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

Automatically purge autoimport.db when there is schema change #565

Closed
3 tasks done
lieryan opened this issue Dec 1, 2022 · 2 comments · Fixed by #697
Closed
3 tasks done

Automatically purge autoimport.db when there is schema change #565

lieryan opened this issue Dec 1, 2022 · 2 comments · Fixed by #697
Milestone

Comments

@lieryan
Copy link
Member

lieryan commented Dec 1, 2022

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 from rope.VERSION, a hash of rope/contrib/autoimport/models.py file, and a hash of user preferences. (Implement version hash #631)
  • create a new metadata table, this table should contain a single column named version_hash
  • if the version_hash changes, then the database should be considered outdated and autoimport should re-scan the environment

Additional context

@lieryan lieryan added this to the 1.7.0 milestone Dec 1, 2022
@bagel897
Copy link
Contributor

bagel897 commented Dec 2, 2022

Can we also version the config so we can handle updates to settings like underlined?

@lieryan
Copy link
Member Author

lieryan commented Dec 3, 2022

@bagel897 thanks, that's a very good point. I've added it to the ticket.

@lieryan lieryan mentioned this issue Dec 28, 2022
2 tasks
@lieryan lieryan removed this from the 1.7.0 milestone Jan 17, 2023
@lieryan lieryan added this to the 1.9.0 milestone Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants