StatementBuilder
class StatementBuilder(session: CqlSession, codec: KandraCodec = KandraCodec.default, debugConfig: DebugConfig = DebugConfig(), consistencyConfig: ConsistencyConfig = ConsistencyConfig(), cacheSize: Int = 1000)
Builds BoundStatement instances for all CRUD operations.
Prepared statements are cached in a bounded LRU cache keyed by CQL string. Idempotency is set per statement type — SELECT and DELETE are idempotent; plain INSERT and collection mutations are not (to prevent duplicate writes on retry).
Constructors
Link copied to clipboard
constructor(session: CqlSession, codec: KandraCodec = KandraCodec.default, debugConfig: DebugConfig = DebugConfig(), consistencyConfig: ConsistencyConfig = ConsistencyConfig(), cacheSize: Int = 1000)
Functions
Link copied to clipboard
fun appendToCollection(schema: TableSchema, keyValues: List<Any>, columnName: String, values: Any, consistency: KandraConsistency? = null): BoundStatement
Link copied to clipboard
fun counterUpdate(schema: TableSchema, columnName: String, partitionKeys: Map<String, Any>, delta: Long, consistency: KandraConsistency? = null): BoundStatement
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun insertPrimary(schema: TableSchema, entity: Any, ttlSeconds: Int? = null, ifNotExists: Boolean = false, timestampMicros: Long? = null, consistency: KandraConsistency? = null): BoundStatement
Link copied to clipboard
fun insertPrimaryWithNulls(schema: TableSchema, entity: Any, ttlSeconds: Int? = null, ifNotExists: Boolean = false, timestampMicros: Long? = null, consistency: KandraConsistency? = null): BoundStatement
Same as insertPrimary but binds null as actual null (creates tombstones). Use when the caller explicitly wants to clear optional columns.
Link copied to clipboard
fun removeFromCollection(schema: TableSchema, keyValues: List<Any>, columnName: String, values: Any, consistency: KandraConsistency? = null): BoundStatement
Link copied to clipboard
fun selectById(schema: TableSchema, vararg idValues: Any, consistency: KandraConsistency? = null): BoundStatement
Link copied to clipboard
fun selectByLookup(lookup: LookupTableSchema, value: Any, consistency: KandraConsistency? = null): BoundStatement
Link copied to clipboard
fun selectByPartitionKeyIn(schema: TableSchema, ids: List<Any>, consistency: KandraConsistency? = null): BoundStatement