{"id":26125992,"url":"https://github.com/powersync-ja/powersync-swift","last_synced_at":"2026-01-06T14:13:28.403Z","repository":{"id":268901274,"uuid":"876718905","full_name":"powersync-ja/powersync-swift","owner":"powersync-ja","description":"SDK that enables local-first and real-time reactive apps with embedded SQLite for Swift clients","archived":false,"fork":false,"pushed_at":"2025-08-05T12:25:42.000Z","size":205,"stargazers_count":20,"open_issues_count":6,"forks_count":5,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-08-05T14:27:53.054Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.powersync.com","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/powersync-ja.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2024-10-22T12:52:40.000Z","updated_at":"2025-08-05T12:25:44.000Z","dependencies_parsed_at":"2024-12-19T16:12:38.770Z","dependency_job_id":"b2a68ef0-fc0d-4f9e-b8a2-904fa8291876","html_url":"https://github.com/powersync-ja/powersync-swift","commit_stats":null,"previous_names":["powersync-ja/powersync-swift"],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/powersync-ja/powersync-swift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/powersync-ja%2Fpowersync-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/powersync-ja%2Fpowersync-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/powersync-ja%2Fpowersync-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/powersync-ja%2Fpowersync-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/powersync-ja","download_url":"https://codeload.github.com/powersync-ja/powersync-swift/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/powersync-ja%2Fpowersync-swift/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270690095,"owners_count":24628805,"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-16T02:00:11.002Z","response_time":91,"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":[],"created_at":"2025-03-10T17:27:30.993Z","updated_at":"2026-01-06T14:13:28.398Z","avatar_url":"https://github.com/powersync-ja.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.powersync.com\" target=\"_blank\"\u003e\u003cimg src=\"https://github.com/powersync-ja/.github/assets/7372448/d2538c43-c1a0-4c47-9a76-41462dba484f\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n_[PowerSync](https://www.powersync.com) is a sync engine for building local-first apps with instantly-responsive UI/UX and simplified state transfer. Syncs between SQLite on the client-side and Postgres, MongoDB, MySQL or SQL Server on the server-side._\n\n# PowerSync Swift\n\nThis is the PowerSync SDK for Swift clients. The SDK reference is available [here](https://docs.powersync.com/client-sdk-references/swift), API references are [documented here](https://powersync-ja.github.io/powersync-swift/documentation/powersync/).\n\n## Available Products\n\nThe SDK provides two main products:\n\n- **PowerSync**: Core SDK with SQLite support for data synchronization.\n- **PowerSyncDynamic**: Forced dynamically linked version of `PowerSync` - useful for XCode previews.\n- **PowerSyncGRDB [ALPHA]**: GRDB integration allowing PowerSync to work with GRDB databases. This product is currently in an alpha release.\n\n## Demo Apps / Example Projects\n\nThe easiest way to test the PowerSync Swift SDK is to run our demo application.\n\n- [Demo/PowerSyncExample](./Demo/README.md): A simple to-do list application demonstrating the use of the PowerSync Swift SDK using a Supabase connector.\n\n- [Demo/GRDB Demo](./Demo/README.md): A simple to-do list application demonstrating the use of the PowerSync Swift SDK using a Supabase connector and GRDB connections.\n\n## Installation\n\nAdd\n\n```swift\n    dependencies: [\n        ...\n        .package(url: \"https://github.com/powersync-ja/powersync-swift\", from: \"1.0.0\")\n    ],\n    targets: [\n        .target(\n            name: \"YourTargetName\",\n            dependencies: [\n                ...\n                .product(\n                    name: \"PowerSync\",\n                    package: \"powersync-swift\"\n                ),\n                // Optional: Add if using GRDB\n                .product(\n                    name: \"PowerSyncGRDB\",\n                    package: \"powersync-swift\"\n                )\n            ]\n        )\n    ]\n```\n\nto your `Package.swift` file.\n\n## Usage\n\n### Basic PowerSync Setup\n\n```swift\nimport PowerSync\n\nlet mySchema = Schema(\n    tables: [\n        Table(\n            name: \"users\",\n            columns: [\n                .text(\"count\"),\n                .integer(\"is_active\"),\n                .real(\"weight\"),\n                .text(\"description\")\n            ]\n        )\n    ]\n)\n\nlet powerSync = PowerSyncDatabase(\n    schema: mySchema,\n    logger: DefaultLogger(minSeverity: .debug)\n)\n```\n\n### GRDB Integration\n\nIf you're using [GRDB.swift](https://github.com/groue/GRDB.swift) by [Gwendal Roué](https://github.com/groue), you can integrate PowerSync with your existing database. Special thanks to Gwendal for their help in developing this integration.\n\n**⚠️ Note:** The GRDB integration is currently in **alpha** release and the API may change significantly. While functional, it should be used with caution in production environments.\n\n```swift\nimport PowerSync\nimport PowerSyncGRDB\nimport GRDB\n\n// Configure GRDB with PowerSync support\nvar config = Configuration()\ntry config.configurePowerSync(schema: mySchema)\n\n// Create database with PowerSync enabled\nlet dbPool = try DatabasePool(\n    path: dbPath,\n    configuration: config\n)\n\nlet powerSync = try openPowerSyncWithGRDB(\n    pool: dbPool,\n    schema: mySchema,\n    identifier: \"app-db.sqlite\"\n)\n```\n\nFeel free to use the `DatabasePool` for view logic and the `PowerSyncDatabase` for PowerSync operations.\n\n#### Limitations\n\n- Updating the PowerSync schema, with `updateSchema`, is not currently fully supported with GRDB connections.\n- This integration currently requires statically linking PowerSync and GRDB.\n- This implementation requires defining the PowerSync Schema and GRDB data types. This results in some duplication.\n- This implementation uses the SQLite session API to track updates made by the PowerSync SDK. This could use more memory compared to the Standard PowerSync SQLite implementation.\n- This implementation can cause warnings such as \"Thread Performance Checker: Thread running at User-interactive quality-of-service class waiting on a lower QoS thread running at Default quality-of-service class. Investigate ways to avoid priority inversions\". This will be addressed in a future release.\n\n## Underlying Kotlin Dependency\n\nThe PowerSync Swift SDK makes use of the [PowerSync Kotlin SDK](https://github.com/powersync-ja/powersync-kotlin) and the API tool [SKIE](https://skie.touchlab.co/) under the hood to implement the Swift package.\nHowever, this dependency is resolved internally and all public APIs are written entirely in Swift.\n\nFor more details, see the [Swift SDK reference](https://docs.powersync.com/client-sdk-references/swift) and generated [API references](https://powersync-ja.github.io/powersync-swift/documentation/powersync/).\n\n## Attachments\n\nSee the attachments [README](./Sources/PowerSync/attachments/README.md) for more information.\n\n## XCode Previews\n\nXCode previews currently fail to load in a reasonable time after adding PowerSync to an XCode project. XCode requires dynamic linking for previews. This is enabled by enabling `ENABLE_DEBUG_DYLIB` in the XCode project. It seems like the previews fail to load due to PowerSync providing a `binaryTarget` which is linked statically by default.\n\nXCode previews can be enabled by either:\n\nEnabling `Editor -\u003e Canvas -\u003e Use Legacy Previews Execution` in XCode.\n\nOr adding the `PowerSyncDynamic` product when adding PowerSync to your project. This product will assert that PowerSync should be dynamically linked, which restores XCode previews.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowersync-ja%2Fpowersync-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpowersync-ja%2Fpowersync-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowersync-ja%2Fpowersync-swift/lists"}