TestSqlDriverFactory

actual class TestSqlDriverFactory(val sqlDriverFactory: SqlDriverFactory, overrideName: Boolean) : SqlDriverFactory

A wrapper class of SqlDriverFactory It will make sure to use InMemory databases for the platforms that are persistence such as android and ios To avoid test cases from conflicting Also creates a new database for each use case by overriding the db name everytime a new factory is created

Parameters

sqlDriverFactory

main driver factory to be wrapper with in memory test drivers

overrideName

if true it will add prefix to the database name to make sure every new driver is using a unique database to avoid conflicts, eg dbName: my-client.db will be 1-my-client.db, 2-my-client.db

expect class TestSqlDriverFactory(sqlDriverFactory: SqlDriverFactory, overrideName: Boolean = true) : SqlDriverFactory
actual class TestSqlDriverFactory(val sqlDriverFactory: SqlDriverFactory, overrideName: Boolean) : SqlDriverFactory
actual class TestSqlDriverFactory(val sqlDriverFactory: SqlDriverFactory, overrideName: Boolean) : SqlDriverFactory
actual class TestSqlDriverFactory(val sqlDriverFactory: SqlDriverFactory, overrideName: Boolean) : SqlDriverFactory

Constructors

Link copied to clipboard
actual constructor(sqlDriverFactory: SqlDriverFactory, overrideName: Boolean)

Creates an instance of TestSqlDriverFactory with the provided SQL driver factory and optional database name override.

expect constructor(sqlDriverFactory: SqlDriverFactory, overrideName: Boolean = true)
actual constructor(sqlDriverFactory: SqlDriverFactory, overrideName: Boolean)
actual constructor(sqlDriverFactory: SqlDriverFactory, overrideName: Boolean)
actual constructor(sqlDriverFactory: SqlDriverFactory, overrideName: Boolean)

Properties

asyncSchema
Link copied to clipboard
val asyncSchema: SqlSchema<QueryResult.AsyncValue<Unit>>
expect val asyncSchema: SqlSchema<QueryResult.AsyncValue<Unit>>
val asyncSchema: SqlSchema<QueryResult.AsyncValue<Unit>>
val asyncSchema: SqlSchema<QueryResult.AsyncValue<Unit>>
val asyncSchema: SqlSchema<QueryResult.AsyncValue<Unit>>
Link copied to clipboard
private var context: Context?
databaseName
Link copied to clipboard
expect val databaseName: String
mutex
Link copied to clipboard
private val mutex: Mutex
private val mutex: Mutex
Link copied to clipboard
private var sqlDriver: SqlDriver?
sqlDriverFactory
Link copied to clipboard
val sqlDriverFactory: SqlDriverFactory
val sqlDriverFactory: SqlDriverFactory
val sqlDriverFactory: SqlDriverFactory
val sqlDriverFactory: SqlDriverFactory

Functions

Link copied to clipboard
actual open suspend override fun createDriver(): SqlDriver
expect open suspend override fun createDriver(): SqlDriver
actual open suspend override fun createDriver(): SqlDriver
actual open suspend override fun createDriver(): SqlDriver
actual open suspend override fun createDriver(): SqlDriver
Link copied to clipboard
fun SqlDriverFactory.databaseName(overrideName: Boolean): String
Link copied to clipboard
actual open override fun getSchema(): SqlSchema<QueryResult.Value<Unit>>?
expect open override fun getSchema(): SqlSchema<QueryResult.Value<Unit>>?
actual open override fun getSchema(): SqlSchema<QueryResult.Value<Unit>>?
actual open override fun getSchema(): SqlSchema<QueryResult.Value<Unit>>?
actual open override fun getSchema(): SqlSchema<QueryResult.Value<Unit>>?