Skip to main content
Follow this step-by-step guide to get up and running with BoutiqueDB in your Swift app.
1

Define your @Table Model

Create a type-safe database model using StructuredQueries. BoutiqueDB models map directly to SQLite tables.
TaskItem.swift
2

Define Database Migrations

BoutiqueDB uses append-only migrations to manage your schema safely over time.
Migrations.swift
3

Initialize BoutiqueDB Actor

Initialize your database instance on @MainActor during app startup.
AppStore.swift
4

Bind Live Queries to SwiftUI

Use @LiveQuery inside your SwiftUI views to receive real-time updates as underlying database rows change.
TaskListView.swift
What’s Happening Under the Hood? When you write to db.write, BoutiqueDB records tiny Change Data Capture (CDC) events (turso_cdc). @LiveQuery listens for CDC change tokens and updates your SwiftUI view instantly (< 250ms latency) without full-table reloads!