dropTable

abstract fun dropTable(tableName: String)

Drops an existing table from the database.

This function generates and executes a DROP TABLE IF EXISTS SQL statement. Using IF EXISTS prevents an error from being thrown if the table does not already exist in the database.

Example:

// Drop a table named "users"
schema.dropTable("users")

This will execute an SQL statement similar to: DROP TABLE IF EXISTS "users";

Author

MOHAMMAD AZIM ANSARI

Parameters

tableName

The name of the table to be dropped. The name will be properly escaped to prevent SQL injection issues.

See also

Throws

if an error occurs while dropping the table.