-
-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3608 from mathesar-foundation/table_delete
Implement `tables.delete` rpc endpoint
- Loading branch information
Showing
7 changed files
with
85 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,21 @@ | ||
from db.connection import execute_msar_func_with_engine | ||
from db.connection import execute_msar_func_with_engine, exec_msar_func | ||
|
||
|
||
def drop_table(name, schema, engine, cascade=False, if_exists=False): | ||
execute_msar_func_with_engine(engine, 'drop_table', schema, name, cascade, if_exists) | ||
|
||
|
||
def drop_table_from_database(table_oid, conn, cascade=False): | ||
""" | ||
Drop a table. | ||
Args: | ||
table_oid: OID of the table to drop. | ||
cascade: Whether to drop the dependent objects. | ||
Returns: | ||
Returns the fully qualified name of the dropped table. | ||
""" | ||
return exec_msar_func( | ||
conn, 'drop_table', table_oid, cascade | ||
).fetchone()[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,6 +60,7 @@ To use an RPC function: | |
options: | ||
members: | ||
- list_ | ||
- delete | ||
- TableInfo | ||
|
||
--- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters