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

Update docs for pg-safeupdate #23177

Merged
merged 1 commit into from Apr 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -10,11 +10,12 @@

## Enable the extension

`pg-safeupdate` can be enabled on a per connection basis:
`pg-safeupdate` can be enabled on a role basis (where `anon` is the role we want to modify in this example):

Check warning on line 13 in apps/docs/content/guides/database/extensions/pg-safeupdate.mdx

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Custom.Parens] Use parentheses judiciously. Raw Output: {"message": "[Custom.Parens] Use parentheses judiciously.", "location": {"path": "apps/docs/content/guides/database/extensions/pg-safeupdate.mdx", "range": {"start": {"line": 13, "column": 1}}}, "severity": "INFO"}

Check warning on line 13 in apps/docs/content/guides/database/extensions/pg-safeupdate.mdx

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Custom.We] Try to avoid using first-person plural like 'we'. Raw Output: {"message": "[Custom.We] Try to avoid using first-person plural like 'we'.", "location": {"path": "apps/docs/content/guides/database/extensions/pg-safeupdate.mdx", "range": {"start": {"line": 13, "column": 74}}}, "severity": "WARNING"}

{/* prettier-ignore */}
```sql
load 'safeupdate';
GRANT SET ON PARAMETER session_preload_libraries TO anon;
ALTER ROLE anon SET session_preload_libraries = 'safeupdate';
```

or for all connections:
Expand All @@ -30,8 +31,6 @@

{/* prettier-ignore */}
```sql
load 'safeupdate';

update employees set date_of_birth = '1987-01-28';
```

Expand All @@ -52,3 +51,4 @@
## Resources

- Official [pg-safeupdate documentation](https://github.com/eradman/pg-safeupdate)
- Using [pg-safeupdate with PostgREST](https://postgrest.org/en/v12/integrations/pg-safeupdate.html)