more operations;
authorwenzelm
Sun, 10 Mar 2024 12:03:13 +0100
changeset 79846 3d83a2554a71
parent 79845 0158007dfdab
child 79847 f7dfe92e6785
more operations;
src/Pure/General/sql.scala
--- 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