Repository navigation
added postgrest error codes - #42369
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughAdds a new PostgREST error codes documentation page and a navigation entry at /guides/api/rest/postgrest-error-codes, and updates the spelling allow-list to include Changes
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Fix all issues with AI agents
In `@apps/docs/content/guides/api/rest/postgrest-error-codes.mdx`:
- Line 203: Change the Markdown heading "Find specific API Error" to sentence
case and correct any spelling issues flagged by the docs linter (e.g., "Find
specific API error"); update the identical heading occurrence elsewhere in the
file to match the corrected sentence case so it passes Rule001HeadingCase and
spelling checks.
- Line 146: Replace the absolute dashboard link
"https://supabase.com/dashboard/project/_/logs/explorer" in the sentence
starting "One can filter for API errors in the [log explorer]" with a relative
dashboard URL (e.g. "/dashboard/project/_/logs/explorer") so the docs satisfy
Rule006NoAbsoluteUrls; update the link target in the same phrase to use the
relative path and ensure link text "[log explorer]" remains unchanged.
- Around line 9-12: The Admonition blocks (e.g., <Admonition type="note"> ...
</Admonition>) lack the required blank lines inside the tags; update each
Admonition so there is an empty line after the opening tag and an empty line
before the closing tag (for the shown block and the other occurrences around the
197-201 area) to satisfy docs_lint — locate the <Admonition type="note"> blocks
and insert a single blank line between the tag and its content and another blank
line before </Admonition>.
- Around line 1-7: The new MDX file for the guide (frontmatter id
'postgrest-error-codes', title 'Error Codes') is not formatted to project
Prettier rules; run the project's Prettier formatter on this file (e.g.,
prettier --write) after applying any lint fixes so the frontmatter and content
are normalized, then re-stage and commit the formatted file.
- Around line 35-55: Replace the term "PostgreSQL" with "Postgres" and normalize
the table wording to satisfy docs lint: update "pg connection err" to "Postgres
connection error", "read only sql transaction" to "read-only SQL transaction",
"invalid auth specification" to "invalid authentication specification", "obj not
in prerequisite state" to "object not in prerequisite state", and fix any other
informal or misspelled phrases (e.g., ensure "uniqueness violation", "foreign
key violation", "triggered action exception", "operator intervention", etc.) so
entries use proper capitalization and spelling consistent with the rest of the
docs.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@apps/docs/content/guides/api/rest/postgrest-error-codes.mdx`:
- Around line 1-7: The MDX frontmatter for document id 'postgrest-error-codes'
(title 'Error Codes') is failing Prettier; run prettier --write on this file
(apps/docs/content/guides/api/rest/postgrest-error-codes.mdx) to apply the
project's formatting rules, then commit the updated file; ensure the frontmatter
remains valid YAML and the file ends with a newline so Prettier passes.
- Around line 90-91: Fix spacing in the two table rows for error codes PGRST101
and PGRST102: update the PGRST101 description to include spaces around "and" in
the inline code fragment (make it `GET` and `POST`) and update the PGRST102
description to add a space after "sent" (change "sent(e.g." to "sent (e.g.").
Ensure only whitespace is changed and the surrounding table formatting remains
intact.
ChrisChinchilla
left a comment
There was a problem hiding this comment.
Fixed up linter stuff
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In `@apps/docs/content/guides/api/rest/postgrest-error-codes.mdx`:
- Around line 101-103: Update the three table rows for PGRST116, PGRST117 and
PGRST118 to correct the typos: change "where" to "were" in the PGRST116
description and change "in" to "is" in the PGRST117 description (so it reads "is
not supported"); ensure PGRST118 remains unchanged except for any incidental
spacing fixes. Locate the lines containing the symbols PGRST116, PGRST117, and
PGRST118 and apply these exact word replacements in their description strings.
- Around line 31-35: Change the heading "Database level errors" to
"Database-level errors" (hyphenate the compound) and ensure the word "markdown"
in the following sentence is capitalized as "Markdown"; update the text under
the header that references "Postgres Error Docs" or "Here's the text formatted
as a proper markdown table:" to use "Markdown" and confirm any other occurrences
of "database level" are similarly hyphenated (locate the header and sentences in
this file by the header text "Database level errors" and the phrase "proper
markdown table").
- Around line 74-86: Fix the two intro lines' grammar: change "Errors that
prevent that data API from interacting with Postgres" to "Errors that prevent
the data API from interacting with Postgres." and change "API requests"
(heading) or the following line "Errors with data structures or request
formatting" to ensure a consistent heading and sentence punctuation — e.g., keep
"API requests" as a heading and make the sentence "Errors with data structures
or request formatting." include the terminal period; update the strings shown
("Errors that prevent that data API from interacting with Postgres", "API
requests", "Errors with data structures or request formatting") accordingly.
🧹 Nitpick comments (1)
supa-mdx-lint/Rule003Spelling.toml (1)
73-73: Consider removing the redundantSQLallow-list entry.
[A-Z]{2,5}s?already matchesSQL, so the explicitSQLentry is optional and can be removed to keep the list concise.♻️ Suggested cleanup
- "SQL",Also applies to: 304-306
| ## Database level errors | ||
|
|
||
| To understand the errors reference the [Postgres Error Docs](https://www.postgresql.org/docs/current/errcodes-appendix.html). | ||
|
|
||
| Here's the text formatted as a proper markdown table: |
There was a problem hiding this comment.
Hyphenate the compound and capitalize the proper noun.
Use “Database-level” and “Markdown” for standard style.
✏️ Suggested edit
-## Database level errors
+## Database-level errors
@@
-Here's the text formatted as a proper markdown table:
+Here's the text formatted as a proper Markdown table:🧰 Tools
🪛 LanguageTool
[grammar] ~31-~31: Use a hyphen to join words.
Context: ...des and their descriptions: ## Database level errors To understand the errors r...
(QB_NEW_EN_HYPHEN)
[uncategorized] ~35-~35: Did you mean the formatting language “Markdown” (= proper noun)?
Context: ... Here's the text formatted as a proper markdown table: | Postgres error code(s) | HTTP...
(MARKDOWN_NNP)
🤖 Prompt for AI Agents
In `@apps/docs/content/guides/api/rest/postgrest-error-codes.mdx` around lines 31
- 35, Change the heading "Database level errors" to "Database-level errors"
(hyphenate the compound) and ensure the word "markdown" in the following
sentence is capitalized as "Markdown"; update the text under the header that
references "Postgres Error Docs" or "Here's the text formatted as a proper
markdown table:" to use "Markdown" and confirm any other occurrences of
"database level" are similarly hyphenated (locate the header and sentences in
this file by the header text "Database level errors" and the phrase "proper
markdown table").
| Errors that prevent that data API from interacting with Postgres. | ||
|
|
||
| | Code | HTTP status | Description | | ||
| | -------- | ----------- | --------------------------------------------------------------------------------------------------------------------- | | ||
| | PGRST000 | 503 | Could not connect with the database due to an incorrect connection string or due to the Postgres service not running. | | ||
| | PGRST001 | 503 | Could not connect with the database due to an internal error. | | ||
| | PGRST002 | 503 | Could not connect with the database when building the schema cache | | ||
| | PGRST003 | 504 | The request timed out waiting for a connection from PostgREST's internal pool | | ||
|
|
||
| ### API requests | ||
|
|
||
| Errors with data structures or request formatting | ||
|
|
There was a problem hiding this comment.
Tighten grammar in the section intros.
Two sentences are missing an article/terminal punctuation.
✏️ Suggested edit
-Errors that prevent that data API from interacting with Postgres.
+Errors that prevent the data API from interacting with Postgres.
@@
-Errors with data structures or request formatting
+Errors with data structures or request formatting.🧰 Tools
🪛 LanguageTool
[style] ~79-~79: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...t running. | | PGRST001 | 503 | Could not connect with the database due to an int...
(REP_COULD_NOT)
[style] ~80-~80: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ... | | PGRST002 | 503 | Could not connect with the database when building...
(REP_COULD_NOT)
🤖 Prompt for AI Agents
In `@apps/docs/content/guides/api/rest/postgrest-error-codes.mdx` around lines 74
- 86, Fix the two intro lines' grammar: change "Errors that prevent that data
API from interacting with Postgres" to "Errors that prevent the data API from
interacting with Postgres." and change "API requests" (heading) or the following
line "Errors with data structures or request formatting" to ensure a consistent
heading and sentence punctuation — e.g., keep "API requests" as a heading and
make the sentence "Errors with data structures or request formatting." include
the terminal period; update the strings shown ("Errors that prevent that data
API from interacting with Postgres", "API requests", "Errors with data
structures or request formatting") accordingly.
| | PGRST116 | 406 | More than 1 or no items where returned when requesting a singular response. | | ||
| | PGRST117 | 405 | The HTTP verb used in the request in not supported. | | ||
| | PGRST118 | 400 | Could not order the result using the related table because there is no many-to-one or one-to-one relationship between them. | |
There was a problem hiding this comment.
Fix grammar in the API requests table.
“where” → “were” and “in” → “is”.
✏️ Suggested edit
-| PGRST116 | 406 | More than 1 or no items where returned when requesting a singular response. |
-| PGRST117 | 405 | The HTTP verb used in the request in not supported. |
+| PGRST116 | 406 | More than 1 or no items were returned when requesting a singular response. |
+| PGRST117 | 405 | The HTTP verb used in the request is not supported. |🤖 Prompt for AI Agents
In `@apps/docs/content/guides/api/rest/postgrest-error-codes.mdx` around lines 101
- 103, Update the three table rows for PGRST116, PGRST117 and PGRST118 to
correct the typos: change "where" to "were" in the PGRST116 description and
change "in" to "is" in the PGRST117 description (so it reads "is not
supported"); ensure PGRST118 remains unchanged except for any incidental spacing
fixes. Locate the lines containing the symbols PGRST116, PGRST117, and PGRST118
and apply these exact word replacements in their description strings.
Braintrust eval report
|
## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? docs update ## What is the new behavior? Adds PostgREST mirror codes <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added a comprehensive PostgREST Error Codes guide covering database- and API-level errors, HTTP status mappings, JSON examples, SQL query samples, and log-analysis/debugging tips. * Updated REST API Guides navigation to include the new Error Codes documentation link. * **Style** * Expanded spelling allow-list to include "Grantor" (case variant) and "SQL". <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Chris Chinchilla <[email protected]>
I have read the CONTRIBUTING.md file.
YES
What kind of change does this PR introduce?
docs update
What is the new behavior?
Adds PostgREST mirror codes
Summary by CodeRabbit