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

Support RETURNS TABLE (...) functions #326

Merged
merged 10 commits into from
Jun 8, 2023
Merged

Support RETURNS TABLE (...) functions #326

merged 10 commits into from
Jun 8, 2023

Conversation

eeeebbbbrrrr
Copy link
Contributor

This PR gets support for set returning functions. It needs tests and another once over, but this little sql works now:

[v15.3][483091] plrust=# create function foo() returns table (a int, b int) language plrust as $$

Ok(Some(TableIterator::new(vec![(Some(1), Some(2))].into_iter())))
$$;
CREATE FUNCTION
Time: 3683.713 ms (00:03.684)
[v15.3][483091] plrust=# select * from foo();
 a | b 
---+---
 1 | 2
(1 row)

Copy link
Contributor

@BradyBonnette BradyBonnette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, if more changes are needed lmk!

@eeeebbbbrrrr
Copy link
Contributor Author

I'm gonna hold this until we get pgcentralfoundation/pgrx#1164 over in pgrx merged and released.

This PR will need a test around returning a table with 1 field, which is blocked on that pgrx PR right now.

@eeeebbbbrrrr
Copy link
Contributor Author

I'm gonna hold this until we get tcdi/pgrx#1164 over in pgrx merged and released.

This PR will need a test around returning a table with 1 field, which is blocked on that pgrx PR right now.

Done. Added the dependency updates to this PR too, since it needs them. Once CI passes I'm gonna merge.

@eeeebbbbrrrr eeeebbbbrrrr merged commit d1dd4da into develop Jun 8, 2023
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

Successfully merging this pull request may close these issues.

2 participants