--- a/src/Pure/General/sql.scala Sun Mar 10 11:51:56 2024 +0100
+++ b/src/Pure/General/sql.scala Sun Mar 10 12:03:13 2024 +0100
@@ -554,6 +554,8 @@
def insert_permissive(table: Table, sql: Source = ""): Source
+ def destroy(table: Table): Source = "DROP TABLE IF EXISTS " + table
+
/* tables and views */
@@ -784,6 +786,9 @@
def insert_permissive(table: SQL.Table, sql: SQL.Source = ""): SQL.Source =
table.insert_cmd(sql = if_proper(sql, sql + " ") + "ON CONFLICT DO NOTHING")
+ override def destroy(table: SQL.Table): SQL.Source =
+ super.destroy(table) + " CASCADE"
+
/* explicit locking: only applicable to PostgreSQL within transaction context */
// see https://www.postgresql.org/docs/14/sql-lock.html