{"id":19454618,"url":"https://github.com/fauna/faunadb-swift","last_synced_at":"2025-04-25T05:30:35.566Z","repository":{"id":54196942,"uuid":"60098573","full_name":"fauna/faunadb-swift","owner":"fauna","description":"Swift driver for FaunaDB","archived":false,"fork":false,"pushed_at":"2021-07-20T00:25:11.000Z","size":2467,"stargazers_count":22,"open_issues_count":0,"forks_count":2,"subscribers_count":37,"default_branch":"main","last_synced_at":"2025-04-12T10:15:38.298Z","etag":null,"topics":["client","clients","database","driver","drivers","fauna","faunadb","ios","swift"],"latest_commit_sha":null,"homepage":"https://fauna.com","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fauna.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.txt","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-31T14:52:01.000Z","updated_at":"2025-04-10T12:05:14.000Z","dependencies_parsed_at":"2022-08-13T09:00:28.059Z","dependency_job_id":null,"html_url":"https://github.com/fauna/faunadb-swift","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fauna%2Ffaunadb-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fauna%2Ffaunadb-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fauna%2Ffaunadb-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fauna%2Ffaunadb-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fauna","download_url":"https://codeload.github.com/fauna/faunadb-swift/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250760556,"owners_count":21482826,"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":["client","clients","database","driver","drivers","fauna","faunadb","ios","swift"],"created_at":"2024-11-10T17:10:29.557Z","updated_at":"2025-04-25T05:30:35.000Z","avatar_url":"https://github.com/fauna.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Commmunity-supported Swift Driver for [FaunaDB](https://fauna.com)\n\nFaunaDB's Swift driver is now \"community-supported\". New features won't be exposed in the driver unless the necessary changes are contributed by a community member. Please email product@fauna.com if you have any questions/concerns, or would like to take a more active role in the development of the driver (eg. partnering with us and operating as a \"maintainer\" for the driver).\n\n[![CocoaPods](https://img.shields.io/cocoapods/v/FaunaDB.svg)](http://cocoapods.org/pods/FaunaDB)\n[![Coverage Status](https://codecov.io/gh/fauna/faunadb-swift/branch/main/graph/badge.svg)](https://codecov.io/gh/fauna/faunadb-swift)\n[![License](https://img.shields.io/badge/license-MPL_2.0-blue.svg?maxAge=2592000)](https://raw.githubusercontent.com/fauna/faunadb-swift/main/LICENSE)\n\nA Swift driver for [FaunaDB](https://fauna.com)\n\n## Supported Platforms\n\n* iOS 9.0+ | OSX 10.10+ | tvOS 9.0+ | watchOS 2.0+\n* Xcode 8\n* Swift 3\n\n## Documentation\n\nCheck out the Swift-specific [reference documentation](http://fauna.github.io/faunadb-swift/).\n\nYou can find more information in the FaunaDB [documentation](https://docs.fauna.com/)\nand in our [example project](https://github.com/fauna/faunadb-swift/tree/main/Example).\n\n## Using the Driver\n\n### Installing\n\nCocoaPods:\n\n```\npod 'FaunaDB', '~\u003e 2.0.0'\n```\n\nCarthage:\n\n```\ngithub 'fauna/faunadb-swift'\n```\n\nSwiftPM:\n\n```swift\n.Package(url: \"https://github.com/fauna/faunadb-swift.git\", Version(2, 0, 0))\n```\n\n### Basic Usage\n\n```swift\nimport FaunaDB\n\nstruct Post {\n    let title: String\n    let body: String?\n}\n\nextension Post: FaunaDB.Encodable {\n    func encode() -\u003e Expr {\n        return Obj(\n            \"title\" =\u003e title,\n            \"body\" =\u003e body\n        )\n    }\n}\n\nextension Post: FaunaDB.Decodable {\n    init?(value: Value) throws {\n        try self.init(\n            title: value.get(\"title\") ?? \"Untitled\",\n            body: value.get(\"body\")\n        )\n    }\n}\n\nlet client = FaunaDB.Client(secret: \"your-key-secret-here\")\n\n// Creating a new post\ntry! client.query(\n    Create(\n        at: Class(\"posts\")\n        Obj(\"data\" =\u003e Post(\"My swift app\", nil))\n    )\n).await(timeout: .now() + 5)\n\n// Retrieve a saved post\nlet getPost = client.query(Get(Ref(class: Class(\"posts\"), id: \"42\")))\nlet post: Post = try! getPost.map { dbEntry in dbEntry.get(\"data\") }\n    .await(timeout: .now() + 5)\n```\n\nFor more examples, check our online [documentation](https://docs.fauna.com/)\nand our [example project](https://github.com/fauna/faunadb-swift/tree/main/Example).\n\n## Contributing\n\nGitHub pull requests are very welcome.\n\n### Driver Development\n\nYou can compile and run the test with the following command:\n\n```\nFAUNA_ROOT_KEY=your-keys-secret-here swift test\n```\n\n## LICENSE\n\nCopyright 2018 [Fauna, Inc.](https://fauna.com/)\n\nLicensed under the Mozilla Public License, Version 2.0 (the\n\"License\"); you may not use this software except in compliance with\nthe License. You may obtain a copy of the License at\n\n[http://mozilla.org/MPL/2.0/](http://mozilla.org/MPL/2.0/)\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\nimplied. See the License for the specific language governing\npermissions and limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffauna%2Ffaunadb-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffauna%2Ffaunadb-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffauna%2Ffaunadb-swift/lists"}