YugaByte DB Community Forum

Conditional statements in transactions


#1

Hi,

I was interested if transactions support optional statements. Basically

INSERT iNTO T1 IF NOT EXISTS;
UPDATE t2 (only if previous statement succeeded);

and

UPDATE t1 SET a=1 WHERE id=x AND a!=1;
UPDATE t2 (only if previous statement succeeded);

All statements are single rows update/insert. Sometimes they are single partition, other times they are cross partition.

Regards,
Dorian


#2

Hi @ddorian43

Currently, YugaByte DB does not support conditional DML (insert, update and delete) yet. It is in our roadmap and we hope to support it soon.

[Edited] Adding the link to the Github issue to track the support: https://github.com/YugaByte/yugabyte-db/issues/166.