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

catalog: support functions with table parameters #541

Merged
merged 2 commits into from
Jun 9, 2020

Conversation

maxhawkins
Copy link
Contributor

Add support for Postgres functions with table arguments:

CREATE FUNCTION table_args(x INT) RETURNS TABLE (y INT) AS 'SELECT x' LANGUAGE sql;

-- name: TableArgs :one
SELECT table_args(1);

Previously this wouldn't compile because y INT would be interpreted as an input parameter.

Closes #539

@kyleconroy kyleconroy merged commit 0478ca8 into sqlc-dev:master Jun 9, 2020
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.

New catalog can't drop functions with table arguments
2 participants