Skip to content
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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

Conversation

tuuzed
Copy link

@tuuzed tuuzed commented Sep 14, 2021

No description provided.


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')
Copy link

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
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
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
Copy link
Collaborator

dkaera commented Jun 20, 2022

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