{"id":21404312,"url":"https://github.com/flexible-universe/sqlitemanager","last_synced_at":"2026-04-10T20:42:03.053Z","repository":{"id":214851776,"uuid":"737493720","full_name":"Flexible-Universe/SQLiteManager","owner":"Flexible-Universe","description":"To manage a SQLite Database with Swift and Combine","archived":false,"fork":false,"pushed_at":"2024-06-01T10:05:43.000Z","size":525,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-27T17:04:11.436Z","etag":null,"topics":["combine","database","manager","sqlite","swift","swift5"],"latest_commit_sha":null,"homepage":"https://flexible-universe.com","language":"Swift","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/Flexible-Universe.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}},"created_at":"2023-12-31T08:46:45.000Z","updated_at":"2024-06-01T10:05:46.000Z","dependencies_parsed_at":"2025-01-23T03:31:00.541Z","dependency_job_id":"45c5565e-a7e4-431a-bd12-4898c16ceb84","html_url":"https://github.com/Flexible-Universe/SQLiteManager","commit_stats":null,"previous_names":["flexible-universe/sqlitemanager"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Flexible-Universe/SQLiteManager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flexible-Universe%2FSQLiteManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flexible-Universe%2FSQLiteManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flexible-Universe%2FSQLiteManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flexible-Universe%2FSQLiteManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Flexible-Universe","download_url":"https://codeload.github.com/Flexible-Universe/SQLiteManager/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flexible-Universe%2FSQLiteManager/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270305225,"owners_count":24562087,"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","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"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":["combine","database","manager","sqlite","swift","swift5"],"created_at":"2024-11-22T16:14:24.629Z","updated_at":"2026-04-10T20:42:03.026Z","avatar_url":"https://github.com/Flexible-Universe.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv style=\"text-align: center;\"\u003e\n  \u003cimg src=\"assets/sqlite_manager.png\" alt=\"SQLite Manager\"/\u003e\n\u003c/div\u003e\n\n# SQLiteManager\n\nThe SQLiteManager is a framework that manage sqlite databases. It works with the Apple Framework Combine to publish the data from the database into the app. For example you create your base sqlite database and put it into the bundle of your swift app. Then you can copy as the sqlite database into a working folder to store data into it or read data. You can also create the sqlite database at runtime and save it to a custom folder.\n\n## Table of Contents\n- [Features](#features)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Documentation](#documentation)\n- [License](#license)\n\n## Features\n- Connect to SQLite Database\n- Execute sql commands (SELECT, INSERT, UPDATE, DELETE, TRUNCATE)\n- Work with the Apple Combine Framework\n- Optional logging of the errors from the communication with the database\n- Check if a table with a entry is exists in primary key column or custom column\n\n## Requirements\nThe following table outlines the requirements for this package:\n\n| Platform | Minimum Swift Version | Installation |\n| -------- | --------------------- | ------------ |\n| iOS 14.0+ / macOS 10.15+ | 5.3 | [Swift Package Manager](#swift-package-manager)|\n\n## Installation\n### Swift Package Manager\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/Flexible-Universe/SQLiteManager.git\", .upToNextMajor(from: \"1.0.0\"))\n]\n```\n\n## Examples\nCreate Table with SQL Command:\n```swift\nprivate var cancellables = Set\u003cAnyCancellable\u003e()\n\n/* ... */\n\nlet fileManager = FileManager.default\nlet tempDirectoryURL = URL(fileURLWithPath: NSTemporaryDirectory())\nlet dbFileURL = tempDirectoryURL.appendingPathComponent(\"test.db\")\n\nlet sqlite = try SQLiteManager(path: dbFileURL.path)\n\nlet createTableSQL = \"\"\"\nCREATE TABLE IF NOT EXISTS users (\n    id INTEGER PRIMARY KEY AUTOINCREMENT,\n    name TEXT,\n    age INTEGER\n);\n\"\"\"\nsqlite.query(sql: createTableSQL).sink(receiveCompletion: { _ in }, receiveValue: { _ in })\n    .store(in: \u0026cancellables)\n```\nThis piece of code create a table with the columns name and age. After this part you can insert some of data:\n```swift\nprivate var cancellables = Set\u003cAnyCancellable\u003e()\n\n/* ... */\n\nvar insertDataSQL = \"INSERT INTO users (name, age) VALUES ('John Doe', 30);\"\nsqlite.query(sql: insertDataSQL).sink(receiveCompletion: { _ in }, receiveValue: { _ in })\n    .store(in: \u0026cancellables)\ninsertDataSQL = \"INSERT INTO users (name, age) VALUES ('Jane Smith', 27);\"\nsqlite.query(sql: insertDataSQL).sink(receiveCompletion: { _ in }, receiveValue: { _ in })\n    .store(in: \u0026cancellables)\n```\nOr take some data from the table with SQL-SELECT Command:\n```swift\nprivate var cancellables = Set\u003cAnyCancellable\u003e()\n\n/* ... */\n\nlet sql = \"SELECT * FROM users WHERE age \u003e ?\"\nlet parameters: [Any] = [25]\n\nsqlite.query(sql: sql, parameters: parameters)\n    .sink(receiveCompletion: { completion in\n        switch completion {\n        case .finished:\n            print(\"The sql command finished successfully...\")\n        case .failure(let error):\n            print(\"The sql command failed with error: \\(error)\")\n        }\n    }, receiveValue: { rows in\n        print(\"The count of rows is: \\(rows.count)\")\n        print(\"The name is : \\(rows[0][\"name\"] as? String)\")\n        print(\"The age is  : \\(rows[0][\"age\"] as? Int)\")\n    })\n    .store(in: \u0026cancellables)\n```\n\n## Documentation\nThe comprehensive documentation is accessible through this [link](https://docs.flexible-universe.com/SQLiteManager/).\n\n## License\nSQLiteManager is released under the MIT license. [See LICENSE](https://github.com/Flexible-Universe/SQLiteManager/blob/main/LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflexible-universe%2Fsqlitemanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflexible-universe%2Fsqlitemanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflexible-universe%2Fsqlitemanager/lists"}