com.sxtanna.db.struct.statement.delete.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Kuery Show documentation
Show all versions of Kuery Show documentation
MySQL Kotlin DSL/ORM based on HikariCP
package com.sxtanna.db.struct.statement
import com.sxtanna.db.struct.Table
import com.sxtanna.db.type.Executed
import com.sxtanna.db.type.Targeted
/**
* Describes an SQL "DELETE" statement
*/
interface Delete : Executed, Targeted, T>
/**
* An object that can delete rows from a table
*/
interface DBDeleter {
/**
* Create a Delete statement for this table
* * Execute statement either by calling [Delete.execute]
* * or
* * Returning it from a Kuery#invoke block
*/
fun delete(table : Table) : Delete
/**
* Delete the supplied rows from this table
* * Executed automatically
*/
fun delete(table : Table, vararg rows : T) {
delete(table, rows.toList())
}
/**
* Delete the supplied rows from this table
* * Executed automatically
*/
fun delete(table : Table, rows : Collection)
/**
* Delete all rows from this table
* * Executed automatically
* * Can be undone
* * **Consider using [DBTruncater.truncate] instead**
*
* @see [DBTruncater.truncate]
*/
fun deleteAllRows(table : Table)
/**
* An object that can delete rows from its table
*/
interface TableDeleter {
/**
* @see [DBDeleter.delete]
*/
fun delete() : Delete
/**
* Deleter.delete(table : Table<T>, varargs rows : T)
*
* @sample [Cannot_link_to_specific_method][delete]
*/
fun delete(vararg rows : T) {
delete(rows.toList())
}
/**
* Deleter.delete(table : Table<T>, rows : Collection<T>)
*
* @sample [Cannot_link_to_specific_method][delete]
*/
fun delete(rows : Collection)
/**
* @see [DBDeleter.deleteAllRows]
* @see [DBTruncater.truncate]
*/
fun deleteAllRows()
}
}