add sqflite_sqlcipher support - #602
Conversation
| part 'database.g.dart'; // the generated code will be there | ||
|
|
||
| @Database(version: 1, entities: [Person]) | ||
| @Database(version: 1, entities: [Person], password: '123456') |
There was a problem hiding this comment.
Does this mean the user has to put the password inside the annotation always? Or is there an option to override this in a code?
There was a problem hiding this comment.
Writing the password in the annotation is an option. There is another option. Set the password when building the FloorDatabase object at run time.
Example:
final db = $FloorAppDatabase
.databaseBuilder(
/*name*/ 'app_database.db',
/*password*/ '123456',
)
.build();The priority of the password set at run time is higher than that written in the annotation.
There was a problem hiding this comment.
@tuuzed setting password in the annotation means that we have to use a constant for it. I think we should not allow this in order to avoid weak security problems.
|
These changes limit the use of Floor for all platforms, so I think we need to create a separate package that supports sqflite_sqlcipher encryption only for Andriod/IOS/MacOS, and in the future figure out how to support desktop. |
No description provided.