feat: add PostgREST server package #462
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
feat: add PostgREST server package
Summary
Adds a new
@constructive-io/postgrest-serverpackage that provides a REST API server using PostgREST, following the same patterns as the existing@constructive-io/graphql-serverpackage.The package includes:
/healthzKey differences from the GraphQL server:
postgrestnpm package instead of PostGraphileX-Schemata,X-Database-Id,X-Meta-Schema) rather than domain-based meta schema lookupsReview & Testing Checklist for Human
postgrestnpm package API - I created custom type declarations insrc/postgrest.d.tsassuming aserver.handle()method exists for proxying requests. The actual package API may differ significantly. Check the postgrest-node repo to confirm.pnpm devinpostgrest/server/with a valid database connection to verify it worksmiddleware/gql.ts- This file contains GraphQL queries that aren't actually used by the PostgREST server (dead code carried over from the GraphQL server structure)Notes
postgrestnpm package is v1.2.1 (last published 3 years ago) - may want to evaluate if this is the right approach vs. running PostgREST as a separate binary