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

visit_ROW and visit_ARRAY for TrinoTypeCompiler #458

Open
1 task
rumblepi opened this issue Apr 5, 2024 · 0 comments
Open
1 task

visit_ROW and visit_ARRAY for TrinoTypeCompiler #458

rumblepi opened this issue Apr 5, 2024 · 0 comments

Comments

@rumblepi
Copy link

rumblepi commented Apr 5, 2024

Describe the feature

The SQLAlchemy dialect could use the visit_ROW and visit_ARRAY methods to be able to generate the schema e.g. from a call in langchain. The implementation should be pretty straightforward, it looks as if adding

    def visit_ARRAY(self, type_, **kw):
        return f'ARRAY({self.process(type_.item_type, **kw)})'
    
    def visit_ROW(self, type_, **kw):
        return f'ROW({", ".join(f"{name} {self.process(attr_type, **kw)}" for name, attr_type in type_.attr_types)})'

in the TrinoTypeCompiler already does the trick.

Describe alternatives you've considered

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant