SwiftDataServer Documentation
SwiftDataServer brings Apple's SwiftData API to server-side Swift. Define your models once and use them on iOS, macOS, and your Vapor server with PostgreSQL, MySQL, or SQLite backends.
Installation
Add SwiftDataServer to your project and configure your first database backend.
Quick Start
Get up and running in minutes with a complete working example.
Defining Models
Learn how to define persistent models using the @Model macro.
Vapor Integration
Integrate SwiftDataServer with your Vapor application.
Key Features
- 100% API Compatible - Use the same
@Model,#Predicate,FetchDescriptor, andModelContextAPIs you know from SwiftData - Multiple Backends - PostgreSQL, MySQL, and SQLite support with automatic migrations
- Swift 6 Ready - Full concurrency support with Swift 5 compatibility
- Vapor Integration - First-class support for request-scoped contexts
- Share Models - Define models once, use on iOS/macOS and server
Requirements
- Swift 5.10+ (Swift 6 supported)
- macOS 14+ or Linux
- PostgreSQL 14+, MySQL 8+, or SQLite 3.35+
Getting Help
If you need help or have questions:
- Check the documentation sections in the sidebar
- Email support@swiftdataserver.com for technical support