{"id":15471435,"url":"https://github.com/aisk/swift-cdb","last_synced_at":"2026-04-19T04:32:39.948Z","repository":{"id":250580966,"uuid":"834831808","full_name":"aisk/swift-cdb","owner":"aisk","description":"Simple constant db in swift","archived":false,"fork":false,"pushed_at":"2024-07-29T14:57:53.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-28T12:23:00.948Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aisk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-07-28T13:53:49.000Z","updated_at":"2024-07-29T14:57:56.000Z","dependencies_parsed_at":"2024-07-28T16:30:42.708Z","dependency_job_id":"ea414bc4-5a1b-424d-849d-38efccd98288","html_url":"https://github.com/aisk/swift-cdb","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"ed7543e9a602edbed7761d4b06590f1a79f00715"},"previous_names":["aisk/cdb","aisk/swift-cdb"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aisk%2Fswift-cdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aisk%2Fswift-cdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aisk%2Fswift-cdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aisk%2Fswift-cdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aisk","download_url":"https://codeload.github.com/aisk/swift-cdb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245061384,"owners_count":20554563,"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":[],"created_at":"2024-10-02T02:19:47.966Z","updated_at":"2026-04-19T04:32:39.936Z","avatar_url":"https://github.com/aisk.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# swift-cdb\n\nA Swift wrapper for the CDB (Constant Database) implementation from [howerj/cdb](https://github.com/howerj/cdb), providing a native Swift interface for creating and querying constant key-value databases.\n\n## Installation\n\nAdd this package to your Swift project dependencies:\n\n```swift\n// In your Package.swift\ndependencies: [\n    .package(url: \"https://github.com/aisk/swift-cdb.git\", from: \"0.1.0\"),\n]\n```\n\n## Usage\n\n```swift\nimport CDB\n\n// Open a CDB file and read values\ndo {\n    let db = try CDB(filename: \"example.cdb\", mode: .read)\n\n    // Read string value\n    let value: String? = try db.get(key: \"some_key\")\n    print(\"Value: \\(value ?? \"not found\")\")\n\n    try db.close()\n} catch {\n    print(\"Error: \\(error)\")\n}\n```\n\n## API Reference\n\n### Main Methods\n\n- `init(filename: String, mode: Mode) throws` - Open a CDB file\n- `add(key: String, value: String) throws` - Add a string value\n- `add(key: String, value: Data) throws` - Add binary data\n- `get(key: String, at index: UInt64 = 0) throws -\u003e String?` - Get string value\n- `get(key: String, at index: UInt64 = 0) throws -\u003e Data?` - Get binary data\n- `count(key: String) throws -\u003e UInt64` - Count values for a key\n- `close() throws` - Close the database\n- `subscript(key: String) -\u003e String?` - Dictionary-like access\n\n### Modes\n\n- `.read` - Open for reading only\n- `.write` - Open for writing (creates new database)\n\n## License\n\nThis project is licensed under the same terms as the original [CDB library](https://github.com/howerj/cdb).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faisk%2Fswift-cdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faisk%2Fswift-cdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faisk%2Fswift-cdb/lists"}