greenrobot / android-database-performance

Android Database Performance Benchmarks
Apache License 2.0
80 stars 16 forks source link

Sqlcipher support #25

Closed raiym closed 4 years ago

raiym commented 4 years ago

I added SQLCipher support and tests are the same as SQLite except two differences:

  1. getWritableDatabase() now invokes with string argument, because SQLCipher requires password for database encryption.
  2. database.delete() method now uses empty array with whereArgs instead of null. Since this method does not check whether array is initialized or not, it directly checks for the length of the array.
  3. I fixed build failures that I encountered. I made minimal changes. As follows:

First of all when I tried to build it and run the tests build was failing. I updated build Gradle to 4.3 and android plugin to 3.0.0. I also tried to keep 4.1 but I faced several build issues.

Second. I have run all available tests and four of them are failing (not because of my changes), all others are running okay: Succeed: ActiveRecord DBFlow greenDAO OrmLite Realm
requery Room
SQLCipher
SQLDelight Sqlite squidb

Failed: Couchbase
Cupboard
Firebase
Parse

raiym commented 4 years ago

Build is failing due to 26.0.2 license acceptance.

> You have not accepted the license agreements of the following SDK components:
1750  [Android SDK Platform 26, Android SDK Build-Tools 26.0.2].
1751  Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
raiym commented 4 years ago

@greenrobot we still can keep 26.0.1 but I changed it because of annoying warning.

I will revert the change

raiym commented 4 years ago

Oh, it is not possible. Gradle automatically uses 26.0.2.

raiym commented 4 years ago

I will try to fix license issue tomorrow.

raiym commented 4 years ago

@greenrobot all fixed now. Cleaned up PR's commit history as well. Ready for review.

greenrobot-team commented 4 years ago

Thanks! Note that this project is rather outdated, we are updating https://github.com/objectbox/objectbox-performance regularly instead. I will have a look once I have time.

raiym commented 4 years ago

@greenrobot-team I see.

I think it is still worth merging since this benchmarking tool includes wider variety of libraries and not limited only to Room, GreenDao and ObjectBox, even if libraries are outdated. One who is interested in particular version could update the library by himself. For example for me pure sqlite and pure sqlicipher was a priority.

Also all build failures has been fixed which is good, since next one who tries to build it would not be frustrated and would be able to run it right away.

Thanks for the great work.

greenrobot-team commented 4 years ago

I made build updates to the whole project using modern versions of Android Gradle Plugin and Gradle with #26.

I moved your changes for SQLCipher support into #27.

Closing this in favor of #27.