Closed
Description
I have a table that has two fields of type Datetime and int.
object DummyTable : IntIdTable("db.table", columnName = "id") {
val createdAt = datetime("created_at")
val mins = integer("mins")
override val primaryKey = PrimaryKey(id)
}
I have a function where i want to check the condition that createdAt plus mins is less than the Datetime now.
fun isValid(id: String): Int? {
return DummyTable.select{
COND??
}.single()[DummyTable.mins]
}
Something like this:
DummyTable.createdAt plus minutes lessEq DateTime.now()??
Is there any method in exposed sql that can make it possible?