spand
06/26/2019, 7:41 AMSqlExpressionBuilder
somehow ?tapac
06/26/2019, 11:04 AMExpression<*>
as a receiver?
I guess it's impossible as you need to have 2 receivers on a single function.
Why do you need that? To reduce function scope?spand
06/26/2019, 11:07 AMinInterval
that checks a column c is: interval.start <= c && c < interval.endtapac
06/26/2019, 12:03 PMExpression<DateTime?>.inInterval(..)
but it will be available out of SqlExpressionBuilder
scope.spand
06/26/2019, 12:06 PMgreaterEq
, and less
. Would just be nice to have it encapsulated like the rest.tapac
06/26/2019, 12:11 PMspand
06/26/2019, 12:16 PMtapac
06/26/2019, 12:19 PMval SqlExpressionBuilder.inInterval: ExpressionWithColumnType<DateTime?>.(Interval) -> Expression<Boolean> get() = { interval ->
val expr = this
(expr greater interval.start) and (expr less interval.end)
}
fun main() {
Op.build {
val expr = dateLiteral(DateTime.now())
expr.inInterval(3)
}
}
spand
06/26/2019, 12:22 PM