{"id":49791005,"url":"https://github.com/androidpoet/kdb","last_synced_at":"2026-05-12T04:04:25.165Z","repository":{"id":356224282,"uuid":"1231567316","full_name":"AndroidPoet/kdb","owner":"AndroidPoet","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-07T05:46:44.000Z","size":106,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-07T07:14:02.052Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndroidPoet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-07T04:43:57.000Z","updated_at":"2026-05-07T05:46:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/AndroidPoet/kdb","commit_stats":null,"previous_names":["androidpoet/kdb"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/AndroidPoet/kdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndroidPoet%2Fkdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndroidPoet%2Fkdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndroidPoet%2Fkdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndroidPoet%2Fkdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndroidPoet","download_url":"https://codeload.github.com/AndroidPoet/kdb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndroidPoet%2Fkdb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32922894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-11T17:09:15.040Z","status":"online","status_checked_at":"2026-05-12T02:00:06.338Z","response_time":102,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2026-05-12T04:04:06.589Z","updated_at":"2026-05-12T04:04:25.149Z","avatar_url":"https://github.com/AndroidPoet.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KDB: Kotlin Multiplatform SQLite Wrapper\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"art/kdb_logo.png\" alt=\"KDB Logo\" width=\"200\"/\u003e\n\u003c/p\u003e\n\nKDB is a lightweight, type-safe SQLite wrapper for Kotlin Multiplatform.\n\n## Modules\n\n| Module | Description |\n| :--- | :--- |\n| `kdb` | Core library (driver + schema + query + paging + client API) |\n| `kdb-paging3` | Optional Paging 3 integration |\n\n## API Design\n\n- Primary API returns `KdbResult\u003cT\u003e`:\n  - `open`, `migrate`, `close`\n  - `insert`, `updateById`, `deleteById`, `getById`, `list`\n- Convenience `suspend` background APIs throw on failure:\n  - `openOrThrow`, `migrateOrThrow`, `closeOrThrow`\n  - `insertOrThrow`, `updateByIdOrThrow`, `deleteByIdOrThrow`, `getByIdOrThrow`, `listOrThrow`\n- Transaction helper:\n  - `suspend fun tx { ... }`\n\n## Configuration\n\n```kotlin\nval kdb = createKdb(driver) {\n    entities(Task.serializer())\n    // optional, default: Dispatchers.Default\n    // dispatcher = Dispatchers.IO\n}\n```\n\n## Quick Start (Result-first)\n\n```kotlin\n@Serializable\ndata class Task(val id: Long, val title: String, val done: Boolean)\n\nval driver = CommonKdbDriver(\"my_app.db\")\nval kdb = createKdb(driver) {\n    entities(Task.serializer())\n}\n\nkdb.open()\nkdb.migrate(\n    migration(1) {\n        createTable\u003cTask\u003e(\"task\")\n        // or raw SQL when needed:\n        // sql(\"CREATE INDEX IF NOT EXISTS idx_task_done ON task(done)\")\n    }\n)\n\nkdb.insert(Task(1, \"Ship KDB\", false))\nkdb.updateById(1, Task(1, \"Ship KDB v1\", false))\nval one = kdb.getById\u003cTask\u003e(1)\nkdb.deleteById\u003cTask\u003e(1)\n\nval page = kdb.list\u003cTask\u003e(limit = 20, afterId = null) { it.id }\n```\n\n## Convenience (Suspend + Throwing)\n\n```kotlin\nkdb.openOrThrow()\nkdb.insertOrThrow(Task(2, \"A\", false))\n\nval page = kdb.listOrThrow\u003cTask\u003e(limit = 20) { it.id }\n\nkdb.tx {\n    insert(Task(3, \"B\", false)).getOrThrow()\n    insert(Task(4, \"C\", false)).getOrThrow()\n}\n```\n\n## License\n\nKDB is licensed under the MIT License. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandroidpoet%2Fkdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandroidpoet%2Fkdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandroidpoet%2Fkdb/lists"}