jw
03/20/2019, 10:33 PMCoroutineCallAdapterFactory
is not a thingjw
03/24/2019, 5:10 PMdave08
03/24/2019, 6:26 PMEllen Shapiro
03/25/2019, 11:03 AMcommonMain
module instead of the iosMain
module. Does anyone more details on how I can get that to work?dave08
03/25/2019, 11:44 AMKotlinJsonAdapterFactory
needed for Kotlin CodeGen, or is it only used for reflection mode?kpgalligan
03/25/2019, 1:54 PMdave08
03/27/2019, 4:22 PMclass IdAdapter {
private val logger = KotlinLogging.logger {}
@FromJson
@OdooIdentityId
fun fromJson(value: Any): Int? = when (value) {
is Boolean -> null
is Double -> value.toString().toInt()
is Int -> value
is ArrayList<*> -> checkArrayValue(value.first()!!)
else -> throw IllegalStateException("Non-object-non-boolean value for @OdooIdentityId field $value")
}
@ToJson
fun toJson(@OdooIdentityId value: Int?): String = TODO()
private fun checkArrayValue(value: Any): Int? = when(value) {
is Boolean -> null
is Double -> value.toInt()
is Int -> value
else -> error("Invalid Odoo identity $value")
}
}
Dico
03/28/2019, 6:50 PMjw
03/30/2019, 7:53 PMdave08
03/31/2019, 2:29 PMalec
04/20/2019, 12:59 PMkevin.cianfarini
04/21/2019, 6:25 PMfun <T : Any> Query<T>.asFlow(): Flow<Query<T>> = flow {
val channel = Channel<Unit>(CONFLATED)
val listener = object : Query.Listener {
override fun queryResultsChanged() {
channel.offer(Unit)
}
}
addListener(listener)
try {
emit(this@asFlow)
for (item in channel) {
emit(this@asFlow)
}
} finally {
removeListener(listener)
}
}
// why do we need the Channel?
fun <T : Any> Query.asFlow(): Flow<Query<T>> = flow {
val listener = object : Query.Listener {
override fun queryResultsChanges() {
emit(this@asFlow)
}
}
addListener(listener)
try {
emit(this@asFlow)
} finally {
removeListener(listener)
}
}
Mark
04/28/2019, 7:18 AMdave08
05/08/2019, 1:50 PMmoshi.adapter<Any>(type.javaObjectType)
.eric
05/10/2019, 11:14 PMalec
05/22/2019, 2:32 PMalec
05/24/2019, 12:14 PMdimsuz
05/27/2019, 5:58 PMCREATE VIEW series_full AS
SELECT series.id, series.name
FROM series
JOIN series_category ON series_category.id = series.id
ORDER BY rowid ASC;
find_one_by_id:
SELECT *
FROM series_full
WHERE id = ?;
I get an exception:
SQLiteException: no such table: series_full (code 1): , while compiling: SELECT * FROM series_full WHERE id = ?1
dave08
06/05/2019, 1:12 PMyshrsmz
06/06/2019, 6:25 AMSqlDrive.Schema
and manually execute PRAGMA statement in create
function?
I found this issue(https://github.com/square/sqldelight/issues/1241 ), but it does not cover multiplatform.louiscad
06/07/2019, 12:26 PMkotlin.KotlinNullPointerException: Response from xxx was null but response body type was declared as non-null
, including after moving to suspend fun
. What may cause Unit
to be improperly handled even though it's advertised as supported?alec
06/08/2019, 8:31 PMNikky
06/11/2019, 10:40 PMhmole
06/20/2019, 5:48 AMBufferedSource
as a return type of retrofit interface function?yshrsmz
06/21/2019, 7:33 AMoffer
is called directly inside frozen Query.Listener
.alec
06/22/2019, 2:16 PMgildor
06/24/2019, 6:04 AMcall.execute()
is bad idea, it make request non cancellable, better to use call.await() without any additional async wrappers. And if someone really want to share threads between coroutine dispatchers and OkHttp it’s better to write some custom OkHttp dispatcher, but not sure that it worth it
things likerunBlocking will work correctly. Not 100% sure how ThreadContextElement works, but as I understand it also should work, this is the whole point of this contextwork correctly with itrunBlocking and ThreadContextElement
jw
06/24/2019, 2:40 PMPaul Woitaschek
06/28/2019, 10:46 AMUndeclaredThrowableException
https://github.com/square/retrofit/issues/3128coletz
07/01/2019, 9:44 AMcom.squareup.sqldelight:runtime
and nothing changed. I tried adding also com.squareup.sqldelight:runtime-metadata
and now the IDE shows everything ok, but the compiler still says that it can't find sqldelight classes. Anyone know what can I try?