Trevor Stone
04/11/2022, 1:55 AMDorit Rein
04/11/2022, 8:40 PMprojectFiles
encompass? Is it divided up by gradle target?spierce7
04/12/2022, 4:35 AMAndrew O Hart
04/12/2022, 10:52 AMretrieveMostRecentLastModificationDate:
SELECT MAX(Information.lastModificationDate) FROM Information LIMIT 1;
And it is returning Query<RetrieveMostRecentLastModificationDate>
I just need to return the most recent date from the table, so I would expect it to return as an Int or a Long as we are storing it using toEpochMillisecondsLilly
04/12/2022, 11:30 PMHttpURLConnection
as http client, every 3rd party has to be based on HttpURLConnection
and so okhttp too or not? But since Android 4.4 HttpURLConnection
uses okhttp as http engine. This confuses me a bit. Does that mean okhttp is not based on any other API and is written from scratch? Can someone enlighten me please?David Nedrow
04/20/2022, 4:08 PMr
04/22/2022, 11:25 PMIO
and the transformation of data happens on Default
. I have something like this:
fun someQuery(): Flow<List<SomeItem>> = database.transactionWithResult {
database.someQueries.someItems(someMapper)
.asFlow()
.flowOn(IO)
.mapToList()
.distinctUntilChanged()
.map { someTransformation(it) }
.flowOn(Default)
}
Is the flowOn(IO)
required?. What about this:
...
database.someQueries.someItems(someMapper)
.asFlow()
.mapToList(IO)
.distinctUntilChanged()
.map { someTransformation(it) }
.flowOn(Default)
...
Would that make any difference? From my understanding, mapToList()
will use Default
if we don't pass a context but I want to make sure IO
is used during the DB access and Default
during the transforming the data. Thanks in advance!charleskorn
04/24/2022, 2:42 AMColton Idle
04/25/2022, 2:40 AMisAuthRefreshInProgress
and short-circuit the interceptor if it's already in progress, but then I'm not sure how I'd wait for the auth refresh to be complete, so I can make that second call again. Here's a gist of my current interceptor.jw
04/27/2022, 3:22 AMDerek Ellis
04/29/2022, 4:49 AM?
placeholders (like INSERT INTO a VALUES (?, ?)
) to something else, e.g. ($1, $2)
, if the underlying driver doesn't like the question marks?jw
04/29/2022, 4:04 PMwithContext(Default) { delay(2.seconds) }
and then assert no events were receivedDragos Rachieru
05/02/2022, 9:22 AMokio
, is there a way to read a path using ByteReadChannel
?
I am trying to create a multiplatform image loading library and I want to create something like this:
https://github.com/alialbaali/Kamel/blob/main/kamel-core/src/jvmMain/kotlin/io/kamel/core/fetcher/JvmFileFetcher.ktPaul Woitaschek
05/03/2022, 6:30 AMprivate fun contentFlow(): Flow<Int> {
return combine(
flowOf(Unit),
flowOf(2).onStart { emit(1) }
) { _, b ->
b
}.onEach { println(it) }
}
@Test
fun turbineCollect() = runTest {
contentFlow()
.test {
check(awaitItem() == 1)
cancelAndIgnoreRemainingEvents()
}
}
@Test
fun regularCollect() = runTest {
check(contentFlow().toList() == listOf(1, 2))
}
https://github.com/cashapp/turbine/issues/112jw
05/03/2022, 6:28 PMbrabo-hi
05/04/2022, 4:57 PMLaurence Muller
05/09/2022, 4:05 PMapp.cash.sqldelight
and version 2.0.0-alpha02
gradle seems to be a bit unhappy. I'm using AS Dolphin Canary 9.Laurence Muller
05/09/2022, 7:04 PMdialect = "app.cash.sqldelight:sqlite-3-35-dialect:2.0.0-alpha02"
With: implementation 'com.github.requery:sqlite-android:3.36.0'
and this is working quite well:
val driver = AndroidSqliteDriver(
schema = MyDatabase.Schema,
context = this,
name = "test.db",
factory = RequerySQLiteOpenHelperFactory()
)
Philip Dukhov
05/13/2022, 6:22 AMNullPointerException
Is there a way to enable exceptions for non null fields when deserialization fails?hfhbd
05/13/2022, 9:55 AMdialect = ":native-dialect
would work.mbonnin
05/13/2022, 11:11 AMinternal
?jw
05/21/2022, 1:00 AMdimsuz
05/21/2022, 12:25 PMsqlDelight
how do you usually combine relations to keep everything reactively observable?
Let's say I have a User
and Comment
tables, each user has many comments. And now I build a list of users with comments:
val users: List<User> = database.userQueries.select_all { userId, userName ->
val comments = database.commentQueries.find_by_user_id(userId).executeAsList()
User(userId = userId, name = userName, comments = comments)
}.executeAsList()
But now I want to create a Flow<List<User>>
.
I have no problem doing
val usersFlow = database.userQueries.select_all(...).asFlow()
But this won't emit if individual comment changes, won't it?
So I need to do asFlow
on each individual user's "comment"-query and then flatMap them, this gets complicated suddenly.
Is there a nicer way?saket
05/24/2022, 2:39 PMjw
05/24/2022, 10:47 PMAnastasia Rozovskaya
05/26/2022, 2:26 PMDorit Rein
05/31/2022, 8:46 PMMergeModules
and a MergeComponent
that depends on that MergeModules
. It looks something like this:
@MergeModules(scope = MyScope::class)
public interface MyModule
@MergeComponent(
scope = AnvilScope::class,
dependencies = [],
modules = [MyModule::class]
)
public interface MyComponent
However, Anvil complains that it can't resolve MyModule
even though they are defined in the same generated file. Any thoughts?Paul Woitaschek
06/01/2022, 9:05 PMPaul Woitaschek
06/04/2022, 12:06 PMZac Sweers
06/11/2022, 10:30 PM