expression isn't available in Postgres. The way to do it in postgres would be with
table_name.timestamp::time BETWEEN startTime AND endTime
So I would like to do something like:
Copy code
MyTable.select(MyTable.columns)
.where { literalExpression("my_table.timestamp::time between $startTime AND $endTime") }
Alexander
01/31/2024, 9:57 AM
Solved it by creating a modified
Time
class instead:
Copy code
public class TimePg<T : Temporal?>(
public val expr: Expression<T>,
) : Function<LocalTime>(ExposedStatic.LOCAL_TIME_COLUMN) {
override fun toQueryBuilder(
queryBuilder: QueryBuilder,
): Unit = queryBuilder { append(expr, "::time") }
}