Skip to content

Conversation

@jkpth
Copy link

@jkpth jkpth commented Nov 19, 2025

  • Add PostgREST deployment, service, and mapping configurations
  • Configure route /query-postgrest for PostgREST API
  • Use existing query-api-database-connection secret
  • Set PGRST_DB_ANON_ROLE to s_query (may need adjustment after deployment)

Resolves #386

- Add PostgREST deployment, service, and mapping configurations
- Configure route /query-postgrest for PostgREST API
- Use existing query-api-database-connection secret
- Set PGRST_DB_ANON_ROLE to s_query (may need adjustment after deployment)

Resolves Greenstand#386
@jkpth
Copy link
Author

jkpth commented Nov 19, 2025

Please verify that s_query is the correct PGRST_DB_ANON_ROLE

@dadiorchen
Copy link
Contributor

Great! How do you test the things? Run it locally? How do you handle the debase access on your side?

@jkpth
Copy link
Author

jkpth commented Dec 6, 2025

I tested locally using Docker Compose with a test PostgreSQL database. I didn't have access to the production database, so I couldn't verify the actual role name. I made a trees table to test and verified the PostgREST endpoints worked correctly. The Kubernetes YAML configuration also matches the current setup and should be correct as well.

The s_query role name was inferred from the codebase pattern

  • scripts/vars.sh shows SCHEMA=query
  • scripts/setup-dev-database-passwords.sh shows the service user pattern is s_$SCHEMA

I don't have access to the database to test this fully but it should be okay once in prod I can test to make sure it works as expected.

value: "public"
- name: PGRST_DB_ANON_ROLE
value: "s_query"
- name: PGRST_OPENAPI_SERVER_PROXY_URI
Copy link
Contributor

Choose a reason for hiding this comment

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

How do we handle password here? We use sealed db connection/credentials here: https://github.com/Greenstand/treetracker-query-api/blob/main/deployment/base/database-connection-sealed-secret.yaml

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.

Deploy postgrest as a complement of the query API

2 participants