Skip to content

add sqflite_sqlcipher support - #602

Open
tuuzed wants to merge 3 commits into
pinchbv:developfrom
tuuzed:f_sqlcipher
Open

add sqflite_sqlcipher support#602
tuuzed wants to merge 3 commits into
pinchbv:developfrom
tuuzed:f_sqlcipher

Conversation

@tuuzed

@tuuzed tuuzed commented Sep 14, 2021

Copy link
Copy Markdown

No description provided.

Comment thread README.md
part 'database.g.dart'; // the generated code will be there

@Database(version: 1, entities: [Person])
@Database(version: 1, entities: [Person], password: '123456')

Copy link
Copy Markdown

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?

Copy link
Copy Markdown
Author

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.

Copy link
Copy Markdown
Collaborator

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.

@dkaera

dkaera commented Jun 20, 2022

Copy link
Copy Markdown
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants