Skip to content

Update SQLite to v3.49.0 #193

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

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ jobs:
matrix:
api-level: [29]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Set up JDK 17
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "adopt"

- name: Run Android tests
uses: reactivecircus/android-emulator-runner@e790971012b979513b4e2fe70d4079bc0ca8a1ae
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
Expand All @@ -34,7 +34,7 @@ jobs:

- name: Upload results
if: ${{ always() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: instrumentation-test-results ${{ matrix.api-level }}
path: ./**/build/reports/androidTests/connected/**
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
Change Log
==========

## 3.48.0
- [SQLite 3.49.0](https://www.sqlite.org/releaselog/3_49_0.html)
- [SQLite 3.48.0](https://www.sqlite.org/releaselog/3_48_0.html)
- [SQLite 3.47.2](https://www.sqlite.org/releaselog/3_47_2.html)
- [SQLite 3.47.1](https://www.sqlite.org/releaselog/3_47_2.html)
- [SQLite 3.47.0](https://www.sqlite.org/releaselog/3_47_0.html)
- [SQLite 3.46.1](https://www.sqlite.org/releaselog/3_46_1.html)
- [SQLite 3.46.0](https://www.sqlite.org/releaselog/3_46_0.html)
- [SQLite 3.45.3](https://www.sqlite.org/releaselog/3_45_3.html)
- [SQLite 3.45.2](https://www.sqlite.org/releaselog/3_45_2.html)
- [SQLite 3.45.1](https://www.sqlite.org/releaselog/3_45_2.html)

## 3.45.0
- [SQLite 3.45.0](https://www.sqlite.org/releaselog/3_45_0.html)
- [SQLite 3.44.2](https://www.sqlite.org/releaselog/3_44_2.html)
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Then add the sqlite-android artifact from this repository as a dependency:

```gradle
dependencies {
implementation 'com.github.requery:sqlite-android:3.45.0'
implementation 'com.github.requery:sqlite-android:3.49.0'
}
```
Then change usages of `android.database.sqlite.SQLiteDatabase` to
Expand Down Expand Up @@ -109,13 +109,13 @@ Note that starting August 1, 2019, your apps published on Google Play will [need
Requirements
------------

The min SDK level is API level 19 (KitKat).
The min SDK level is API level 21 (Lollipop).

Versioning
----------

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

Acknowledgements
----------------
Expand Down Expand Up @@ -153,7 +153,7 @@ Changes
License
-------

Copyright (C) 2017-2024 requery.io
Copyright (C) 2017-2025 requery.io
Copyright (C) 2005-2012 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
plugins {
id "com.android.library" version "8.2.1" apply false
id "de.undercouch.download" version "5.5.0" apply false
id "com.android.library" version "8.8.0" apply false
id "de.undercouch.download" version "5.6.0" apply false
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M"
android.useAndroidX=true
#
GROUP=io.requery
VERSION_NAME=3.45.0-SNAPSHOT
VERSION_NAME=3.49.0-SNAPSHOT
#
POM_DEVELOPER_ID=TODO
POM_DEVELOPER_NAME=TODO
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
22 changes: 11 additions & 11 deletions sqlite-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ import com.vanniktech.maven.publish.SonatypeHost
plugins {
id "de.undercouch.download"
id "com.android.library"
id "com.vanniktech.maven.publish" version "0.27.0"
id "com.vanniktech.maven.publish" version "0.30.0"
}

android {
buildToolsVersion = "34.0.0"
ndkVersion "26.1.10909125"
buildToolsVersion = "35.0.1"
ndkVersion "28.0.13004108"

compileSdk 34
compileSdk 35

namespace "io.requery.android.sqlite"

defaultConfig {
minSdkVersion 19
minSdkVersion 21
versionName VERSION_NAME

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -48,17 +48,17 @@ android {
}

dependencies {
api("androidx.core:core:1.12.0")
api("androidx.core:core:1.15.0")
api("androidx.sqlite:sqlite:2.4.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test:core:1.5.0")
androidTestImplementation("androidx.test:runner:1.5.2")
androidTestImplementation("androidx.test:rules:1.5.0")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test:core:1.6.1")
androidTestImplementation("androidx.test:runner:1.6.2")
androidTestImplementation("androidx.test:rules:1.6.1")
androidTestImplementation("androidx.test.ext:junit:1.2.1")
}

ext {
sqliteDistributionUrl = "https://www.sqlite.org/2024/sqlite-amalgamation-3450000.zip"
sqliteDistributionUrl = "https://www.sqlite.org/2025/sqlite-amalgamation-3490000.zip"
}

tasks.register("downloadSqlite", Download) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

package io.requery.android.database;

import android.annotation.TargetApi;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
Expand Down Expand Up @@ -93,7 +92,6 @@ private void populateDefaultTable() {
mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString3 + "');");
}

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@MediumTest
@Test
public void testBlob() {
Expand All @@ -102,23 +100,23 @@ public void testBlob() {
"CREATE TABLE test (_id INTEGER PRIMARY KEY, s TEXT, d REAL, l INTEGER, b BLOB);");
// insert blob
Object[] args = new Object[4];

byte[] blob = new byte[1000];
byte value = 99;
Arrays.fill(blob, value);
Arrays.fill(blob, value);
args[3] = blob;

String s = "text";
args[0] = s;
Double d = 99.9;
args[1] = d;
Long l = (long)1000;
args[2] = l;

String sql = "INSERT INTO test (s, d, l, b) VALUES (?,?,?,?)";
mDatabase.execSQL(sql, args);
// use cursor to access blob
Cursor c = mDatabase.query("test", null, null, null, null, null, null);
Cursor c = mDatabase.query("test", null, null, null, null, null, null);
c.moveToNext();
ContentValues cv = new ContentValues();
//DatabaseUtils.cursorRowToContentValues(c, cv);
Expand All @@ -131,7 +129,7 @@ public void testBlob() {
cv.put(columns[i], c.getString(i));
}
}

int bCol = c.getColumnIndexOrThrow("b");
int sCol = c.getColumnIndexOrThrow("s");
int dCol = c.getColumnIndexOrThrow("d");
Expand All @@ -143,7 +141,7 @@ public void testBlob() {
assertEquals((long)l, c.getLong(lCol));
c.close();
}

@MediumTest
@Test
public void testRealColumns() {
Expand Down Expand Up @@ -286,8 +284,8 @@ public void testLargeField() {
@Test
public void testManyRowsLong() {
mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data INT);");
final int count = 36799;

final int count = 36799;
mDatabase.execSQL("BEGIN Transaction;");
for (int i = 0; i < count; i++) {
mDatabase.execSQL("INSERT INTO test (data) VALUES (" + i + ");");
Expand Down Expand Up @@ -343,12 +341,12 @@ public void testManyRowsTxt() {
assertEquals(count, c.getCount());
c.close();
}

@LargeTest
@Test
public void testManyRowsTxtLong() {
mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, txt TEXT, data INT);");

Random random = new Random(System.currentTimeMillis());
StringBuilder randomString = new StringBuilder(1979);
for (int i = 0; i < 1979; i++) {
Expand Down Expand Up @@ -382,7 +380,7 @@ public void testManyRowsTxtLong() {
assertEquals(count, c.getCount());
c.close();
}

@MediumTest
@Test
public void testRequery() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

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

@Ignore
@Ignore("No reason to ignore")
@RunWith(AndroidJUnit4.class)
public class NewDatabasePerformanceTestSuite extends TestSuite {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import android.database.DataSetObservable;
import android.database.DataSetObserver;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;

Expand Down Expand Up @@ -311,11 +310,7 @@ public void unregisterDataSetObserver(DataSetObserver observer) {
@SuppressWarnings("deprecation")
protected void onChange(boolean selfChange) {
synchronized (mSelfObserverLock) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
mContentObservable.dispatchChange(selfChange, null);
} else {
mContentObservable.dispatchChange(selfChange);
}
mContentObservable.dispatchChange(selfChange, null);
if (mNotifyUri != null && selfChange) {
mContentResolver.notifyChange(mNotifyUri, mSelfObserver);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@
package io.requery.android.database.sqlite;

import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.database.Cursor;
import android.database.sqlite.SQLiteBindOrColumnIndexOutOfRangeException;
import android.database.sqlite.SQLiteDatabaseLockedException;
import android.database.sqlite.SQLiteException;
import android.os.Build;
import android.os.Looper;
import android.os.ParcelFileDescriptor;
import android.util.Log;
Expand Down Expand Up @@ -739,11 +737,7 @@ public ParcelFileDescriptor executeForBlobFileDescriptor(String sql, Object[] bi
try {
int fd = nativeExecuteForBlobFileDescriptor(
mConnectionPtr, statement.mStatementPtr);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
return fd >= 0 ? ParcelFileDescriptor.adoptFd(fd) : null;
} else {
throw new UnsupportedOperationException();
}
return fd >= 0 ? ParcelFileDescriptor.adoptFd(fd) : null;
} finally {
detachCancellationSignal(cancellationSignal);
}
Expand Down Expand Up @@ -1043,11 +1037,7 @@ private void bindArguments(PreparedStatement statement, Object[] bindArgs) {
if (count != statement.mNumParameters) {
String message = "Expected " + statement.mNumParameters + " bind arguments but "
+ count + " were provided.";
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
throw new SQLiteBindOrColumnIndexOutOfRangeException(message);
} else {
throw new SQLiteException(message);
}
throw new SQLiteBindOrColumnIndexOutOfRangeException(message);
}
if (count == 0) {
return;
Expand Down Expand Up @@ -1101,7 +1091,6 @@ private void bindArguments(PreparedStatement statement, Object[] bindArgs) {
* @param obj the object whose value type is to be returned
* @return object value type
*/
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private static int getTypeOfObject(Object obj) {
if (obj == null) {
return Cursor.FIELD_TYPE_NULL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import androidx.annotation.IntDef;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.core.os.CancellationSignal;
import androidx.core.os.OperationCanceledException;
import androidx.sqlite.db.SupportSQLiteDatabase;
Expand Down Expand Up @@ -1367,7 +1366,6 @@ public Cursor query(final SupportSQLiteQuery supportQuery) {
* {@link Cursor}s are not synchronized, see the documentation for more details.
*/
@Override
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
public Cursor query(SupportSQLiteQuery supportQuery, android.os.CancellationSignal signal) {
if (signal != null) {
final CancellationSignal supportCancellationSignal = new CancellationSignal();
Expand Down
Loading