What problem does it solve?
Adding local persistence to a Kotlin Multiplatform feature requires coordinating eight distinct phases — DataSource interface, SQLDelight schema, migrations, DAO, mapper, LocalDataSource, and DI — each with strict conventions that are easy to get wrong.
Core Features & Use Cases
- Eight-Phase Workflow: Guides creation of the DataSource interface,
.sq schema, .sqm migrations, DAO interface and implementation, local mapper, LocalDataSource implementation, and Koin DI registration.
- Convention Enforcement: Codifies rules such as Flow vs. suspend returns,
executeAsOneOrNull() for single reads, mandatory cleanTable: queries, and singleOf/factoryOf DI scoping.
- Migration Safety: Details
.sqm file numbering, immutability, NOT NULL DEFAULT requirements, and verification via verifySqlDelightMigration.
- Use Case: When adding a new entity like a Category table to the Alkaa app, follow the phases to produce a complete, convention-compliant local data layer ready for repository and E2E test integration.
Quick Start
Ask the AI to add local database persistence for a new entity in the Alkaa project using SQLDelight.