ktorm
ktorm copied to clipboard
ColumnDeclaring eq operator is private
I am trying to use innerJoin for joining two tables.
ktormDatabase.from(TransactionTable)
.innerJoin(UserTable, on = TransactionTable.userId eq UserTable.id)
.select()
When I try to specify the join condition I get the following error:
Cannot access 'eq': it is private in file
The only way I could get this working was to copy the 'eq' extension function from your repository to my project.
infix fun ColumnDeclaring<*>.eq(column: ColumnDeclaring<*>): BinaryExpression<Boolean> {
return BinaryExpression(BinaryExpressionType.EQUAL, asExpression(), column.asExpression(), BooleanSqlType)
}
Is this the intended behavior? I think maybe this operator should be public.
Thanks for your help!
TransactionTable.userId and UserTable.id should be the same type.