Powerful Features

Everything you need to build full-stack Swift applications.

100% API Compatible

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.

  • @Model, @Attribute, @Relationship macros
  • #Predicate with full expression support
  • FetchDescriptor, SortDescriptor
  • ModelContext.fetch(), .insert(), .delete(), .save()
  • Swift 6 ready with Swift 5 compatibility
// 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)
🐘
PostgreSQL
🐬
MySQL
🪶
SQLite

Multiple Database Backends

Choose the database that fits your needs. PostgreSQL for production, SQLite for development and testing, or MySQL if that's what your infrastructure uses.

  • Connection pooling for high performance
  • Automatic migrations
  • In-memory SQLite for testing

Full Relationship Support

Define relationships with @Relationship just like in SwiftData. One-to-many and many-to-many relationships are fully supported with automatic join table management.

  • Lazy loading of related objects
  • Cascade delete rules
  • Change tracking for relationships
@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] = []
}

Start building today

Get SwiftDataServer