Announcing the Swift SDK for SurrealDB
We're excited to share the first alpha release of the official Swift SDK for SurrealDB. If you're building with Swift, you can now start experimenting with SurrealDB using an API designed to feel natural in the Swift ecosystem.
Swift is the language behind the apps people use most directly: iPhone and iPad apps, macOS desktop software, Apple Watch and Vision Pro experiences, and increasingly the server-side services that back them. Those apps have a common problem. The data is relational, document-shaped, and increasingly vector-based all at once, and stitching that together usually means a REST layer, a caching layer, a search service, and a pile of glue code to keep them in sync.
SurrealDB collapses that stack into one database, and the Swift SDK gives you a direct line to it. A few things this makes easier:
Real-time interfaces. Live queries stream changes as they happen, so a list, feed, or dashboard stays in sync without polling or hand-rolled sockets.
Collaborative and multi-user apps. Chat, shared documents, presence, and notifications all work off the same live connection.
AI and agent-driven apps. Documents, graphs, and vectors live in one place, so retrieval and context for on-device or server-side agents doesn't need a separate stack.
Server-side Swift. The same SDK works in Swift backends, so client and server share one data model and one set of types.
The SDK is built around pluggable transport engines, with WebSocket and HTTP in this release. That architecture leaves the door open for an embedded engine, running SurrealDB directly inside the app on the device rather than over a network connection. It isn't in the alpha, but it's the direction we're heading, and it's where Swift gets interesting for edge use cases: apps that need to keep working offline, wearables and Vision Pro experiences with intermittent connectivity, and on-device agents that want local context without a round trip.
Here's what you can expect from the v1 alpha:
Native async/await support for asynchronous database operations
Type-safe data handling with Swift's Codable ecosystem
Support for common SurrealDB operations including querying, selecting, creating, updating, upserting, merging, patching, and deleting records
Authentication and session support
Live queries for working with real-time data
Multiple connection protocols, including WebSocket and HTTP
Swift Package Manager support for straightforward integration into your projects
As an alpha release, the SDK is still evolving and we'd love to get it into the hands of Swift developers early. Give it a try, let us know what works well, and tell us where you think it could be improved. If you run into an issue or want to contribute, come talk to us or open an issue on GitHub.
GitHub: surrealdb/surrealdb.swift
Swift Package Index: https://swiftpackageindex.com/surrealdb/surrealdb.swift