shekhar23/claude-zero-to-hero-android-kmp/android-kmp-sqldelight

Claude Code and agent skill by shekhar23/claude-zero-to-hero-android-kmp

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

SQLDelight as the KMP-native database — schema files, generated queries, coroutines extension, platform drivers, migrations. Use as the Room replacement when targeting KMP. Trigger on: "SQLDelight", "KMP database", "multiplatform Room", "shared database", "sqldelight KMP".

Install

npx vskill@latest install shekhar23/claude-zero-to-hero-android-kmp/android-kmp-sqldelight

SKILL.md

KMP SQLDelight

Dependency setup

toml
# libs.versions.toml
[versions]
sqldelight = "2.0.2"
[libraries]
sqldelight-android-driver = { module = "app.cash.sqldelight:android-driver", version.ref = "sqldelight" }
sqldelight-native-driver = { module = "app.cash.sqldelight:native-driver", version.ref = "sqldelight" }
sqldelight-coroutines = { module = "app.cash.sqldelight:coroutines-extensions", version.ref = "sqldelight" }
[plugins]
sqldelight = { id = "app.cash.sqldelight", version.ref = "sqldelight" }
kotlin
// core:data build.gradle.kts
sqldelight {
databases {
create("AppDatabase") {
packageName.set("com.example.db")
}
}
}

Schema file (commonMain/sqldelight/)

sql
-- Task.sq
CREATE TABLE TaskEntity (
id TEXT NOT NULL PRIMARY KEY,
title TEXT NOT NULL,
due_at INTEGER,
priority TEXT NOT NULL DEFAULT 'MEDIUM',
is_completed INTEGER NOT NULL DEFAULT 0
);
selectAll:
SELECT * FROM TaskEntity ORDER BY due_at ASC;
selectById:
SELECT * FROM TaskEntity WHERE id = :id;
upsert:
INSERT OR REPLACE INTO TaskEntity VALUES (?, ?, ?, ?, ?);
delete:
DELETE FROM TaskEntity WHERE id = :id;

Platform driver factory (expect/actual)

kotlin
// commonMain
expect class DriverFactory {
fun createDriver(): SqlDriver
}
// androidMain
actual class DriverFactory(private val context: Context) {
actual fun createDriver(): SqlDriver =
AndroidSqliteDriver(AppDatabase.Schema, context, "app.db")
}
// iosMain
actual class DriverFactory {
actual fun createDriver(): SqlDriver =
NativeSqliteDriver(AppDatabase.Schema, "app.db")
}

Database instance (commonMain)

kotlin
fun createDatabase(factory: DriverFactory): AppDatabase =
AppDatabase(factory.createDriver())

DAO-style wrapper with Flow

kotlin
// commonMain — core:data
class TaskLocalDataSource(private val db: AppDatabase) {
fun getTasks(): Flow<List<TaskEntity>> =
db.taskEntityQueries
.selectAll()
.asFlow()
.mapToList(Dispatchers.IO)
suspend fun upsert(task: TaskEntity) = withContext(Dispatchers.IO) {
db.taskEntityQueries.upsert(
task.id, task.title, task.dueAt, task.priority, if (task.isCompleted) 1L else 0L
)
}
}

Checklist

  • [ ] .sq files in commonMain/sqldelight/ under the correct package path
  • [ ] DriverFactory uses expect/actual per platform
  • [ ] All queries emit Flow via .asFlow().mapToList()
  • [ ] Dispatcher is Dispatchers.IO, never Main
  • [ ] Migrations defined in AppDatabase.Schema before bumping schema version

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/shekhar23/claude-zero-to-hero-android-kmp/android-kmp-sqldelight/badge)](https://verified-skill.com/skills/shekhar23/claude-zero-to-hero-android-kmp/android-kmp-sqldelight)

Something wrong with this skill or its page? Tell us.