{"id":15036875,"url":"https://github.com/requery/sqlite-android","last_synced_at":"2025-05-14T18:01:44.574Z","repository":{"id":38434532,"uuid":"55330340","full_name":"requery/sqlite-android","owner":"requery","description":"Android SQLite support library","archived":false,"fork":false,"pushed_at":"2025-05-07T08:54:50.000Z","size":571,"stargazers_count":1085,"open_issues_count":47,"forks_count":149,"subscribers_count":48,"default_branch":"master","last_synced_at":"2025-05-07T09:48:10.322Z","etag":null,"topics":["android","android-database-api","sqlite","sqlite-android"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/requery.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-03T04:56:43.000Z","updated_at":"2025-05-07T08:54:54.000Z","dependencies_parsed_at":"2024-01-22T12:47:07.663Z","dependency_job_id":"9cfebdf9-1876-46c5-b86f-3639fb78f2a7","html_url":"https://github.com/requery/sqlite-android","commit_stats":null,"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/requery%2Fsqlite-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/requery%2Fsqlite-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/requery%2Fsqlite-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/requery%2Fsqlite-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/requery","download_url":"https://codeload.github.com/requery/sqlite-android/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254198452,"owners_count":22030964,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-database-api","sqlite","sqlite-android"],"created_at":"2024-09-24T20:32:36.361Z","updated_at":"2025-05-14T18:01:44.512Z","avatar_url":"https://github.com/requery.png","language":"Java","readme":"# Android SQLite support library\n\n![Build Status](https://github.com/requery/sqlite-android/actions/workflows/ci.yml/badge.svg)\n[![Download](https://jitpack.io/v/requery/sqlite-android.svg)](https://jitpack.io/#requery/sqlite-android)\n\nThis is an Android specific distribution of the latest versions of SQLite.\nIt contains the latest SQLite version and the Android specific database APIs\nderived from AOSP packaged as an AAR library distributed on jitpack.\n\nWhy?\n----\n\n- **Consistent**\n- **Faster**\n- **Up-to-date**\n\nEven the latest version of Android is several versions behind the latest version of SQLite.\nThese versions do not have bug fixes, performance improvements, or new features present in\ncurrent versions of SQLite. This problem is worse the older the version of the OS the device has.\nUsing this library, you can keep up to date with the latest versions of SQLite and provide a\nconsistent version across OS versions and devices.\n\nUse new SQLite features:\n\n- **[JSON1 extension](https://www.sqlite.org/json1.html)**\n- **[Common Table expressions](https://www.sqlite.org/lang_with.html)**\n- **[Indexes on expressions](https://www.sqlite.org/expridx.html)**\n- **[Full-Text Search 5](https://www.sqlite.org/fts5.html)**\n- **[Generated Columns](https://www.sqlite.org/gencol.html)**\n- **[DROP COLUMN support](https://www.sqlite.org/lang_altertable.html#altertabdropcol)**\n\nUsage\n-----\n\nFollow the guidelines from [jitpack.io](https://jitpack.io) to add the JitPack repository \nto your build file if you have not.\n\nTypically, this means an edit to your `build.gradle` file to add a new `repository` definition \nin the `allprojects` block, like this:\n\n```gradle\n\tallprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n\t}\n```\n\nThen add the sqlite-android artifact from this repository as a dependency:\n\n```gradle\ndependencies {\n    implementation 'com.github.requery:sqlite-android:3.45.0'\n}\n```\nThen change usages of `android.database.sqlite.SQLiteDatabase` to\n`io.requery.android.database.sqlite.SQLiteDatabase`, similarly extend\n`io.requery.android.database.sqlite.SQLiteOpenHelper` instead of\n`android.database.sqlite.SQLiteOpenHelper`. Note similar changes maybe required for classes that\ndepended on `android.database.sqlite.SQLiteDatabase` equivalent APIs are provided in the\n`io.requery.android.database.sqlite` package.\n\nIf you expose `Cursor` instances across processes you should wrap the returned cursors in a\n[CrossProcessCursorWrapper](http://developer.android.com/reference/android/database/CrossProcessCursorWrapper.html)\nfor performance reasons the cursors are not a cross process by default.\n\n### Support library compatibility\n\nThe library implements the SupportSQLite interfaces provided by the support library. Use\n`RequerySQLiteOpenHelperFactory` to obtain an implementation of `(Support)SQLiteOpenHelper` based\non a `SupportSQLiteOpenHelper.Configuration` and `SupportSQLiteOpenHelper.Callback`.\n\nThis also allows you to use sqlite-android with libraries like Room by passing an instance\nof `RequerySQLiteOpenHelperFactory` to them.\n\n\nCPU Architectures\n-----------------\n\nThe native library is built for the following CPU architectures:\n\n- `armeabi-v7a` ~1.2 MB\n- `arm64-v8a` ~1.7 MB\n- `x86` ~1.7 MB\n- `x86_64` ~1.8 MB\n\nHowever, you may not want to include all binaries in your apk.\nYou can exclude certain variants by using `packagingOptions`:\n\n```gradle\nandroid {\n    packagingOptions {\n        exclude 'lib/armeabi-v7a/libsqlite3x.so'\n        exclude 'lib/arm64-v8a/libsqlite3x.so'\n        exclude 'lib/x86/libsqlite3x.so'\n        exclude 'lib/x86_64/libsqlite3x.so'\n    }\n}\n```\n\nThe size of the artifacts with only the armeabi-v7a binary is **~1.2 MB**.\nIn general, you can use armeabi-v7a on the majority of Android devices including Intel Atom\nwhich provides a native translation layer, however, performance under the translation layer\nis worse than using the x86 binary.\n\nNote that starting August 1, 2019, your apps published on Google Play will [need to support 64-bit architectures](https://developer.android.com/distribute/best-practices/develop/64-bit).\n\nRequirements\n------------\n\nThe min SDK level is API level 19 (KitKat).\n\nVersioning\n----------\n\nThe library is versioned after the version of SQLite it contains. For changes specific to just the\nwrapper API, a revision number is added e.g., 3.45.0-X, where X is the revision number.\n\nAcknowledgements\n----------------\nThis project is based on the AOSP code and the [Android SQLite bindings](https://www.sqlite.org/android/doc/trunk/www/index.wiki)\nNo official distributions are made from the Android SQLite bindings it, and it has not been updated\nin a while, this project starts there and makes significant changes:\n\nChanges\n-------\n\n- **Fast read performance:** The original SQLite bindings filled the CursorWindow using its\n  Java methods from native C++. This was because there is no access to the native CursorWindow\n  native API from the NDK. Unfortunately, this slowed read performance significantly (roughly 2x\n  worse vs the android database API) because of extra JNI roundtrips. This has been rewritten\n  without the JNI to Java calls (so more like the original AOSP code) and also using a local memory\n  CursorWindow.\n- Reuse of android.database.sqlite.*, the original SQLite bindings replicated the entire\n  android.database.sqlite API structure including exceptions \u0026 interfaces. This project does not\n  do that, instead it reuses the original classes/interfaces when possible to simplify\n  migration and/or use with existing code.\n- Unit tests added\n- Compile with [clang](http://clang.llvm.org/) toolchain\n- Compile with FTS3, FTS4, \u0026 JSON1 extension\n- Migrate to Gradle build\n- buildscript dynamically fetches and builds the latest sqlite source from sqlite.org\n- Added consumer proguard rules\n- Use androidx-core version of `CancellationSignal`\n- Fix bug in `SQLiteOpenHelper.getDatabaseLocked()` wrong path to `openOrCreateDatabase`\n- Fix removed members in AbstractWindowCursor\n- Made the AOSP code (mostly) warning free but still mergable from source\n- Deprecated classes/methods removed\n- Loadable extension support\n- STL dependency removed\n\nLicense\n-------\n\n    Copyright (C) 2017-2024 requery.io\n    Copyright (C) 2005-2012 The Android Open Source Project\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frequery%2Fsqlite-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frequery%2Fsqlite-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frequery%2Fsqlite-android/lists"}