-
Notifications
You must be signed in to change notification settings - Fork 472
[Android] Make db size configurable #99
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
[Android] Make db size configurable #99
Conversation
@krizzu I made a new Pull Request to keep the files clean. |
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.
Great 👏
Left one comment and I believe we're good to go.
Any more thoughts @tido64 ? If no, feel free to merge it whenever you have a time 🎉
example/android/gradle.properties
Outdated
@@ -16,3 +16,6 @@ | |||
# This option should only be used with decoupled projects. More details, visit | |||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects | |||
# org.gradle.parallel=true | |||
|
|||
# If you know what you're doing, you can uncomment this line and increase the size of db |
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.
Let's be more gentle :)
# If you know what you're doing, you can uncomment this line and increase the size of db | |
# This is an example of how you can change default DB size (6MB) to 10MB |
Here we go :-) |
LGTM. I'm not as savvy on Android as I'd like to be so if @krizzu says to merge, then so be it. 👍 |
# [1.4.0](v1.3.4...v1.4.0) (2019-05-10) ### Features * Make db size configurable on Android ([#99](#99)) ([608e2d8](608e2d8))
🎉 This PR is included in version 1.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
BTW this was already possible via @Override
public void onCreate() {
super.onCreate();
long size = 25L * 1024L * 1024L;
ReactDatabaseSupplier.getInstance(getApplicationContext()).setMaximumSize(size);
} Not sure if it's worth adding that to the documentation as well? |
@mjmasn Hey, I don't think it's worth adding. Setting values in |
# [1.4.0](react-native-async-storage/async-storage@v1.3.4...v1.4.0) (2019-05-10) ### Features * Make db size configurable on Android ([#99](react-native-async-storage/async-storage#99)) ([608e2d8](react-native-async-storage/async-storage@608e2d8))
Summary:
Since I do need a larger max db size, I added an optional parameter to gradle properties. This makes the maximum db size configurable, while keeping the standard size of 6L * 1024L * 1024L when not giving any value. (like discussed in #83 and #98 )
Test Plan:
1.) Use test app
2.) write > 6MB data to async storage
3.) change android/gradle.properties of testapp and uncomment the last line
4.) make new build
5.) write additional data