{"id":20495654,"url":"https://github.com/Alexander-Ignition/SQLyra","last_synced_at":"2025-05-09T05:32:40.012Z","repository":{"id":73070006,"uuid":"326927398","full_name":"Alexander-Ignition/SQLyra","owner":"Alexander-Ignition","description":"Swift SQLite wrapper","archived":false,"fork":false,"pushed_at":"2025-02-02T09:10:03.000Z","size":101,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-20T09:44:05.057Z","etag":null,"topics":["sqlite","sqlite-swift","sqlite3"],"latest_commit_sha":null,"homepage":"https://alexander-ignition.github.io/SQLyra/documentation/sqlyra/","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/Alexander-Ignition.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":"2021-01-05T07:57:48.000Z","updated_at":"2025-02-02T09:10:03.000Z","dependencies_parsed_at":"2023-03-22T13:18:19.446Z","dependency_job_id":"5b2c6bec-1dcc-4b63-8836-890e28477b5a","html_url":"https://github.com/Alexander-Ignition/SQLyra","commit_stats":null,"previous_names":["alexander-ignition/sqlyra"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alexander-Ignition%2FSQLyra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alexander-Ignition%2FSQLyra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alexander-Ignition%2FSQLyra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alexander-Ignition%2FSQLyra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Alexander-Ignition","download_url":"https://codeload.github.com/Alexander-Ignition/SQLyra/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253199304,"owners_count":21870078,"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":["sqlite","sqlite-swift","sqlite3"],"created_at":"2024-11-15T17:46:47.248Z","updated_at":"2025-05-09T05:32:40.000Z","avatar_url":"https://github.com/Alexander-Ignition.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌌 SQLyra 🎼\n\n[![Test](https://github.com/Alexander-Ignition/SQLyra/actions/workflows/test.yml/badge.svg)](https://github.com/Alexander-Ignition/SQLyra/actions/workflows/test.yml)\n[![Swift 5.9](https://img.shields.io/badge/swift-5.9-brightgreen.svg?style=flat)](https://developer.apple.com/swift)\n[![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://github.com/Alexander-Ignition/SQLyra/blob/master/LICENSE)\n\nSwift SQLite wrapper.\n\n[Documentation](https://alexander-ignition.github.io/SQLyra/documentation/sqlyra/)\n\n\u003e this readme file is available as Xcode playground in Playgrounds/README.playground\n\n## Open\n\nCreate database in memory for reading and writing.\n```swift\nimport SQLyra\n\nlet database = try Database.open(\n    at: \"new.db\",\n    options: [.readwrite, .memory]\n)\n```\n## Create table\n\nCreate table for contacts with fields `id` and `name`.\n```swift\nlet sql = \"\"\"\n    CREATE TABLE contacts(\n        id INT PRIMARY KEY NOT NULL,\n        name TEXT\n    );\n    \"\"\"\ntry database.execute(sql)\n```\n## Insert\n\nInsert new contacts Paul and John.\n```swift\nlet insert = try database.prepare(\"INSERT INTO contacts (id, name) VALUES (?, ?);\")\ntry insert.bind(parameters: 1, \"Paul\").execute()\ntry insert.bind(parameters: 2, \"John\").execute()\n```\n## Select\n\nSelect all contacts from database.\n```swift\nstruct Contact: Codable {\n    let id: Int\n    let name: String?\n}\n\nlet select = try database.prepare(\"SELECT * FROM contacts;\")\nlet contacts = try select.array(Contact.self)\nprint(contacts)\n```\n## DataFrame\n\nThe [DataFrame](https://developer.apple.com/documentation/tabulardata/dataframe) from the [TabularData](https://developer.apple.com/documentation/tabulardata) framework is supported.\n\nIt can help to print the table.\n```swift\nlet df = try select.dataFrame()\nprint(df)\n```\n```\n┏━━━┳━━━━━━━┳━━━━━━━━━━┓\n┃   ┃ id    ┃ name     ┃\n┃   ┃ \u003cInt\u003e ┃ \u003cString\u003e ┃\n┡━━━╇━━━━━━━╇━━━━━━━━━━┩\n│ 0 │     1 │ Paul     │\n│ 1 │     2 │ John     │\n└───┴───────┴──────────┘\n```\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAlexander-Ignition%2FSQLyra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAlexander-Ignition%2FSQLyra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAlexander-Ignition%2FSQLyra/lists"}