thanhnguyen2187 / crypta

An offline-first code snippet manager
https://thanhnguyen2187.github.io/crypta/
MIT License
7 stars 0 forks source link

Replace `ws4sqlite` with Turso #56

Open thanhnguyen2187 opened 6 months ago

thanhnguyen2187 commented 6 months ago

I really considered allowing user to pick between ws4sqlite and Turso, but it will complicate the code a lot for a bit more flexibility, which is not something we should do in this phase.

On why flexibility is complicated, at the last commit of sqliterg-integration, the code has this kind of dependency:

  1. settingsStore
  2. sqlitergExecutorStore
  3. remoteSnippetStore
  4. higherSnippetsStore
  5. dataStateStore
  6. dataManager

Where 6 and 5 and 4 depends on 3, and 3 depends on 2, and 2 depends on 1. Choosing between ws4sqlite and Turso must happen in 1, which propagates to the "upper layers" as well.

thanhnguyen2187 commented 6 months ago

Since we have a chance to do everything "brand new", we should also consider using https://github.com/square/svelte-store to simplify the async store logic.

Checklist: