Skip to content

Conversation

@7ttp
Copy link

@7ttp 7ttp commented Nov 21, 2025

Adds missing @example blocks to the upsert TSDoc in postgrest-js.

  • Includes accurate response example for the upsert-with-constraints case
  • Adds the missing onConflict option to the exact-count example
  • Consolidates everything into a single TSDoc block on the implementation

This improves the accuracy of the upsert examples and aligns them with the actual behavior of the JS client.

🔍 Description

Updates the upsert TSDoc with accurate, typedoc-native examples and correct response data.
This makes the behavior clearer for consumers of the PostgREST client.

What changed?

  • Added two @example blocks showcasing common upsert patterns
  • Corrected the response object shown in the constraints example
  • Ensured onConflict is present where required
  • Unified the examples into the implementation TSDoc so Typedoc can render them properly

Why was this change needed?

The previous examples were outdated and did not reflect the actual behavior returned by the client.
This improves clarity for developers using upsert.

Related: supabase/supabase#40658 fixes supabase/supabase#40653

📸 Screenshots/Examples

N/A — all changes are within TSDoc.

🔄 Breaking changes

  • This PR contains no breaking changes

📋 Checklist

  • I have read the Contributing Guidelines
  • My PR title follows the conventional commit format: <type>(<scope>): <description>
  • I have run npx nx format to ensure consistent formatting
  • I have updated comments/examples where relevant

📝 Additional notes

None.

Adds missing @example blocks to the upsert TSDoc in postgrest-js.

- Includes correct response example for the upsert-with-constraints case
- Adds the missing onConflict option to the exact-count example
- Replaces outdated examples in the docs repo with typedoc-native examples

This aligns the JS client documentation with the expected behavior in Supabase.
@7ttp 7ttp requested review from a team as code owners November 21, 2025 17:22
@mandarini mandarini self-assigned this Nov 21, 2025
@mandarini mandarini changed the title Add accurate upsert examples and correct onConflict/count behavior docs(postgrest): add upsert tsdoc examples and fix response/options Nov 21, 2025
Copy link
Contributor

@mandarini mandarini left a comment

Choose a reason for hiding this comment

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

Thank you very much for this! Just this small change and I'll approve!

@7ttp 7ttp requested a review from mandarini November 21, 2025 17:43
@7ttp
Copy link
Author

7ttp commented Nov 22, 2025

@mandarini can u please check this up and approve!

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.

Error in documentation in "upsert"

2 participants