Skip to main content
BoutiqueDB leverages Point-Free’s StructuredQueries DSL alongside custom @BoutiqueTable macros to map Swift structs directly to database tables.

Defining @Table Models

Annotate your model struct with @Table and specify column types. StructuredQueries automatically generates type-safe query builders (Note.all, Note.where, Note.insert).
Note.swift
Macro Modifier
Marks the property as the table’s Primary Key.
Swift Types
Standard Swift types automatically map to SQLite types: String, Int, Double, Bool, Data, UUID, and Date.

Turso Enhancements with @BoutiqueTable

When advanced database constraints or indexes are required, use @BoutiqueTable:
UserSetting.swift

STRICT Mode

Enforces strict datatype checking on SQLite columns at insertion time.

WITHOUT ROWID

Optimizes index storage and lookups for tables with explicit primary keys.

Type-Safe Queries

Once a model is defined, perform CRUD operations using Swift closures instead of raw SQL strings:
Compile-Time Safety: If a model property name changes or type changes, Xcode catches query mismatches during project compilation!