Is there a way to search for all objects created under that transaction #1777
-
I want to do a bulk update on every single item I created on that session, but couldn't figure out what is the most performant wat (the way I use now collects very uuid and then updates one by one, which is extremely inefficient) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
The database does not keep track of inserted objects. It might be possible to emulate by inserting the id of the transaction as a |
Beta Was this translation helpful? Give feedback.
-
I have a tree object that I recursively traverse and insert node by node in a bottum up manner. So for an AST of this code; 2 + 3 I insert the rhs (2) and get the ID of it, and then I insert the lhs (3) and get the ID of it and then insert the BinOp itself by BinOp(left = uid, right = uid, op = enum). The thing I would use such a feature is that, after I insert the whole AST, I need to add a link from every node to the root node. Module Since I first need to insert childre nodes in order to insert root node, I do that and collect all uids from the childs nodes and after I insert the module node itself, I go over that list and generate tons of UPDATE queries filtering for that specific ID. I know this is a very esoteric use-case, so the question is on a broader scope, like how to access all objects inserted in a transaction (is there a private API for that etc.) |
Beta Was this translation helpful? Give feedback.
I have a tree object that I recursively traverse and insert node by node in a bottum up manner. So for an AST of this code;
2 + 3
I insert the rhs (2) and get the ID of it, and then I insert the lhs (3) and get the ID of it and then insert the BinOp itself by BinOp(left = uid, right = uid, op = enum). The thing I would use such a feature is that, after I insert the whole AST, I need to add a link from every node to the root node.
Module
-> Expr
-> BinOp
Since I first need to insert childre nodes in order to insert root node, I do that and collect all uids from the childs nodes and after I insert the module node itself, I go over that list and generate tons of UPDATE queries filtering for …