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

document RETURNS TABLE, CTEs in routines #19351

Merged
merged 5 commits into from
Feb 7, 2025
Merged

Conversation

taroface
Copy link
Contributor

@taroface taroface commented Feb 5, 2025

DOC-10471

  • Added RETURNS TABLE to docs + an example (Preview)
  • Made the RETURNS TABLE example use a CTE
  • Removed the known limitation around CTEs in routines

Copy link

github-actions bot commented Feb 5, 2025

Copy link

netlify bot commented Feb 5, 2025

Deploy Preview for cockroachdb-interactivetutorials-docs canceled.

Name Link
🔨 Latest commit 18f6795
🔍 Latest deploy log https://app.netlify.com/sites/cockroachdb-interactivetutorials-docs/deploys/67a67f9a61289e00083994c8

Copy link

netlify bot commented Feb 5, 2025

Deploy Preview for cockroachdb-api-docs canceled.

Name Link
🔨 Latest commit 18f6795
🔍 Latest deploy log https://app.netlify.com/sites/cockroachdb-api-docs/deploys/67a67f9aeb45800008f3e9b4

Copy link

netlify bot commented Feb 5, 2025

Netlify Preview

Name Link
🔨 Latest commit 18f6795
🔍 Latest deploy log https://app.netlify.com/sites/cockroachdb-docs/deploys/67a67f9a9ac0060008adc473
😎 Deploy Preview https://deploy-preview-19351--cockroachdb-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

Nice! :lgtm:

The following statement defines a function that returns information for all users that live in a specified city. The `RETURNS TABLE` clause specifies the columns to return: `id`, `name`, and `address`. The information is returned as a table, which is equivalent to a set of [`RECORD` values](#create-a-function-that-returns-a-record-type).
The following function returns information for the last `x` users that recently completed a ride. The information is returned as a table, which is equivalent to a set of [`RECORD` values](#create-a-function-that-returns-a-record-type). The rows are sorted in order of most recent ride.

The `RETURNS TABLE` clause specifies the column names to output: `id`, `name`, `city`, AND `end_time`. A [common table expression]({% link {{ page.version.version }}/common-table-expressions.md %}) reads the most recent rides from the `rides` table.
Copy link
Member

Choose a reason for hiding this comment

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

Why "AND" capitalized?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A typo, haha. Thanks for the catch!

Copy link

@DrewKimball DrewKimball left a comment

Choose a reason for hiding this comment

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

LGTM

@taroface taroface requested a review from florence-crl February 7, 2025 14:56
Copy link
Contributor

@florence-crl florence-crl left a comment

Choose a reason for hiding this comment

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

lgtm pending 1 question

src/current/v25.1/create-function.md Outdated Show resolved Hide resolved
@taroface taroface enabled auto-merge (squash) February 7, 2025 21:48
@taroface taroface merged commit 2bee4ad into main Feb 7, 2025
7 checks passed
@taroface taroface deleted the udf-stored-proc-25.1 branch February 7, 2025 21:58
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.

4 participants