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

Add how to install watch fixtures yourself to the docs #2293

Open
jcgsville opened this issue Jan 2, 2025 · 2 comments
Open

Add how to install watch fixtures yourself to the docs #2293

jcgsville opened this issue Jan 2, 2025 · 2 comments

Comments

@jcgsville
Copy link
Contributor

When setting grafserv: { watch: true } and omitting makePgService's superUserConnectionString, Postgraphile errors with the following text:

Installing watch fixtures requires superuser privileges; have you correctly configured a 'superuserConnectionString'?
You may also opt to configure 'installWatchFixtures: false' and install them yourself.

(Great error message, btw! Clear, helpful errors are an underrated part of UX 🙂)

When using Postgraphile myself, I want to install watch fixtures as a part of my db setup so that the server running postgraphile does not need access to super user db creds. I went to check the docs on how to do this, and noticed it wasn't in the docs anywhere. We should add how and why to do this to the docs.

I found the queries here: https://github.com/graphile/crystal/blob/36c41e80bfe312f584af42545688fb78d3adaf3f/graphile-build/graphile-build-pg/src/watchFixtures.ts

A quick 👍 to make sure we're aligned, and I'm happy to make the PR for this addition myself.

@github-project-automation github-project-automation bot moved this to 🌳 Triage in V5.0.0 Jan 2, 2025
@jcgsville
Copy link
Contributor Author

Relatedly, as I'm adding these watch fixtures to my migrations, I'm realizing that I need to keep an eye on them any time I update PostGraphile to be sure they aren't changing. While I highly doubt these will change much, if ever, I think it may make sense to have a way to do "watch fixture migrations only" via postgraphile, such that the schema is updated automatically. I think Graphile Worker has similar functionality, though worker's schema changes far more regularly, of course, so it's more useful

@benjie
Copy link
Member

benjie commented Jan 3, 2025

Yes please, though we should tell people how to output the SQL to a file and tell them to check it hasn’t changed on each update since it’s not the supported approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🌳 Triage
Development

No branches or pull requests

2 participants