https://kotlinlang.org logo
#exposed
Title
# exposed
m

maxmello

11/20/2020, 10:09 AM
Something like
OrderItems.deleteWhere { OrderItems.id inSubQuery ( OrderItems.innerJoin(Orders).innerJoin(Items).slice(Orders.id).select { Orders.status eq 0 and (Items.alias eq "String") } ) }
(untested) would probably work as a workaround. It seems that deleteWhere is only available from a
Table
, not a
Join
or their superclass
ColumnSet
. The delete implementation does not seem to support DELETE <TableName> FROM …:
Copy code
package org.jetbrains.exposed.sql.vendors // Default.kt
open fun delete(
        ignore: Boolean,
        table: Table,
        where: String?,
        limit: Int?,
        transaction: Transaction
    ): String {
        // ...
        return buildString {
            append("DELETE FROM ")
            append(transaction.identity(table))
            if (where != null) {
                append(" WHERE ")
                append(where)
            }
            // ...
        }
    }
🙏 1
p

Pavel Naumov

11/20/2020, 10:16 AM
thanks alot, i'll test it soon.