{"id":16496575,"url":"https://github.com/nghiatranuit/swifty-postgresql","last_synced_at":"2026-04-13T01:33:32.284Z","repository":{"id":75042149,"uuid":"83321255","full_name":"NghiaTranUIT/Swifty-PostgreSQL","owner":"NghiaTranUIT","description":"Swifty-PostgreSQL driver, written by Swift 3.0","archived":false,"fork":false,"pushed_at":"2017-04-29T05:40:17.000Z","size":1752,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-04T19:37:20.603Z","etag":null,"topics":["macos","opensource","postgresql","swift3"],"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/NghiaTranUIT.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":"2017-02-27T14:48:07.000Z","updated_at":"2017-03-03T09:57:28.000Z","dependencies_parsed_at":"2024-02-20T03:30:06.519Z","dependency_job_id":null,"html_url":"https://github.com/NghiaTranUIT/Swifty-PostgreSQL","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/NghiaTranUIT/Swifty-PostgreSQL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NghiaTranUIT%2FSwifty-PostgreSQL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NghiaTranUIT%2FSwifty-PostgreSQL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NghiaTranUIT%2FSwifty-PostgreSQL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NghiaTranUIT%2FSwifty-PostgreSQL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NghiaTranUIT","download_url":"https://codeload.github.com/NghiaTranUIT/Swifty-PostgreSQL/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NghiaTranUIT%2FSwifty-PostgreSQL/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31736723,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-12T22:19:12.206Z","status":"ssl_error","status_checked_at":"2026-04-12T22:18:33.088Z","response_time":58,"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":["macos","opensource","postgresql","swift3"],"created_at":"2024-10-11T14:35:32.249Z","updated_at":"2026-04-13T01:33:32.255Z","avatar_url":"https://github.com/NghiaTranUIT.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch3 align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/NghiaTranUIT/Swifty-PostgreSQL/master/Screenshots/background.png\" width=\"100%\" /\u003e\n\u003c/h3\u003e\n  \n\u003cp align=\"center\"\u003e\n  \u003ca href=\"http://nghiatran.me\"\u003eMad lab\u003c/a\u003e \u0026bull;\n  \u003ca href=\"https://github.com/NghiaTranUIT/Titan-Postgresql\"\u003eTitan\u003c/a\u003e \u0026bull;\n  \u003cb\u003eSwifty PostgreSQL\u003c/b\u003e \u0026bull;\n  \u003ca href=\"https://github.com/NghiaTranUIT/FeSpinner\"\u003eFeSpinner\u003c/a\u003e\n  \u003cbr\u003e \u0026nbsp;\n  \u003ca href=\"https://github.com/NghiaTranUIT/iOS-Awesome-Starter-Kit/edit/master/README.md\"\u003eiOS Awesome Starter Kit\u003c/a\u003e \u0026bull;\n  \u003ca href=\"https://github.com/NghiaTranUIT/FeSlideFilter\"\u003eFeSlideFilter\u003c/a\u003e\n\u003c/p\u003e\n\nSwifty PostgreSQL\n------------\n  \nSwifty-PostgreSQL driver, written by Swift 3.0, and using in TitanKit.   \nThe Swifty warpper PostgreSQL's pointer and C functions, and handle allocate/dellocate memory automatically.   \nOffer ability to connect many database simultaneously, modeling all PostgreSQL's enum and constants.   \n   \nField model adopt Presentable protocol, so you can get rawString or realData depend on kind of data eaiser, all expensive operations are lazy computed as well.   \n\n![](https://img.shields.io/badge/Swift-3.0-blue.svg?style=flat)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n![License](https://img.shields.io/npm/l/express.svg?style=flat)\n![Platform](https://img.shields.io/badge/platform-osx-green.svg?style=flat)\n\nRoadmap\n------------\n\n- [x] Sketch\n- [x] Base Foundation (50%)\n- [ ] Fully Common PostgreSQL\n- [ ] Prefix searching - implement by Prefix Tree\n- [ ] Smart Query\n- [ ] Write Test \n\nInstallation\n------------\n\n- OSX\n\n```bash\n$ brew install postgresql\n```\n\n- Carthage\n\n```swift\ngithub \"NghiaTranUIT/Swifty-PostgreSQL\" ~\u003e 0.1\n```\n\nDocumentation\n------------\n\n- Connection Database\n```swift\nlet param = ConnectionParam(host: \"localhost\", port: \"5432\", options: \"\",\ndatabaseName: \"my-database\", user: \"nghiatran\", password: \"mypassword\")\nlet database = Database()\n\n// Connection\nlet result = database.connectDatabase(withParam: param)\n\n// Check result\nguard result.status == .CONNECTION_OK else {return}\nlet connection = result.connection!\n\n// Disconnection\ndatabase.closeConnection()\n```\n\n- Public tables\n```swift\nlet connection = result.connection!\nlet tables: [Table] = connection.publicTables\n```\n\n- Query\n```swift\nlet query: Query = \"SELECT id, first_name, last_name, email FROM users ORDER BY id DESC LIMIT 10\"\nlet result = connection.execute(query: query)\n\nguard result == .PGRES_TUPLES_OK else {return}\nprint(result.rows) // [Row]\nprint(result.columns) // [Columns]\nprint(result.numberOfColumns)\nprint(result.numberOfRows)\nprint(result.rowsAffected)\n```\n\n- Data type\n```swift\npublic enum ColumnType: UInt32 {\n    \n    case boolean = 16\n    case int64 = 20\n    case int16 = 21\n    case int32 = 23\n    case text = 25\n    case singleFloat = 700\n    case doubleFloat = 701\n    case varchar = 1043\n    case byte = 17\n    case char = 18\n    case json = 114\n    case date = 1082\n    case time = 1083\n    case timestamp = 1114\n    case unsupport = 0\n}\n```\n\n- Access data\n```swift\nlet firstRow = selfrows.first!\n\n// Id\nlet field_id = firstRow!.field(with: \"id\")\nprint(field_id.rawData) // String\nprint(field_id.isNull)  // Check if it's NULL\nprint(field_id.realData)// Real data, lazy computed, auto mapping data to json or NSDate, ...\nprint(field_id.colType) // Int32\n```\n\nRun Test\n------------\n(Progessing)  \nWill implement Docker for testing purpose. Currently, The test only passed in my laptop.\n\nContact\n------------\n  \nVinh Nghia Tran\n\nhttp://github.com/NghiaTranUIT  \nhttp://www.nghiatran.me  \nvinhnghiatran@gmail.com  \n  \nContributor\n------------\n\nIt would be greatly appreciated  when you make a pull-quest  🤗\n\nLicense\n------------\n\nSwifty PostgreSQL is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnghiatranuit%2Fswifty-postgresql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnghiatranuit%2Fswifty-postgresql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnghiatranuit%2Fswifty-postgresql/lists"}