WatermelonDB icon indicating copy to clipboard operation
WatermelonDB copied to clipboard

Any solution for FMDB conflict?

Open KennanChan opened this issue 2 years ago • 4 comments

I am trying to setup watermelon db on an existing RN project which already uses FMDB to access SQLite database. When I build the project, XCode gives me a bunch of duplicate symbol errors between FMDB and WatermelonDB. I am new to iOS development. Does anyone know how to resolve it?

KennanChan avatar Sep 01 '22 02:09 KennanChan

Is there a reason you are using two different client DBs? I would assume that would cause complications even if you manage to resolve the duplicate symbol errors but I'm not 100% sure

KrisLau avatar Sep 08 '22 18:09 KrisLau

Is there a reason you are using two different client DBs? I would assume that would cause complications even if you manage to resolve the duplicate symbol errors but I'm not 100% sure

I am now planning to implement a WDB SQLite adapter with FMDB myself. An experienced iOS developer told me that same symbol cannot be declared multiple times. OC does not provide the namespace thing. The thing I don't get through is why WDB ships the header files of FMDB. Why FMDB should be "merged" into WDB rather than as a dependency of WDB.

My case is: I use WDB in a mobile web project which integrates into an RN project by WebView Currently I use LokiAdapter so database resides in the browser's IndexedDB. But the database grows so fast. The storage limit of IndexedDB is a fatal issue now. To resolve the issue, I created a new WDB adapter in the mobile web project to replace LokiAdapter. The adapter bridges adapter interface calls to a corresponding SQLiteAdapter created in RN through the message tunnel provided by WebView. The adapter works as expected on an RN example project but fails to build on my real-world project due to FMDB conflict.

KennanChan avatar Sep 10 '22 15:09 KennanChan

@KennanChan I'm not really experienced with this myself so hopefully @radex can offer some insight into solving this

KrisLau avatar Sep 12 '22 13:09 KrisLau

@KennanChan It would be preferable for FMDB in 🍉 to be a CocoaPods dependency. This way, 🍉 and you could reuse the same source for FMDB.

I highly encourage you to send a pull request where 🍉 is reworked slightly to use FMDB via CP. This shouldn't be too difficult to set up

radex avatar Sep 21 '22 10:09 radex

Closing, given inactivity. Still happy to a accept FMDB via CP pull requests

radex avatar Feb 03 '23 21:02 radex