Is it possible to integrate PostgreSQL with watermelon db
I love the watermelon DB and am planning to use it on some applications but the bad news is that am using Postgres. So what to know if it's possible to integrate the two and how to integrate them.
How are you running Postgres on frontend side?
Am using react on frontend 😀
You can run whatever you want on the backend, if you write a sync adapter for it
@radex thanks alot 🤗🥳
I need the example react and postgres. Anyware have this example?
@radex are there any instructions on what needs to be used to connect WatermelonDB to a custom Adapter. I am willing to write it for Postgresql but looks like there aren't any docs or mentions of how to start on it and reverse engineering your code in /adapters is really long process.
@gyto you mean sync backend?
@radex I assume so. My goal is to connect my existing project that already has PostgreSQL DB. Writing the Sync Backend I think is not complicated as I saw your LokiJs setup. But I still struggle to understand the architecture of the watermelonDB itself. Are you going to introduce the sync backend instructions eventually?
@gyto I think you're confusing the idea of an adapter (the abstraction layer between Watermelon's high-level APIs and a physical local database -- e.g. sqlite, LokiJS) and the idea of a sync backend. As for the latter, this document contains the specification required for compatibility with Watermelon's built-in sync engine: https://nozbe.github.io/WatermelonDB/Advanced/Sync.html
@weberth-oliveira Did you end up finding any postgres and WatermelonDB sync examples?
@KrisLau per the conversation above, @radex pointed that it was not implemented yet, however, you can use adapter to tweak it to your needs.
@gyto Thanks! I actually found some examples:
- https://github.com/FLVieira/sync-api/blob/master/src/app/controllers/SynchronizationController.js
- https://github.com/rodrigosuman/rn-offline-first-app/tree/main/backend/src/services/sync