{"id":30182754,"url":"https://github.com/vdka/sqlite.swift","last_synced_at":"2026-05-07T10:36:21.141Z","repository":{"id":100077188,"uuid":"93605478","full_name":"vdka/SQLite.swift","owner":"vdka","description":null,"archived":false,"fork":false,"pushed_at":"2019-05-15T04:25:43.000Z","size":85,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-12T10:26:14.614Z","etag":null,"topics":["database","sql","sqlite","swift"],"latest_commit_sha":null,"homepage":null,"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/vdka.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2017-06-07T07:26:56.000Z","updated_at":"2019-04-10T07:48:46.000Z","dependencies_parsed_at":"2023-05-12T03:45:21.035Z","dependency_job_id":null,"html_url":"https://github.com/vdka/SQLite.swift","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/vdka/SQLite.swift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdka%2FSQLite.swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdka%2FSQLite.swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdka%2FSQLite.swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdka%2FSQLite.swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vdka","download_url":"https://codeload.github.com/vdka/SQLite.swift/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdka%2FSQLite.swift/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32733931,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["database","sql","sqlite","swift"],"created_at":"2025-08-12T10:16:49.964Z","updated_at":"2026-05-07T10:36:21.134Z","avatar_url":"https://github.com/vdka.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n```swift\nstruct User: Equatable {\n    let firstName: String?\n    let lastName: String\n    let age: Float\n    let email: String\n\n    init(firstName: String?, lastName: String, age: Float, email: String) {\n        self.firstName = firstName\n        self.lastName = lastName\n        self.age = age\n        self.email = email\n    }\n\n    init(row: Database.Row) {\n        self.firstName = row.scan()\n        self.lastName = row.scan()\n        self.age = row.scan()\n        self.email = row.scan()\n    }\n}\n\nlet db = try! Pool(filepath: databasePath)\n\nlet error = db.exec(\n    \"\"\"\n    CREATE TABLE users (\n        id INTEGER,\n        first_name TEXT,\n        last_name TEXT NOT NULL,\n        age FLOAT NOT NULL,\n        email TEXT NOT NULL UNIQUE,\n        PRIMARY KEY(id)\n    );\n    \"\"\"\n).error\nXCTAssertNil(error)\n\nlet u1 = User(firstName: \"Thurstan\", lastName: \"Bussy\", age: 34, email: \"tbussy0@w3.org\")\nlet u2 = User(firstName: \"Zoe\", lastName: \"Shufflebotham\", age: 66, email: \"zshufflebotham1@accuweather.com\")\nlet u3 = User(firstName: nil, lastName: \"McKinstry\", age: 33, email: \"cmckinstry2@state.gov\")\nlet u4 = User(firstName: \"Valma\", lastName: \"Mulvin\", age: 31, email: \"vmulvin3@ustream.tv\")\n\nlet users: [User] = [u1, u2, u3, u4]\n\nfor user in users {\n    let error = db.exec(\"INSERT INTO users (first_name, last_name, age, email) VALUES (?, ?, ?, ?)\",\n            args: user.firstName, user.lastName, user.age, user.email).error\n    XCTAssertNil(error)\n}\n\nlet rows = db.query(\"SELECT first_name, last_name, age, email FROM users ORDER BY age ASC\")\nfor (row, expected) in zip(rows, users.sorted(by: { $0.age \u003c $1.age })) {\n    let user = User(row: row)\n    XCTAssertNil(row.error)\n    XCTAssertEqual(user, expected)\n}\n\nlet row = db.queryRow(\"SELECT first_name, last_name, age, email FROM users WHERE email LIKE '%@%.gov'\")\nlet govEmployee = User(row: row)\nXCTAssertNil(row.error)\nXCTAssertEqual(govEmployee, u3)\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvdka%2Fsqlite.swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvdka%2Fsqlite.swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvdka%2Fsqlite.swift/lists"}