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

Multithread db #915

Merged
merged 13 commits into from
Oct 24, 2022
Merged

Multithread db #915

merged 13 commits into from
Oct 24, 2022

Conversation

mplorentz
Copy link
Member

@mplorentz mplorentz commented Oct 13, 2022

#884 This updates ViewDatabase to use multiple database connections. Sqlite.swift closes connections when a reference to them goes out of scope. This means I could basically just replace getOpenDB() function that used to return the one shared connection with checkoutConnection() that opens a new connection each time it is called.

It would probably be more performant to have some kind of connection pool of a finite size. Then connections would just be reused. But this was easier and speeds up our database a lot, so I'm doing it the simple way for now.

@mplorentz
Copy link
Member Author

Hm, these unit tests passed locally for me. I will look into them today.

@martindsq martindsq marked this pull request as ready for review October 21, 2022 17:14
@rabble rabble merged commit 1fd21cd into main Oct 24, 2022
@rabble rabble deleted the multithread-db branch October 24, 2022 23:51
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.

None yet

3 participants