All Downloads are FREE. Search and download functionalities are using the official Maven repository.

query.ddl.DropIndex.kt Maven / Gradle / Ivy

There is a newer version: 1.1.10
Show newest version
package query.ddl

import ast.statement.ddl.SqlDropIndex
import ast.expr.SqlIdentifierExpr
import database.DB
import query.ReviseQuery
import util.toSqlString
import java.sql.Connection

class DropIndex(
    var db: DB = DB.MYSQL,
    override var conn: Connection? = null,
    override var isTransaction: Boolean = false
) : ReviseQuery() {
    constructor(db: DB) : this(db, null, false)

    private var sqlDropIndex = SqlDropIndex()

    infix fun drop(indexName: String): DropIndex {
        sqlDropIndex.name = SqlIdentifierExpr(indexName)
        return this
    }

    infix fun on(table: String): DropIndex {
        sqlDropIndex.table = SqlIdentifierExpr(table)
        return this
    }

    override fun sql() = toSqlString(sqlDropIndex, db)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy