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

jeep-sqlite alternative #583

Open
mustafa0x opened this issue Aug 28, 2024 · 4 comments
Open

jeep-sqlite alternative #583

mustafa0x opened this issue Aug 28, 2024 · 4 comments

Comments

@mustafa0x
Copy link

mustafa0x commented Aug 28, 2024

First, I want to thank the maintainer for the huge effort they've put into this incredibly valuable plugin.

Second, I want to ask: for web, is there an alternative to jeep-sqlite? I've noticed two issues with it:

  1. Very large size. It adds 500kb to my javascript bundle (excluding the wasm file). More than the rest of my app, combined.
  2. It requires calling saveToStore after any changes. This creates an easy pitfall: the developer makes changes create/update/delete but forgets to call saveToStore.

I suggest something like rhashimoto's IDBBatchAtomicVFS.

@oliveryasuna
Copy link

Theoretically, you could proxy the web implementation and use whatever you want.

@jepiqueau
Copy link
Collaborator

@mustafa0x

  • regarding the saveToSore comment, i would like to say in earlier version the saveToStore was done for any new INSERT, UPDATE or DELETE sql commands. it has been removed as when developers where loading large batch of data it was taking too long to execute the process. A property has been added to the Stencil component autosave with default to false. Set this property to true when you set the jeep-sqlite component in your app, it will allow you to not care about the saveToStore and then fix the easy pitfall.
  • regarding the large size comment it is mainly due to the size of the sql-wasm.wasm which is intrinsec to sql.js. The only way to limit the size will be to move away from sql.js which means rewriting the stencil component.

Hope this clarify.

@mustafa0x
Copy link
Author

mustafa0x commented Sep 22, 2024

Thanks you so much @jepiqueau, I'm very grateful for the tremendous effort you've put into this very-useful plugin!

the large size is mainly due to the size of the sql-wasm.wasm

The jeep-sqlite stencil component alone is >500kb (the sql-wasm is 640kb.)

https://unpkg.com/browse/[email protected]/dist/esm/

image

@jepiqueau
Copy link
Collaborator

@mustafa0x see also my answer to issue#579

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

No branches or pull requests

4 participants