Coverage Summary for Class: KaariDatabaseImpl (com.javiersc.kaari.samples.strategies.internal.strategies)
Class |
Method, %
|
Branch, %
|
Line, %
|
Instruction, %
|
KaariDatabaseImpl |
0%
(0/1)
|
|
0%
(0/2)
|
0%
(0/11)
|
KaariDatabaseImpl$Schema |
0%
(0/3)
|
|
0%
(0/5)
|
0%
(0/14)
|
Total |
0%
(0/4)
|
|
0%
(0/7)
|
0%
(0/25)
|
package com.javiersc.kaari.samples.strategies.`internal`.strategies
import app.cash.sqldelight.TransacterImpl
import app.cash.sqldelight.db.AfterVersion
import app.cash.sqldelight.db.QueryResult
import app.cash.sqldelight.db.SqlDriver
import app.cash.sqldelight.db.SqlSchema
import com.javiersc.kaari.samples.strategies.`internal`.CharacterQueries
import com.javiersc.kaari.samples.strategies.`internal`.KaariDatabase
import kotlin.Int
import kotlin.Unit
import kotlin.reflect.KClass
internal val KClass<KaariDatabase>.schema: SqlSchema
get() = KaariDatabaseImpl.Schema
internal fun KClass<KaariDatabase>.newInstance(driver: SqlDriver): KaariDatabase =
KaariDatabaseImpl(driver)
private class KaariDatabaseImpl(
driver: SqlDriver,
) : TransacterImpl(driver), KaariDatabase {
public override val characterQueries: CharacterQueries = CharacterQueries(driver)
public object Schema : SqlSchema {
public override val version: Int
get() = 1
public override fun create(driver: SqlDriver): QueryResult<Unit> {
driver.execute(null, """
|CREATE TABLE CharacterEntity (
| id TEXT NOT NULL PRIMARY KEY,
| name TEXT NOT NULL UNIQUE
|)
""".trimMargin(), 0)
return QueryResult.Unit
}
public override fun migrate(
driver: SqlDriver,
oldVersion: Int,
newVersion: Int,
vararg callbacks: AfterVersion,
): QueryResult<Unit> = QueryResult.Unit
}
}