Skip to content

excalibase/excalibase-graphql

Repository files navigation

Excalibase GraphQL

CI E2E Tests License Java Spring Boot PostgreSQL MySQL Docs

Instant GraphQL + REST + NoSQL APIs on your existing Postgres or MySQL. Introspects the schema at startup, serves three protocols from one process, streams realtime changes over WebSocket, and ships a 134 MB native binary.

📘 Full documentation →


Features

Feature Docs
🔄 Auto schema generation — GraphQL types + REST endpoints from your tables, zero config GraphQL · REST
📦 NoSQL document store — JSONB-backed collections, expression indexes, Mongo-style DX NoSQL
🔍 Rich filteringeq/neq/gt/lt/in, regex, FTS, JSON paths, vectors, arrays — per your DB Filtering · DB compat
🧭 Vector k-NN search — pgvector-backed, cosine/L2/IP distance, HNSW indexes Search & Vector
📡 Realtime subscriptions — WebSocket, backed by WAL via NATS CDC; one endpoint serves REST + NoSQL + GraphQL Realtime · GraphQL subs
🔐 Row-level security — native Postgres RLS, enforced via request.user_id session var RLS
🗄️ Stored proceduresCALL proc(args) as callProcName mutations with IN/OUT params Stored procedures
🔑 Composite keys, FK relations, views — forward + reverse FK fields auto-wired GraphQL
📄 Cursor pagination — Relay-spec GraphQL connections + PostgREST-style REST + keyset for NoSQL Pagination
JSON Schema validation — Draft 2020-12 on NoSQL inserts Validation
🏢 Multi-schema — all schemas auto-discovered (except pg_*, information_schema, nosql) Multi-schema
Native image — GraalVM 25 AOT, ~134 MB binary, starts in <100 ms Install
📦 TypeScript SDK (pre-release) — auth + GraphQL + REST + NoSQL in one client, codegen types SDK

Quickstart

# 1. Start Postgres + API (pgvector-enabled)
docker compose up -d

# 2. GraphQL
curl -X POST http://localhost:10000/graphql \
  -H 'Content-Type: application/json' \
  -d '{"query":"{ __schema { queryType { name } } }"}'

# 3. REST
curl 'http://localhost:10000/api/v1/rest/customer?limit=5'

# 4. NoSQL — declare a collection + insert
curl -X POST http://localhost:10000/api/v1/nosql -d '{
  "collections": { "users": { "indexes": [{"fields":["email"],"unique":true}] } }
}' -H 'Content-Type: application/json'

curl -X POST http://localhost:10000/api/v1/nosql/users -d '{
  "doc": {"email":"vu@acme.com","status":"active"}
}' -H 'Content-Type: application/json'

Full install guide (JVM, native image, K8s): docs/quickstart →

The platform

This repo is one service in a larger stack. Each piece runs independently:

Repo Purpose
excalibase-graphql (this) GraphQL + REST + NoSQL gateway on your DB
excalibase-auth JWT/JWKS auth with email/password + API keys
excalibase-watcher Postgres WAL → NATS CDC for realtime + cache invalidation
excalibase-provisioning Multi-tenant DB provisioning, Studio web UI, Deno edge functions
excalibase-sdk-js TypeScript SDK (dual-protocol, auth, codegen)

Development

# Run the full test suite (unit + IT + E2E)
make e2e

# Build the native image (requires GraalVM 25)
make build-native

# Run the local dev stack with observability (Grafana, Prometheus, Tempo, Loki)
make up

See Testing for the full workflow and Contributing if you're opening a PR.

Architecture (60 seconds)

  • Modules: starter (shared SPI + CDC) · postgres + mysql (dialect impls) · rest-api · nosql · graphql-api (composes everything)
  • SqlDialect SPI: each DB declares which operators it supports; schema is built dynamically from that. Adding a new DB = implementing one dialect interface
  • CDC path: Watcher tails WAL → publishes to NATS JetStream → NatsCDCServiceSubscriptionService (reactor sinks per table) → WebSocket out
  • NoSQL: lives in the nosql Postgres schema; relational introspection filters it out. Same DB, same pool, two surfaces

License

Apache 2.0 — see LICENSE.