Zoltan Demant
08/20/2023, 9:26 AMZoltan Demant
08/20/2023, 9:28 AMhfhbd
08/20/2023, 10:12 AMZoltan Demant
08/20/2023, 10:39 AMsqldelight = { id = 'app.cash.sqldelight', version.ref = 'sqldelight' }
(sqldelight is 2.0.0)hfhbd
08/20/2023, 10:40 AMZoltan Demant
08/20/2023, 10:49 AMhfhbd
08/20/2023, 10:55 AMhfhbd
08/20/2023, 10:56 AMZoltan Demant
08/20/2023, 10:57 AMExpecting member declaration
Function declaration must have a name
Unresolved reference: cursor
Id guess that some ( or { is misplaced and results in everything after it being incorrect.Zoltan Demant
08/20/2023, 11:00 AMQuery(−1_744_723_024, arrayOf("profileSql"), driver, "Profile.sq", "all",
"SELECT * FROM profileSql") { cursor ->
mapper(
profileSqlAdapter.idAdapter.decode(cursor.getString(0)!!),
profileSqlAdapter.themeAdapter.decode(cursor.getString(1)!!),
profileSqlAdapter.currencyAdapter.decode(cursor.getString(2)!!),
cursor.getString(3)?.let { profileSqlAdapter.selectedAccountIdAdapter.decode(it) }
)
}
Zoltan Demant
08/20/2023, 11:01 AMpublic fun <T : Any> find(id: Id, mapper: (
id: Id,
theme: Theme,
currency: Currency,
selectedAccountId: Id?,
) -> T): Query<T> = FindQuery(id) { cursor ->
mapper(
profileSqlAdapter.idAdapter.decode(cursor.getString(0)!!),
profileSqlAdapter.themeAdapter.decode(cursor.getString(1)!!),
profileSqlAdapter.currencyAdapter.decode(cursor.getString(2)!!),
cursor.getString(3)?.let { profileSqlAdapter.selectedAccountIdAdapter.decode(it) }
)
}
I suspect that the generic Query above should in fact be something like AllQuery?Zoltan Demant
08/20/2023, 11:13 AMZoltan Demant
08/20/2023, 11:23 AMfun <RowType : Any> Query(..)
that the generated code tries to call. I wonder if the issue is related to the wrong function being looked up with the Query invocation? At least when looking at the code, it brings me to the abstract class instead of the function.
Heres the intended query function:
fun <RowType : Any> Query(
identifier: Int,
queryKeys: Array<out String>,
driver: SqlDriver,
fileName: String,
label: String,
query: String,
mapper: (SqlCursor) -> RowType,
): Query<RowType> {
return SimpleQuery(identifier, queryKeys, driver, fileName, label, query, mapper)
}
And heres the abstract class that the code points me to:
abstract class Query<out RowType : Any>(
mapper: (SqlCursor) -> RowType,
)
Zoltan Demant
08/20/2023, 11:32 AMZoltan Demant
08/20/2023, 11:56 AMhfhbd
08/20/2023, 11:57 AMZoltan Demant
08/20/2023, 11:59 AMZoltan Demant
08/20/2023, 12:00 PMhfhbd
08/20/2023, 12:03 PMdoFirst { Locale.set(Root) }
and doLast { Locale.set(Swedish) }
but I don’t know if this works with the Gradle workers. But would be a better workaround than changing
your OS settings, if it does work.Zoltan Demant
08/20/2023, 12:09 PM