Skip to content

fix: construct open options with defined properties only #638

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

a11rew
Copy link

@a11rew a11rew commented Jun 19, 2025

Overview

Closes #635

This PR resolves an issue where @powersync/op-sqlite would consistently override the default database location behaviour of the upstream op-sqlite package. This broke features like iOS App Groups, which depend on the upstream package reading externally defined values (in the Info.plist) to determine the correct database path.

Changes

To fix this, the openDatabase method has been updated to conditionally add the location property to the open() options only when a custom dbLocation is provided. When it is not provided, the property is omitted, allowing op-sqlite's default location logic to run as intended.

Removed the getDbLocation helper method as well because its logic was a duplication of the default platform-specific path resolution already handled by the upstream op-sqlite package and is no longer needed when @powersync/op-sqlite does not handle determining the default database path

Copy link

changeset-bot bot commented Jun 19, 2025

🦋 Changeset detected

Latest commit: cd8ef21

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@powersync/op-sqlite Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@stevensJourney
Copy link
Collaborator

stevensJourney commented Jun 21, 2025

Thanks for this! The code looks good to me. We'll do some smoke testing on our side next week before merging.

@Chriztiaan
Copy link
Contributor

Tested upgrades for both iOS and Android. Same path is used before and after the upgrade for both platforms (synced data to old version of app, disabled connect call, updated library, verified data is still being queries offline).

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.

@powersync/op-sqlite usage with App Groups
3 participants