Nozbe / WatermelonDB

🍉 Reactive & asynchronous database for powerful React and React Native apps ⚡️
https://watermelondb.dev
MIT License
10.62k stars 600 forks source link

Flipper support #653

Closed ScreamZ closed 3 years ago

ScreamZ commented 4 years ago

Hey, I would like to add Flipper support and I followed this tutorial:

https://fbflipper.com/docs/setup/databases-plugin.html

But I need the database path, could you help me? Thanks

kesha-antonov commented 4 years ago

Interested too

kesha-antonov commented 4 years ago

@ScreamZ Did you build RN 0.62 with WatermelonDB? It gives me errors

cesargdm commented 4 years ago

@kesha-antonov Getting errors too

kesha-antonov commented 4 years ago

Without Flipper it builds

ghost commented 4 years ago

It builds for me with Flipper. To make WatermelonDBs' database discoverable, I followed the docs and replaced:

databaseFiles.add("...path_to_your_db...")

With:

String watermelondb = context.getDatabasePath("watermelon.db").getPath().replace("/databases", "");
databaseFiles.add(new File(watermelondb));
kilbot commented 4 years ago

@kesha-antonov @cesargdm There seems to be a conflict with Flipper on iOS, but you can use Flipper to debug your Android app using the method given by @ScreamZ.

Your ReactNativeFlipper.java should look something like this - https://gist.github.com/kilbot/253e4bfb0b931f9dfc23a45f71564bf7 - where path_to_your_db should match the dbName passed into the SQLiteAdapter (watermelon is the default).

Question for @zecakeh: is it possible to loop through multiple database files?

ghost commented 4 years ago

@kilbot Of course, just add as many databaseFiles.add(new File("path/to/database.db")); as needed. The code in the docs includes both databases that are in the context and a custom one.

stale[bot] commented 4 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

bezenson commented 2 years ago

Your ReactNativeFlipper.java should look something like this - https://gist.github.com/kilbot/253e4bfb0b931f9dfc23a45f71564bf7 - where path_to_your_db should match the dbName passed into the SQLiteAdapter (watermelon is the default).

This is something that should be added to documentation :)

LukasMod commented 1 year ago

For non expo users i recommend react-native-flipper-databases Works fine for me (tested on Android, rn 0.71.1 and watermelon 0.27)

rahulreddyRR commented 6 months ago

@LukasMod database is not showing up sometimes using react-native-flipper-databases

LukasMod commented 6 months ago

Yes. Finally i dropped it for default flipper datebase plugin