WatermelonDB icon indicating copy to clipboard operation
WatermelonDB copied to clipboard

Support Expo

Open Obhenimen opened this issue 8 months ago • 3 comments

Please can you add support for expo. This plugin https://github.com/morrowdigital/watermelondb-expo-plugin is not compatible with the latest version of watermelondb

Obhenimen avatar Apr 19 '25 21:04 Obhenimen

Currently, WatermelonDB uses its own mechanism to setup SQLite on Android/iOS which is meant for directly working with React Native. In React Native, it is common and frequent to touch the native generated app and its build configuration but the catch is - you can't as easily upgrade because now you have your logic spread across the native code base as well which need to be ported to the newer version of the React Native.

Expo takes a different approach where the native apps are always generated on demand and no manual editing is made to the native apps. If any changes are to be made to the native code base, they are through plugins.

Having said that, I guess we would need a new adapter that would close the case for Expo:

  • An sqlite-expo adapter. That should work by just enabling SQLite on Expo as documented here. This adapter by the virtue of Expo, would work for web as well though support is experimental and requires enabling wasm support in the metro bundler.

mohsinhijazee avatar May 04 '25 14:05 mohsinhijazee

It's way more simple than that. Just npx expo prebuild and follow the setup instructions for each platform.

ghost avatar May 23 '25 19:05 ghost

There is a fork that support expo 52/53 https://github.com/Nozbe/WatermelonDB/issues/1892#issuecomment-2852627748 https://github.com/LovesWorking/watermelondb-expo-plugin-sdk-52-plus

rlgo avatar Jul 14 '25 02:07 rlgo