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

feat: rebuild SQLite when project migrations occur #949

Merged
merged 6 commits into from
Oct 30, 2024
Merged

Conversation

EvanHahn
Copy link
Contributor

@EvanHahn EvanHahn commented Oct 30, 2024

See #436.

@EvanHahn EvanHahn requested a review from gmaclennan October 30, 2024 16:04
@EvanHahn EvanHahn marked this pull request as draft October 30, 2024 16:05
@EvanHahn EvanHahn marked this pull request as ready for review October 30, 2024 16:14
@awana-lockfile-bot
Copy link

package-lock.json changes

Click to toggle table visibility
Name Status Previous Current
multi-core-indexer UPDATED 1.0.0-alpha.10 1.0.0

Copy link
Member

@gmaclennan gmaclennan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok looks good apart from one code clarity suggestion. However I think we should also include in this re-indexing of the projectSettingsTable (in MapeoManager) which I think needs the same treatment?

src/mapeo-project.js Outdated Show resolved Hide resolved
Copy link
Member

@gmaclennan gmaclennan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final thoughts, one way of doing this in the future would be to compare just the indexed tables in the sqlite_schema table, comparing the sql column, to detect changes. That way we would avoid re-indexing if we change the schema of a table that is not coming from our indexer.

@EvanHahn
Copy link
Contributor Author

Ok looks good apart from one code clarity suggestion. However I think we should also include in this re-indexing of the projectSettingsTable (in MapeoManager) which I think needs the same treatment?

Done in 5084bb2. (I didn't have an easy way to test this so I didn't.)

Final thoughts, one way of doing this in the future would be to compare just the indexed tables in the sqlite_schema table, comparing the sql column, to detect changes. That way we would avoid re-indexing if we change the schema of a table that is not coming from our indexer.

That's a much better idea. I'll consider doing that in a followup.

@EvanHahn EvanHahn requested a review from gmaclennan October 30, 2024 17:19
@EvanHahn EvanHahn merged commit 5aa2618 into main Oct 30, 2024
8 checks passed
@EvanHahn EvanHahn deleted the evanhahn/436 branch October 30, 2024 17:49
@EvanHahn EvanHahn changed the title feat: rebuild SQLite when migrations occur feat: rebuild SQLite when project migrations occur Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants