Everything you need to build full-stack Swift applications.
Use the exact same API you know from Apple's SwiftData. The @Model macro, #Predicate, FetchDescriptor, and ModelContext all work identically on server and client.
// Same code works everywhere
let adults = #Predicate<User> {
$0.age >= 18
}
let descriptor = FetchDescriptor(
predicate: adults,
sortBy: [SortDescriptor(\User.name)]
)
let users = try context.fetch(descriptor)
Choose the database that fits your needs. PostgreSQL for production, SQLite for development and testing, or MySQL if that's what your infrastructure uses.
Define relationships with @Relationship just like in SwiftData. One-to-many and many-to-many relationships are fully supported with automatic join table management.
@Model
final class Author {
var name: String
@Relationship(deleteRule: .cascade)
var books: [Book] = []
}
@Model
final class Book {
var title: String
@Relationship(inverse: "students")
var readers: [Reader] = []
}