With the current structure of this node and the resulting text it's hard to build a generator that can handle this in a generic way. The generator recurses down the tree. By the time we reach the node to know that its a foreign key we have moved passed the other data necessary to build the sql. The 2 identifiers can be on a lower level but the foreign key part needs to be on a higher level.
The main issue is the columns property. If we could pull that down into the foreign key node it would mean that I can handle this the same as the other nodes rather than writing code for edge cases if that's ok with you? Im open to other ideas on the generator if you've any (It's still a bit messy so be kind π )?
This is the first node that I've had problems with, there may be more where I run into this problem.
I've a work around for this at the moment so this can be put on the back burner π. Checking for the columns field in the constraint allows me to switch.
Input
Output
Issue
With the current structure of this node and the resulting text it's hard to build a generator that can handle this in a generic way. The generator recurses down the tree. By the time we reach the node to know that its a foreign key we have moved passed the other data necessary to build the sql. The 2 identifiers can be on a lower level but the foreign key part needs to be on a higher level.
To get an idea of the issue if you take a look at this line to see how it recourses down the tree and then this line to see how other constraint types are handled.
The main issue is the
columns
property. If we could pull that down into the foreign key node it would mean that I can handle this the same as the other nodes rather than writing code for edge cases if that's ok with you? Im open to other ideas on the generator if you've any (It's still a bit messy so be kind π )?This is the first node that I've had problems with, there may be more where I run into this problem.
Note this is from the 1.0.0@beta AST