Skip to content

Commit dd045c6

Browse files
committed
Update SQLite to v3.46.0
1 parent 12e9161 commit dd045c6

File tree

10 files changed

+33
-47
lines changed

10 files changed

+33
-47
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Change Log
22
==========
33

4+
## 3.46.0
5+
- [SQLite 3.46.0](https://www.sqlite.org/releaselog/3_46_0.html)
6+
- [SQLite 3.45.3](https://www.sqlite.org/releaselog/3_45_3.html)
7+
- [SQLite 3.45.2](https://www.sqlite.org/releaselog/3_45_2.html)
8+
- [SQLite 3.45.1](https://www.sqlite.org/releaselog/3_45_2.html)
9+
-
410
## 3.45.0
511
- [SQLite 3.45.0](https://www.sqlite.org/releaselog/3_45_0.html)
612
- [SQLite 3.44.2](https://www.sqlite.org/releaselog/3_44_2.html)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Then add the sqlite-android artifact from this repository as a dependency:
5151

5252
```gradle
5353
dependencies {
54-
implementation 'com.github.requery:sqlite-android:3.45.0'
54+
implementation 'com.github.requery:sqlite-android:3.46.0'
5555
}
5656
```
5757
Then change usages of `android.database.sqlite.SQLiteDatabase` to
@@ -109,13 +109,13 @@ Note that starting August 1, 2019, your apps published on Google Play will [need
109109
Requirements
110110
------------
111111

112-
The min SDK level is API level 19 (KitKat).
112+
The min SDK level is API level 21 (Lollipop).
113113

114114
Versioning
115115
----------
116116

117117
The library is versioned after the version of SQLite it contains. For changes specific to just the
118-
wrapper API, a revision number is added e.g., 3.45.0-X, where X is the revision number.
118+
wrapper API, a revision number is added e.g., 3.46.0-X, where X is the revision number.
119119

120120
Acknowledgements
121121
----------------

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
plugins {
2-
id "com.android.library" version "8.2.1" apply false
3-
id "de.undercouch.download" version "5.5.0" apply false
2+
id "com.android.library" version "8.4.1" apply false
3+
id "de.undercouch.download" version "5.6.0" apply false
44
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

sqlite-android/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ import com.vanniktech.maven.publish.SonatypeHost
33
plugins {
44
id "de.undercouch.download"
55
id "com.android.library"
6-
id "com.vanniktech.maven.publish" version "0.27.0"
6+
id "com.vanniktech.maven.publish" version "0.28.0"
77
}
88

99
android {
1010
buildToolsVersion = "34.0.0"
11-
ndkVersion "26.1.10909125"
11+
ndkVersion "26.3.11579264"
1212

1313
compileSdk 34
1414

1515
namespace "io.requery.android.sqlite"
1616

1717
defaultConfig {
18-
minSdkVersion 19
18+
minSdkVersion 21
1919
versionName VERSION_NAME
2020

2121
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -48,7 +48,7 @@ android {
4848
}
4949

5050
dependencies {
51-
api("androidx.core:core:1.12.0")
51+
api("androidx.core:core:1.13.1")
5252
api("androidx.sqlite:sqlite:2.4.0")
5353
testImplementation("junit:junit:4.13.2")
5454
androidTestImplementation("androidx.test:core:1.5.0")
@@ -58,7 +58,7 @@ dependencies {
5858
}
5959

6060
ext {
61-
sqliteDistributionUrl = "https://www.sqlite.org/2024/sqlite-amalgamation-3450000.zip"
61+
sqliteDistributionUrl = "https://www.sqlite.org/2024/sqlite-amalgamation-3460000.zip"
6262
}
6363

6464
tasks.register("downloadSqlite", Download) {

sqlite-android/src/androidTest/java/io/requery/android/database/DatabaseCursorTest.java

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
package io.requery.android.database;
1919

20-
import android.annotation.TargetApi;
2120
import android.content.ContentValues;
2221
import android.content.Context;
2322
import android.database.Cursor;
@@ -93,7 +92,6 @@ private void populateDefaultTable() {
9392
mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString3 + "');");
9493
}
9594

96-
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
9795
@MediumTest
9896
@Test
9997
public void testBlob() {
@@ -102,23 +100,23 @@ public void testBlob() {
102100
"CREATE TABLE test (_id INTEGER PRIMARY KEY, s TEXT, d REAL, l INTEGER, b BLOB);");
103101
// insert blob
104102
Object[] args = new Object[4];
105-
103+
106104
byte[] blob = new byte[1000];
107105
byte value = 99;
108-
Arrays.fill(blob, value);
106+
Arrays.fill(blob, value);
109107
args[3] = blob;
110-
108+
111109
String s = "text";
112110
args[0] = s;
113111
Double d = 99.9;
114112
args[1] = d;
115113
Long l = (long)1000;
116114
args[2] = l;
117-
115+
118116
String sql = "INSERT INTO test (s, d, l, b) VALUES (?,?,?,?)";
119117
mDatabase.execSQL(sql, args);
120118
// use cursor to access blob
121-
Cursor c = mDatabase.query("test", null, null, null, null, null, null);
119+
Cursor c = mDatabase.query("test", null, null, null, null, null, null);
122120
c.moveToNext();
123121
ContentValues cv = new ContentValues();
124122
//DatabaseUtils.cursorRowToContentValues(c, cv);
@@ -131,7 +129,7 @@ public void testBlob() {
131129
cv.put(columns[i], c.getString(i));
132130
}
133131
}
134-
132+
135133
int bCol = c.getColumnIndexOrThrow("b");
136134
int sCol = c.getColumnIndexOrThrow("s");
137135
int dCol = c.getColumnIndexOrThrow("d");
@@ -143,7 +141,7 @@ public void testBlob() {
143141
assertEquals((long)l, c.getLong(lCol));
144142
c.close();
145143
}
146-
144+
147145
@MediumTest
148146
@Test
149147
public void testRealColumns() {
@@ -286,8 +284,8 @@ public void testLargeField() {
286284
@Test
287285
public void testManyRowsLong() {
288286
mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data INT);");
289-
290-
final int count = 36799;
287+
288+
final int count = 36799;
291289
mDatabase.execSQL("BEGIN Transaction;");
292290
for (int i = 0; i < count; i++) {
293291
mDatabase.execSQL("INSERT INTO test (data) VALUES (" + i + ");");
@@ -343,12 +341,12 @@ public void testManyRowsTxt() {
343341
assertEquals(count, c.getCount());
344342
c.close();
345343
}
346-
344+
347345
@LargeTest
348346
@Test
349347
public void testManyRowsTxtLong() {
350348
mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, txt TEXT, data INT);");
351-
349+
352350
Random random = new Random(System.currentTimeMillis());
353351
StringBuilder randomString = new StringBuilder(1979);
354352
for (int i = 0; i < 1979; i++) {
@@ -382,7 +380,7 @@ public void testManyRowsTxtLong() {
382380
assertEquals(count, c.getCount());
383381
c.close();
384382
}
385-
383+
386384
@MediumTest
387385
@Test
388386
public void testRequery() {

sqlite-android/src/androidTest/java/io/requery/android/database/NewDatabasePerformanceTestSuite.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
import androidx.test.ext.junit.runners.AndroidJUnit4;
2525

26-
@Ignore
26+
@Ignore("No reason to ignore")
2727
@RunWith(AndroidJUnit4.class)
2828
public class NewDatabasePerformanceTestSuite extends TestSuite {
2929

sqlite-android/src/main/java/io/requery/android/database/AbstractCursor.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import android.database.DataSetObservable;
2727
import android.database.DataSetObserver;
2828
import android.net.Uri;
29-
import android.os.Build;
3029
import android.os.Bundle;
3130
import android.util.Log;
3231

@@ -311,11 +310,7 @@ public void unregisterDataSetObserver(DataSetObserver observer) {
311310
@SuppressWarnings("deprecation")
312311
protected void onChange(boolean selfChange) {
313312
synchronized (mSelfObserverLock) {
314-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
315-
mContentObservable.dispatchChange(selfChange, null);
316-
} else {
317-
mContentObservable.dispatchChange(selfChange);
318-
}
313+
mContentObservable.dispatchChange(selfChange, null);
319314
if (mNotifyUri != null && selfChange) {
320315
mContentResolver.notifyChange(mNotifyUri, mSelfObserver);
321316
}

sqlite-android/src/main/java/io/requery/android/database/sqlite/SQLiteConnection.java

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@
2222
package io.requery.android.database.sqlite;
2323

2424
import android.annotation.SuppressLint;
25-
import android.annotation.TargetApi;
2625
import android.database.Cursor;
2726
import android.database.sqlite.SQLiteBindOrColumnIndexOutOfRangeException;
2827
import android.database.sqlite.SQLiteDatabaseLockedException;
2928
import android.database.sqlite.SQLiteException;
30-
import android.os.Build;
3129
import android.os.Looper;
3230
import android.os.ParcelFileDescriptor;
3331
import android.util.Log;
@@ -726,11 +724,7 @@ public ParcelFileDescriptor executeForBlobFileDescriptor(String sql, Object[] bi
726724
try {
727725
int fd = nativeExecuteForBlobFileDescriptor(
728726
mConnectionPtr, statement.mStatementPtr);
729-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
730-
return fd >= 0 ? ParcelFileDescriptor.adoptFd(fd) : null;
731-
} else {
732-
throw new UnsupportedOperationException();
733-
}
727+
return fd >= 0 ? ParcelFileDescriptor.adoptFd(fd) : null;
734728
} finally {
735729
detachCancellationSignal(cancellationSignal);
736730
}
@@ -1030,11 +1024,7 @@ private void bindArguments(PreparedStatement statement, Object[] bindArgs) {
10301024
if (count != statement.mNumParameters) {
10311025
String message = "Expected " + statement.mNumParameters + " bind arguments but "
10321026
+ count + " were provided.";
1033-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
1034-
throw new SQLiteBindOrColumnIndexOutOfRangeException(message);
1035-
} else {
1036-
throw new SQLiteException(message);
1037-
}
1027+
throw new SQLiteBindOrColumnIndexOutOfRangeException(message);
10381028
}
10391029
if (count == 0) {
10401030
return;
@@ -1088,7 +1078,6 @@ private void bindArguments(PreparedStatement statement, Object[] bindArgs) {
10881078
* @param obj the object whose value type is to be returned
10891079
* @return object value type
10901080
*/
1091-
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
10921081
private static int getTypeOfObject(Object obj) {
10931082
if (obj == null) {
10941083
return Cursor.FIELD_TYPE_NULL;

sqlite-android/src/main/java/io/requery/android/database/sqlite/SQLiteDatabase.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
import androidx.annotation.IntDef;
4040
import androidx.annotation.NonNull;
4141
import androidx.annotation.Nullable;
42-
import androidx.annotation.RequiresApi;
4342
import androidx.core.os.CancellationSignal;
4443
import androidx.core.os.OperationCanceledException;
4544
import androidx.sqlite.db.SupportSQLiteDatabase;
@@ -1352,7 +1351,6 @@ public Cursor query(final SupportSQLiteQuery supportQuery) {
13521351
* {@link Cursor}s are not synchronized, see the documentation for more details.
13531352
*/
13541353
@Override
1355-
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
13561354
public Cursor query(SupportSQLiteQuery supportQuery, android.os.CancellationSignal signal) {
13571355
if (signal != null) {
13581356
final CancellationSignal supportCancellationSignal = new CancellationSignal();

0 commit comments

Comments
 (0)