pinchbv / floor

The typesafe, reactive, and lightweight SQLite abstraction for your Flutter applications
https://pinchbv.github.io/floor/
Apache License 2.0
947 stars 190 forks source link

Custom Database File Path #803

Open c15yi opened 7 months ago

c15yi commented 7 months ago

On iOS the database file is generated in the documents folder, that is accessible to the enduser, which I would like to avoid.

Would it be possible to have a method getDatabasePath in the FloorDatabase that provides the database file path? Then we could decide there we want the database file to live at.

I imagine it like this:

abstract class MyDatabase extends FloorDatabase {
  @override
  Future<void> getDatabasePath(String name) {
    // custom implementation
  }
}
ryanheise commented 2 months ago

FYI, there is a PR to support this here: #822 .