# HG changeset patch # User wenzelm # Date 1710068593 -3600 # Node ID 3d83a2554a712415a0f0186b4fb4c921d5cba152 # Parent 0158007dfdab6cf08933a7051205edf5222aaf76 more operations; diff -r 0158007dfdab -r 3d83a2554a71 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