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

Consider merging the functionality of the node.Node proxy into the concrete ast.Node #80

Closed
lelit opened this issue May 22, 2021 · 1 comment

Comments

@lelit
Copy link
Owner

lelit commented May 22, 2021

The proxy has been there since the beginning, because in v1 it dealt with the JSON structure returned by libpg_query's parse_sql() function.
Now that there is a set of concrete ast classes, maybe it would make sense to move the hierarchy tracking data (parent_node and parent_attribute) into the concrete nodes.
Will think about this for v4.

lelit added a commit that referenced this issue May 28, 2022
This is the first step to implement issue #80, making it easier to get
rid of the old Node wrappers, whose main functionality in v3 was to keep
track of the "parent_node"/"parent_member" information.
lelit added a commit that referenced this issue May 28, 2022
Those wrappers were needed in v1 to hide the underlying JSON structures
emitted by libpg_query, making it possible to see them as generic Python
instances.

Version 3 obsoleted that by introducing a set of concrete AST classes,
and the wrappers were kept mainly for their ability to track the
parentship of each node, required by some of the printer functions.

Now they are gone, and everything works directly on AST classes, and the
printers use the new "ancestors" slot attached to each instance.

This implements issue #80.
@lelit
Copy link
Owner Author

lelit commented Dec 13, 2022

Done in v4.

@lelit lelit closed this as completed Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant