Contacts Table
Component Detail
Data Layer
low complexity
Shared Component
mobile
0
Dependencies
2
Dependents
0
Entities
0
Integrations
Description
Drift table definition for offline-first local storage of contact records inside the SQLCipher-encrypted local database. Provides typed DAO methods for CRUD operations and reactive Stream-based queries consumed by the Contacts Service. Stores sync metadata including last-synced timestamps and dirty flags to support the mutation outbox and conflict resolution with the PostgreSQL backend.
contacts-table
Responsibilities
- Define the contacts Drift table schema including contact fields and sync state metadata
- Provide typed DAO methods for insert, update, delete, and reactive watch queries
- Return Stream<List<ContactData>> that auto-updates when any contact record changes
- Store dirty flags and last-synced timestamps for mutation outbox and conflict resolution
Interfaces
insertContact(contact: ContactsCompanion) → Future<int>
updateContact(contact: ContactsCompanion) → Future<bool>
deleteContact(contactId: String) → Future<int>
watchAllContacts() → Stream<List<ContactData>>
watchContactsByUser(userId: String) → Stream<List<ContactData>>
watchContactsByChapter(chapterId: String) → Stream<List<ContactData>>
getContactById(contactId: String) → Future<ContactData?>
getPendingSyncContacts() → Future<List<ContactData>>
Relationships
Dependents (2)
Components that depend on this component