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

Update examples/docs to use DatabasePool for non-in-memory #16

Merged
merged 2 commits into from
Feb 17, 2025

Conversation

stephencelis
Copy link
Member

Database pools enable WAL mode and better multithreaded performance, so let's steer folks in that direction in the demo apps.

(I didn't update the case studies app since each study is very small and think we should do the minimal setup required.)

$0.defaultDatabase = .appDatabase
return try! $0.defaultDatabase.write { db in
let (remindersList, reminder) = try! prepareDependencies {
$0.defaultDatabase = try Reminders.appDatabase(inMemory: true)
Copy link
Member Author

Choose a reason for hiding this comment

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

I decided to preserve the throws since maybe folks would want to show an error with bug submission info upon launch instead of crash.

@stephencelis stephencelis merged commit 8b9bfe7 into main Feb 17, 2025
2 checks passed
@stephencelis stephencelis deleted the db-pool branch February 17, 2025 20:50
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