commonMain.maryk.test.requests.scanChanges.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of maryk-testmodels Show documentation
Show all versions of maryk-testmodels Show documentation
Maryk is a Kotlin Multiplatform library which helps you to store, query and send data in a structured way over multiple platforms. The data store stores any value with a version, so it is possible to request only the changed data or live listen for updates.
The newest version!
package maryk.test.requests
import maryk.core.models.graph
import maryk.core.models.key
import maryk.core.query.filters.Exists
import maryk.core.query.orders.descending
import maryk.core.query.requests.scanChanges
import maryk.test.models.SimpleMarykModel
import maryk.test.models.TestMarykModel
private val testKey1 = TestMarykModel.key("AAACKwEAAg")
val scanChangesRequest = SimpleMarykModel.scanChanges()
val scanChangesMaxRequest = TestMarykModel.run {
scanChanges(
startKey = testKey1,
where = Exists(invoke { uint::ref }),
order = this { uint::ref }.descending(),
limit = 300u,
includeStart = false,
toVersion = 2345uL,
fromVersion = 1234uL,
maxVersions = 10u,
select = graph { listOf(uint) }
)
}