Repository navigation
OpenDBAPI 0.2.0
Configuration as code, API orchestration, and more ways to run OpenDBAPI in production.
Run it
docker pull ghcr.io/egret-data/opendbapi:0.2.0
helm install opendbapi deploy/helm/opendbapi --set database.url=jdbc:postgresql://… --set existingSecret=…Upgrading from 0.1.0: Flyway migrates the schema on start (V13–V17).
Configuration as code
- Plan / apply a workspace's YAML (
POST /config:plan,/config:apply): plan shows creates, updates (with the differing fields), deletes (withprune); apply writes everything in one transaction, then publishes endpoints marked live only after their tests pass. An export always plans as unchanged. - Environments map the file's datasource names to each workspace's datasources, so one file serves dev, staging and prod.
opendbapicommand line in the image:docker run ghcr.io/egret-data/opendbapi:0.2.0 plan|apply|export ….- API tokens (user menu → API tokens):
Authorization: Bearer odb_…, optionally limited to one workspace and given an expiry; the CLI readsOPENDBAPI_TOKEN. The README has a GitHub Actions example. - Lock a workspace to configuration files: endpoints, groups, service accounts and data policies then change through
applyonly (opendbapi.ui.read-onlylocks every workspace). - Major versions and deprecation travel in the files too.
- UI: Settings → Import & export → Apply YAML, and Environments.
Endpoints
- Major versions side by side: New major version… copies an endpoint to
v2/…; deprecated endpoints answer withDeprecation,Sunsetand a link to the newest live major; validation warns about breaking changes. - Groovy full mode: scripts run their own queries with
db.one / list / value / updateand return any answer; every query still goes through the static checks, row filter, masks and limits. - Workflows (DBAPI-style orchestration) on a drag-and-drop canvas: SQL and script nodes, Call endpoint nodes that reuse other endpoints, Decision nodes with Yes/No branches, End nodes per branch; independent nodes run in parallel; called endpoints on the same datasource join the workflow's transaction.
- GET endpoints never change data, neither through scripts nor through the endpoints they call.
Secrets
- HashiCorp Vault references
vault:PATH#KEY(token, AppRole or Kubernetes auth), each workspace confined to its own paths.
Running several instances
- Rate limits can be shared across pods (
OPENDBAPI_RATE_LIMIT_SHARED, on in the Helm chart).
Fixes
- Migration V14 now backfills endpoint lineages on databases that already have endpoints (it failed there before; nothing was half-applied). If an empty database ran the earlier V14 from a
mainimage, runflyway repair. - The image build retries when Maven Central throttles.