Skip to content

[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

Merged
merged 2 commits into from
May 10, 2019

Conversation

alexkuttig
Copy link
Contributor

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

@alexkuttig
Copy link
Contributor Author

@krizzu I made a new Pull Request to keep the files clean.

@alexkuttig alexkuttig changed the title added parameter for db size on android [Android] Make db size configurable May 10, 2019
Copy link
Member

@krizzu krizzu left a 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 🎉

@@ -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
Copy link
Member

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 :)

Suggested change
# 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

@alexkuttig
Copy link
Contributor Author

Here we go :-)

@tido64
Copy link
Member

tido64 commented May 10, 2019

LGTM. I'm not as savvy on Android as I'd like to be so if @krizzu says to merge, then so be it. 👍

@tido64 tido64 merged commit 608e2d8 into react-native-async-storage:master May 10, 2019
krizzu pushed a commit that referenced this pull request May 10, 2019
# [1.4.0](v1.3.4...v1.4.0) (2019-05-10)

### Features

* Make db size configurable on Android ([#99](#99)) ([608e2d8](608e2d8))
@krizzu
Copy link
Member

krizzu commented May 10, 2019

🎉 This PR is included in version 1.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@mjmasn
Copy link

mjmasn commented May 13, 2019

BTW this was already possible via onCreate() in MainApplication.java:

@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?

@krizzu
Copy link
Member

krizzu commented May 13, 2019

@mjmasn Hey,

I don't think it's worth adding. Setting values in gradle.properties are more user friendly IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants