What is the best way to do sequential transactions?

Maybe it’s a simple question, but it doesn’t hurt to ask :slight_smile:

After the user creates an account, it is necessary to create a few more records for different collections. Ref relationship should be established between them.

I am doing this as separate transactions now.
Is there a better way, what would you suggest?

Hi @hasimyerlikaya,

What’s the FQL behind your code?


I am using a package written for Dart. Two operations are done on different httpclient.
For example, the account creation process runs on an httpclient and then the httpclient is closed.

Finally, a new httpclient is created to create a User and it runs the corresponding query.

If I close the httpclient after running two queries on the same httpclient, can transaction integrity be achieved?

I don’t know if I should use a query like Let to do this.

What I want is to prevent users and other records from being created if an error occurs during the account creation process.

Thank you.

For Account:

For User:

I don’t know if there is a more optimized way, but I did exactly what I wanted.

I prepared a query with “Let” and was able to save the data by establishing the relationships I wanted to the tables I wanted. Moreover, a single transaction takes place :slight_smile:

The more I use it, the better I understand how wonderful Fauna and FQL is.
All I want is to have an official Dart driver :))

1 Like