QueryContext

DSL receiver for building query predicates and limit.

Every predicate must resolve to a partition key, clustering key, or lookup-table column. Kandra does not support ALLOW FILTERING — queries that cannot be served from a partition key will throw at query time.

repository.findAll {
UserTable.email eq "alice@example.com" // via @LookupIndex
limit(10)
}

Why there's no +: earlier versions required +UserTable.email.eq(...), with eq() returning a plain KandraPredicate that unaryPlus() then registered. Forgetting the + on one predicate out of several compiled cleanly (Kotlin only warns on an unused expression) and silently dropped that predicate from the query — a correctness footgun with no way to detect it from inside QueryContext, since the discarded object never reached it. Declaring eq/gt/etc. as member extensions here instead means the comparison itself is the registration — there is no intermediate value that can be built and then forgotten.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
infix fun <T> KandraColumnRef<T>.eq(value: T)
Link copied to clipboard
infix fun <T> KandraColumnRef<T>.gt(value: T)
Link copied to clipboard
infix fun <T> KandraColumnRef<T>.gte(value: T)
Link copied to clipboard
infix fun <T> KandraColumnRef<T>.isIn(values: List<T>)
Link copied to clipboard
fun limit(n: Int)

Appends LIMIT n to the generated CQL.

Link copied to clipboard
infix fun <T> KandraColumnRef<T>.lt(value: T)
Link copied to clipboard
infix fun <T> KandraColumnRef<T>.lte(value: T)