Verify table clone isolationΒΆ
Clone a small table, change only the clone, and compare both copies. For larger team workflows, see the existing clone tutorial.
CREATE DATABASE cookbook_clone;
CREATE TABLE cookbook_clone.orders(id INT PRIMARY KEY, amount INT);
INSERT INTO cookbook_clone.orders VALUES(1,10),(2,20);
CREATE TABLE cookbook_clone.review CLONE cookbook_clone.orders;
UPDATE cookbook_clone.review SET amount=15 WHERE id=1;
INSERT INTO cookbook_clone.review VALUES(3,30);
SELECT id,amount FROM cookbook_clone.orders ORDER BY id;
SELECT id,amount FROM cookbook_clone.review ORDER BY id;
DROP DATABASE cookbook_clone;
The source remains (1,10),(2,20) while the clone becomes (1,15),(2,20),(3,30). Cloning does not merge later changes back into the source. See the v4.1.0 source test.