ktorm icon indicating copy to clipboard operation
ktorm copied to clipboard

ColumnDeclaring eq operator is private

Open biancasfiriac opened this issue 3 years ago • 1 comments

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!

biancasfiriac avatar Oct 18 '22 08:10 biancasfiriac

TransactionTable.userId and UserTable.id should be the same type.

vincentlauvlwj avatar Oct 18 '22 08:10 vincentlauvlwj