-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add sqflite_sqlcipher support #602
base: develop
Are you sure you want to change the base?
Conversation
|
||
import 'dao/person_dao.dart'; | ||
import 'entity/person.dart'; | ||
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.