SqlDropTable

class SqlDropTable(*names)

Builds a DROP TABLE statement. Created via SQL.drop_table(*names). Inherits from SqlStatement.

Parameters:

names – One or more table name strings.

SQL.drop_table('films')
# DROP TABLE films

SQL.drop_table('films', 'distributors')
# DROP TABLE films, distributors
if_exists()

Add IF EXISTS to avoid errors when the table does not exist.

SQL.drop_table('films').if_exists()
# DROP TABLE IF EXISTS films
cascade()

Add CASCADE to automatically drop dependent objects.

SQL.drop_table('films').cascade()
# DROP TABLE films CASCADE