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

[Feature]: Ability to add custom headers, enabling use of OPFS #7813

Open
2 of 3 tasks
rudetrue opened this issue Dec 19, 2024 · 0 comments
Open
2 of 3 tasks

[Feature]: Ability to add custom headers, enabling use of OPFS #7813

rudetrue opened this issue Dec 19, 2024 · 0 comments
Labels

Comments

@rudetrue
Copy link

Description

Ability to set custom headers - so I can use OPFS and SQLite WASM backed by OPFS

Platforms

  • iOS
  • Android
  • Web

Request or proposed solution

I am trying to get the SQLite WASM build backed by OPFS working, and ran into the issue where it requires certain headers be set to work:

After searching I couldn't find a way to do this in Capacitor. It seems that this issue has cropped up a few times, and I think the use of the official SQLite WASM build, and OPFS will become more frequent.

It also seems like a reasonable successor to jeep-sqlite. If I understand the history of the SQLite+WASM library space - the approach of putting SQLite into IndexedDB was a sort of hack to get around not having a place to store the SQLite db file on the web client, and has some downsides (performance and ACID compliance from what I've read). OPFS would resolve those - and open up the possibility of building doing "local-first" type architectures where all platforms use the same configuration for accessing a local SQLite database.

Related issues (Closed as completed but no resolution):

Alternatives

Another option would be to update the capacitor-community/sqlite plugin to use OPFS instead of jeep-sqlite on the "web" platform.

Additional Information

My motivation for exploring alternatives to capacitor-community/sqlite is that I need access to the actual SQLite .db file, from JS (I haven't explored this much - so maybe it's possible). I've also seen some issues regarding performance issues ( capacitor-community/sqlite#602 ) that were concerning - and I assume using the more recent / official SQLite WASM build would be more future proof.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant