Skip to content

Commit

Permalink
pass consistentReads through overload (#191)
Browse files Browse the repository at this point in the history
* pass consistentReads through overload

* fix code format
  • Loading branch information
kyeotic authored Sep 3, 2024
1 parent 64f40ef commit 9c4094e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tempest2/src/main/kotlin/app/cash/tempest2/LogicalDb.kt
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ interface LogicalDb : LogicalTable.Factory {
fun batchLoad(
keys: Iterable<Any>,
consistentReads: Boolean
) = batchLoad(keys, consistentReads = false, MAX_BATCH_READ)
) = batchLoad(keys, consistentReads, MAX_BATCH_READ)

fun batchLoad(
vararg keys: Any,
Expand Down
11 changes: 7 additions & 4 deletions tempest2/src/test/kotlin/app/cash/tempest2/LogicalDbBatchTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,13 @@ class LogicalDbBatchTest {
musicTable.playlistInfo.save(playlistInfo)

val loadedItems = musicDb.batchLoad(
PlaylistInfo.Key("PLAYLIST_1"),
AlbumTrack.Key("ALBUM_1", track_number = 1),
AlbumTrack.Key("ALBUM_1", track_number = 2),
AlbumTrack.Key("ALBUM_1", track_number = 3)
keys = listOf(
PlaylistInfo.Key("PLAYLIST_1"),
AlbumTrack.Key("ALBUM_1", track_number = 1),
AlbumTrack.Key("ALBUM_1", track_number = 2),
AlbumTrack.Key("ALBUM_1", track_number = 3)
),
consistentReads = true
)
assertThat(loadedItems.getItems<AlbumTrack>()).containsAll(albumTracks)
assertThat(loadedItems.getItems<PlaylistInfo>()).containsExactly(playlistInfo)
Expand Down

0 comments on commit 9c4094e

Please sign in to comment.