comment clone for schema

This commit is contained in:
Pere Diaz Bou
2025-07-28 10:50:50 +02:00
parent 6ec80b3364
commit d273de483f

View File

@@ -313,6 +313,10 @@ impl Schema {
}
impl Clone for Schema {
/// Cloning a `Schema` requires deep cloning of all internal tables and indexes, even though they are wrapped in `Arc`.
/// Simply copying the `Arc` pointers would result in multiple `Schema` instances sharing the same underlying tables and indexes,
/// which could lead to panics or data races if any instance attempts to modify them.
/// To ensure each `Schema` is independent and safe to modify, we clone the underlying data for all tables and indexes.
fn clone(&self) -> Self {
let tables = self
.tables