requery/sqlite-android
requery/sqlite-android has 1,139 GitHub stars and 156 forks. GitHot measured 0 stars in 24 hours and +1 in 7 days. Last checked 2026-11-10 23:24 UTC. Last push 2025-10-14.
Comment ces chiffres sont mesurés
Android SQLite support library
Progression mesurée des étoiles
- in 24h
- 0
- in 7 days
- +1
- in 15 days
- Mise à jour retardée
- in 1 month
- Mise à jour retardée
Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.
README.md
OriginalAndroid SQLite support library
This is an Android specific distribution of the latest versions of SQLite. It contains the latest SQLite version and the Android specific database APIs derived from AOSP packaged as an AAR library distributed on jitpack.
Why?
- Consistent
- Faster
- Up-to-date
Even the latest version of Android is several versions behind the latest version of SQLite. These versions do not have bug fixes, performance improvements, or new features present in current versions of SQLite. This problem is worse the older the version of the OS the device has. Using this library, you can keep up to date with the latest versions of SQLite and provide a consistent version across OS versions and devices.
Use new SQLite features:
- JSON1 extension
- Common Table expressions
- Indexes on expressions
- Full-Text Search 5
- Generated Columns
- DROP COLUMN support
Usage
Follow the guidelines from jitpack.io to add the JitPack repository to your build file if you have not.
Typically, this means an edit to your build.gradle file to add a new repository definition
in the allprojects block, like this:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Then add the sqlite-android artifact from this repository as a dependency:
dependencies {
implementation 'com.github.requery:sqlite-android:3.50.4'
}
Then change usages of android.database.sqlite.SQLiteDatabase to
io.requery.android.database.sqlite.SQLiteDatabase, similarly extend
io.requery.android.database.sqlite.SQLiteOpenHelper instead of
android.database.sqlite.SQLiteOpenHelper. Note similar changes maybe required for classes that
depended on android.database.sqlite.SQLiteDatabase equivalent APIs are provided in the
io.requery.android.database.sqlite package.
If you expose Cursor instances across processes you should wrap the returned cursors in a
CrossProcessCursorWrapper
for performance reasons the cursors are not a cross process by default.
Support library compatibility
The library implements the SupportSQLite interfaces provided by the support library. Use
RequerySQLiteOpenHelperFactory to obtain an implementation of (Support)SQLiteOpenHelper based
on a SupportSQLiteOpenHelper.Configuration and SupportSQLiteOpenHelper.Callback.
This also allows you to use sqlite-android with libraries like Room by passing an instance
of RequerySQLiteOpenHelperFactory to them.
CPU Architectures
The native library is built for the following CPU architectures:
armeabi-v7a~1.2 MBarm64-v8a~1.7 MBx86~1.7 MBx86_64~1.8 MB
However, you may not want to include all binaries in your apk.
You can exclude certain variants by using packagingOptions:
android {
packagingOptions {
exclude 'lib/armeabi-v7a/libsqlite3x.so'
exclude 'lib/arm64-v8a/libsqlite3x.so'
exclude 'lib/x86/libsqlite3x.so'
exclude 'lib/x86_64/libsqlite3x.so'
}
}
The size of the artifacts with only the armeabi-v7a binary is ~1.2 MB. In general, you can use armeabi-v7a on the majority of Android devices including Intel Atom which provides a native translation layer, however, performance under the translation layer is worse than using the x86 binary.
Note that starting August 1, 2019, your apps published on Google Play will need to support 64-bit architectures.
Requirements
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.50.4-X, where X is the revision number.
Acknowledgements
This project is based on the AOSP code and the Android SQLite bindings No official distributions are made from the Android SQLite bindings it, and it has not been updated in a while, this project starts there and makes significant changes:
Changes
- Fast read performance: The original SQLite bindings filled the CursorWindow using its Java methods from native C++. This was because there is no access to the native CursorWindow native API from the NDK. Unfortunately, this slowed read performance significantly (roughly 2x worse vs the android database API) because of extra JNI roundtrips. This has been rewritten without the JNI to Java calls (so more like the original AOSP code) and also using a local memory CursorWindow.
- Reuse of android.database.sqlite.*, the original SQLite bindings replicated the entire android.database.sqlite API structure including exceptions & interfaces. This project does not do that, instead it reuses the original classes/interfaces when possible to simplify migration and/or use with existing code.
- Unit tests added
- Compile with clang toolchain
- Compile with FTS3, FTS4, & JSON1 extension
- Migrate to Gradle build
- buildscript dynamically fetches and builds the latest sqlite source from sqlite.org
- Added consumer proguard rules
- Use androidx-core version of
CancellationSignal - Fix bug in
SQLiteOpenHelper.getDatabaseLocked()wrong path toopenOrCreateDatabase - Fix removed members in AbstractWindowCursor
- Made the AOSP code (mostly) warning free but still mergable from source
- Deprecated classes/methods removed
- Loadable extension support
- STL dependency removed
License
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");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Explorer des projets similaires
Asabeneh/30-Days-Of-Python
Le défi de programmation 30 Days of Python est un guide pas à pas pour apprendre le langage de programmation Python en 30 jours. Ce défi peut prendre plus de 100 jours. Avancez à votre rythme. Ces vidéos peuvent aussi vous aider : https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,560 étoilesgrafana/grafana
Plateforme ouverte et composable d’observabilité et de visualisation de données. Visualise les métriques, les journaux et les traces issus de plusieurs sources, comme Prometheus, Loki, Elasticsearch, InfluxDB, Postgres et bien d’autres.
77,830 étoilesredis/redis
Pour les développeurs qui créent des applications en temps réel pilotées par les données, Redis est le cache, le serveur de structures de données et le moteur de requêtes documentaires et vectorielles préféré, le plus rapide et le plus riche en fonctionnalités.
77,395 étoilesapache/superset
Apache Superset est une plateforme de visualisation et d'exploration de données.
75,473 étoiles