Skip to content

Conversation

simolus3
Copy link
Contributor

@simolus3 simolus3 commented Sep 29, 2025

This adds the PowerSyncDatabase.inMemory factory to create PowerSync databases backed by a single in-memory connection.

This utility simplifies the test setup for users:

  1. It doesn't need an open factory, so users can write tests in commonIntegrationTest instead of having to setup expect / actuals in tests.
  2. One doesn't have to create a temporary file path for each test, databases are isolated on their own.
  3. No cleanup logic is required.

We should continue testing the core logic with "real" file-backed databases to ensure the pool works, but having a single in-memory connection is useful to test other packages that can expect :core to behave correctly. This adopts that for the SQLDelight integration, I'm also writing tests for the Supabase connector where these changes would simplify the setup.

@simolus3 simolus3 merged commit 683cc69 into main Sep 30, 2025
8 checks passed
@simolus3 simolus3 deleted the test-pool branch September 30, 2025 10:04
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