From 561a2f4d3109104595aaf4225babbbd71b999470 Mon Sep 17 00:00:00 2001 From: August Date: Tue, 29 Oct 2024 16:30:41 +0800 Subject: [PATCH] add some docs --- e2e_test/ddl/alter_swap_rename.slt | 2 +- src/meta/src/controller/utils.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/e2e_test/ddl/alter_swap_rename.slt b/e2e_test/ddl/alter_swap_rename.slt index 9c1c0034122d3..4accda4256951 100644 --- a/e2e_test/ddl/alter_swap_rename.slt +++ b/e2e_test/ddl/alter_swap_rename.slt @@ -178,4 +178,4 @@ statement ok DROP TABLE t1 CASCADE; statement ok -DROP TABLE t2 CASCADE; \ No newline at end of file +DROP TABLE t2 CASCADE; diff --git a/src/meta/src/controller/utils.rs b/src/meta/src/controller/utils.rs index b3c33ba32369a..7a2158b8584d2 100644 --- a/src/meta/src/controller/utils.rs +++ b/src/meta/src/controller/utils.rs @@ -1180,6 +1180,8 @@ pub fn extract_external_table_name_from_definition(table_definition: &str) -> Op } } +/// `rename_relation` renames the target relation and its definition, +/// it commits the changes to the transaction and returns the updated relations and the old name. pub async fn rename_relation( txn: &DatabaseTransaction, object_type: ObjectType, @@ -1257,6 +1259,8 @@ pub async fn rename_relation( Ok((to_update_relations, old_name)) } +/// `rename_relation_refer` updates the definition of relations that refer to the target one, +/// it commits the changes to the transaction and returns all the updated relations. pub async fn rename_relation_refer( txn: &DatabaseTransaction, object_type: ObjectType,