Was curious, do others have thoughts on adjusting ...
# exposed
a
Was curious, do others have thoughts on adjusting
where
to be closer to
andWhere
?
Copy code
fun where(predicate: Op<Boolean>): Query {
    where?.let {
        error("WHERE clause is specified twice. Old value = '$it', new value = '$predicate'")
    }
    where = predicate
    return this
}
^ to me, I end up just using
andWhere
everywhere because of the built in handling of chaining
Copy code
fun Query.andWhere(andPart: SqlExpressionBuilder.() -> Op<Boolean>) = adjustWhere {
    val expr = Op.build { andPart() }
    if (this == null) expr else this and expr
}
Why always throwing the error for chaining
where
?
l
I think the purpose of
where
is make the code look more like SQL, so no chaining is necessary.
Copy code
.where {
  (StudentAdvisorTable.institutionId eq institutionId)
   .and(StudentAdvisorTable.advisorId eq advisorId)
}