Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support txn insert when db sync #290

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

lsy3993
Copy link
Collaborator

@lsy3993 lsy3993 commented Dec 3, 2024

Txn insert is the SQL which starts with 'BEGIN' and ends with 'COMMIT/ROLLBACK'.

The general SQL may be like this :

insert A + insert B

        begin; 
        insert into t1 select id, '2017-02-28', 'y1' from aaa.test_a where id = 23;
        insert into t2 select id from aaa.test_a where id = 12;
        commit;

insert A + delete B

        begin;
        insert into t1 select id from aaa.test_a where id = 12;
        delete from t2 where user_id = 1;
        commit;

insert A + delete B + update B

        begin;
        insert into t1 select id from aaa.test_a where id = 12;
        delete from t2 where user_id = 1;
        update t2 set city = 'new' where user_id = 2;
        commit;

insert A + update B + delete C

       begin;
       insert into t1 select id from aaa.test_a where id = 12;
       delete from t2where user_id = 1;
       update t3 set name = 'new' where id = 111;
       commit;

Assume that the tables above are all in the db which sync by ccr

@lsy3993
Copy link
Collaborator Author

lsy3993 commented Dec 3, 2024

replated PR is : #234

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant