Skip to content

Add in-memory helpers for Swift SDK#326

Open
simolus3 wants to merge 1 commit intomainfrom
in-memory-helper
Open

Add in-memory helpers for Swift SDK#326
simolus3 wants to merge 1 commit intomainfrom
in-memory-helper

Conversation

@simolus3
Copy link
Contributor

In tests for our Swift SDK, we use :memory: as a file path with the intention of creating in-memory databases. This isn't actually the case though, :memory: is appended to the default database directory to create a database file of that name.

This adds a method to :PowerSyncKotlin that will let the Swift SDK open in-memory databases. The Swift SDK can't call PowerSyncDatabase.openInMemory because that requires a CoroutineScope we can't construct in Swift. So I've hidden those methods and added another factory next to openPowerSyncWithPool to create an in-memory connection.

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

Comments