README
This Go SDK provides a type-safe client for the Portal DB API, generated using oapi-codegen.
Installation
go get github.com/buildwithgrove/path/portal-db/sdk/goQuick Start
Authentication
For authenticated endpoints, add your JWT token to requests:
Query Features
The SDK supports PostgREST's powerful query features for filtering, selecting, and pagination.
Filtering and Selection
Specific Resource Lookup
RPC Functions
Access custom database functions via the RPC endpoint:
Error Handling
Complete Example
A complete working example is available in the example/ directory:
example/main.go- Demonstrates basic SDK usageexample/go.mod- Module configuration with local replace directive
To run:
# Make sure Portal DB API is running on http://localhost:3000
cd example
go run main.goDevelopment
This SDK was generated from the OpenAPI specification served by PostgREST.
To regenerate run the following make target while the PostgREST API is running:
# From the portal-db directory
make generate-allGenerated Files
models.go- Generated data models and type definitionsclient.go- Generated API client methods and HTTP logicgo.mod- Go module definitionREADME.md- This documentation
Related Documentation
API Documentation: ../../api/README.md
OpenAPI Specification:
../../api/openapi/openapi.json
Was this helpful?
