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

Allowing function calls in FROM clause / TableExpression #123

Open
FrigoEU opened this issue Mar 23, 2021 · 0 comments
Open

Allowing function calls in FROM clause / TableExpression #123

FrigoEU opened this issue Mar 23, 2021 · 0 comments

Comments

@FrigoEU
Copy link
Contributor

FrigoEU commented Mar 23, 2021

We've noticed that function calls in from clauses are not supported. One of the use cases that we were looking at are bulk inserts:

insert into employee_team
select :employeeid, teamid
from unnest(:teamids::int[]) as teamid

I've tried adding it to sqltyper, but it's pretty difficult. Adding it to the TableExpression and the parser was not so hard, but fitting it into the inference phase is proving harder. Specifically, getSourceColumnsForTableExpr expects SourceColumn[] to be returned. When a function call is in the from clause, this function will also be returning VirtualField[]. Would it be the right way to change this function to be returning InferM.inferM<(SourceColumn | VirtualField)[]>?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant