Watermelondb: Flipper support

Created on 27 Mar 2020  路  8Comments  路  Source: Nozbe/WatermelonDB

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

Most helpful comment

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));

All 8 comments

Interested too

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

@kesha-antonov Getting errors too

Without Flipper it builds

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));

@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?

@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.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mjstelly picture mjstelly  路  7Comments

roots-ai picture roots-ai  路  4Comments

MikeWoots picture MikeWoots  路  5Comments

jdnichollsc picture jdnichollsc  路  4Comments

binbinla picture binbinla  路  3Comments