Skip to content

Support read-only databases#422

Open
simolus3 wants to merge 1 commit into
OP-Engineering:mainfrom
powersync-community:readonly-option
Open

Support read-only databases#422
simolus3 wants to merge 1 commit into
OP-Engineering:mainfrom
powersync-community:readonly-option

Conversation

@simolus3

Copy link
Copy Markdown

This adds a readOnly option supported by open and openAsync (both on the web and on native platforms):

  • On the web, enabling that option passes flags: 'r' to the constructor. Otherwise, we pass c (for create, write, read; the default).
  • On native platforms, this passes a readOnly flag along to sqlite3_open_v2, where we use the same logic to determine flags to include.

I have tested these changes on an iOS simulator, I didn't look into web tests.

Closes #421.

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.

[Request]: Open databases as read-only

1 participant