Parse-SDK-Flutter
Parse-SDK-Flutter copied to clipboard
feat: change the database path for IOS from ApplicationDocumentsDirectory to LibraryDirectory
New Pull Request Checklist
- [x] I am not disclosing a vulnerability.
- [x] I am creating this PR in reference to an issue.
Issue Description
Related issue: #791
Approach
Using LibraryDirectory as a path for the database.
TODOs before merging
This is a breaking change for ios platform because the SDK now will look for the "parse.db" in the LibraryDirectory
rather than the ApplicationDocumentsDirectory
.
- [ ] Add tests
- [ ] Add changes to documentation (guides, repository pages, in-code descriptions)
- [ ] A changelog entry
Thanks for opening this pull request!
- ❌ Please link an issue that describes the reason for this pull request, otherwise your pull request will be closed. Make sure to write it as
Closes: #123
in the PR description, so I can recognize it.
We can support the old directory path by doing something like:
Future<String> getDatabaseDirectory() async {
if (Platform.isIOS) {
if(await _isDatabaseFileExistsInOldPath()){
return (await path_provider.getApplicationDocumentsDirectory()).path;
}
return (await path_provider.getLibraryDirectory()).path;
} else {
return (await path_provider.getApplicationDocumentsDirectory()).path;
}
}
Future<bool> _isDatabaseFileExistsInOldPath() async {
final oldIosDatabaseDirPath =
(await path_provider.getApplicationDocumentsDirectory()).path;
final oldDatabaseFile =
path.join('$oldIosDatabaseDirPath/parse', 'parse.db');
if (await File(oldDatabaseFile).exists()) {
return true;
}
return false;
}
What do you think?
@parse-community/flutter-sdk Any suggestion?
@Nidal-Bakir any particular reason for closing this?
@parse-community/flutter-sdk-review should this PR be merged?
It has bee
I will reformat the title to use the proper commit message syntax.
The PR is out of date and it seems the author didn't give the maintainers the option to rebase their PR, so we cannot use this. Could someone open a new PR with these changes?
@mtrezza Sorry for this. I was busy in the past couple of months. I will open a new PR with these changes. and help you guys develop this package. I have free time to work on this project now.
Great, looking forward to it