visitor for alternative formatting/validation
hi,
I propose to write an enchancement to this package that allows me to write tools such as a better formatter and validator to work with the ast nodes. I think a simple visitor pattern implementation will do.
func (node Select) Accept(v Visitor) { v.VisitSelect(node) }
If you argee with the feature and implementation then I will create a PR for it.
Sure. That would be more than welcome!
See https://github.com/emicklei/sqlparser/blob/visit/ast_visit.go for the initial setup.
Looks good. Looking forward to your PR.
@emicklei did you have a chance to create the PR? would love to see this feature too :-)
@matthewmueller current state is still work-in-progress. I soon realized that the language is very very rich and therefore had many many nodes to handle. So I started to wonder if the approach taken is the correct one. Maybe I should spent some time on a code generator instead that emits all the boilerplate.