~/gqlith — docs/overview.md
Early access gqlith is in private early access — the code is not publicly available yet. These docs preview the surface so you know what to expect. Join the list →

Docs / Start here

Overview

What the gqlith Postgres-to-API generator emits, where its config lives, and how the GraphQL, REST and MCP surfaces fit together.

gqlith is a build-time code generator that reads a live PostgreSQL schema and writes a complete API — GraphQL, JSON:API REST, and an MCP server for AI agents — as self-contained TypeScript you own.

It is not a runtime engine. You can uninstall gqlith after generating and your API keeps running.

What you get from one schema

From one Postgres database and one gqlith.yaml, the generator emits:

  • GraphQL — queries, mutations, subscriptions, nested writes, filtering, aggregates, computed fields.
  • REST — a JSON:API 1.1–compliant surface at /api/v1.
  • MCP — a Streamable HTTP server at /mcp with four governed tools that make the API self-describing to AI agents, permission-projected per caller.
  • A TypeScript client SDK — a fully-typed fluent client for your own frontend, generated from the same schema.

All surfaces share one permission model: RBAC, row filters, tenancy, validation, rate limits and audit are authored once and enforced identically.

The batteries go past CRUD: file storage, tenant-defined custom fields, typed JSONB, durable webhooks, queues and scheduled jobs, and generated Postgres RLS policies — all compiled from the same annotations.

Where config lives

Two places, both versioned with your schema:

  • gqlith.yaml — adapter choices (targets.*), server policy and limits (graphql.maxDepth / maxComplexity, http.maxBodyBytes, cors, global rate limits), JWT and identity (jwt.*, providers jwt-jose / supabase / clerk / auth0), tenancy, audit.destinations (pg-table / file / telemetry), pagination defaults (relay cursor or offset), tokens, schemaDiscovery, plus the feature blocks (storagePolicy, customFields, typedJson, deliveryPolicy, rls, extensions).
  • COMMENT ON … annotations — per-table and per-column rules (@gqlith.rbac, @gqlith.rowFilter, @gqlith.softDelete, @gqlith.audit, @gqlith.upsert, and so on).

The database is the source of truth. There is no external metadata store to drift out of sync.

Deploy targets

The current adapters target Cloudflare Workers and Deno. There is no engine to boot — the generated server is plain TypeScript that you deploy alongside your other code.

What’s next