# Melange > Zero-copy authorization for PostgreSQL - OpenFGA-compatible permission checking that queries your existing domain tables directly. Melange is an OpenFGA-to-PostgreSQL compiler. You write an OpenFGA (.fga) authorization model and a `melange_tuples` SQL view over your existing tables; `melange migrate` compiles the model into PostgreSQL functions such as `check_permission`, called from SQL or the Go and TypeScript clients. Every link below is a markdown page. The whole documentation as one file: https://melange.sh/llms-full.txt ## Getting Started - [Installation](https://melange.sh/docs/getting-started/installation.md): Install the Melange CLI with Homebrew, go install, or a prebuilt binary for Linux, macOS, or Windows. - [Quick Start](https://melange.sh/docs/getting-started/quick-start.md): The shortest path from an empty project to a working permission check in PostgreSQL with Melange. - [Project Setup](https://melange.sh/docs/getting-started/project-setup.md): The melange init wizard in detail: starter templates, migration strategies, database settings, and client code generation. - [Creating Your Tuples View](https://melange.sh/docs/getting-started/tuples-view.md): Create the melange_tuples view that maps your existing domain tables into authorization tuples, with no tuple sync. - [Your First Migration](https://melange.sh/docs/getting-started/first-migration.md): Validate your schema, apply your first Melange migration, and check the result with melange doctor. ## Concepts - [Key Components](https://melange.sh/docs/concepts/components.md): The four parts of a Melange setup: the CLI, the schema file, the melange_tuples view, and the optional runtime libraries. - [How It Works](https://melange.sh/docs/concepts/how-it-works.md): How Melange compiles an OpenFGA model into PostgreSQL functions that run permission checks inside your database. - [Authorization Modelling](https://melange.sh/docs/concepts/modelling.md): OpenFGA DSL syntax as supported by Melange: types, relations, unions, intersections, exclusions, wildcards, and parent lookups. - [Tuples View](https://melange.sh/docs/concepts/tuples-view.md): The melange_tuples view schema, query patterns for mapping domain tables to tuples, and indexing for performance. ## Guides - [Modelling Guide](https://melange.sh/docs/guides/modelling-guide.md): Build an OpenFGA authorization model for Melange from scratch, with the schema, tuples view, and checks together. - [Running Migrations](https://melange.sh/docs/guides/migrations.md): Two ways to install Melange's generated SQL: melange migrate directly, or SQL files for your existing migration tool. - [Checking Permissions](https://melange.sh/docs/guides/checking-permissions.md): Check whether a subject has a relation on an object with Melange from Go, TypeScript, or SQL, including bulk checks. - [Listing Objects](https://melange.sh/docs/guides/listing-objects.md): List every object a subject can access with Melange's ListObjects, including pagination and performance tips. - [Listing Subjects](https://melange.sh/docs/guides/listing-subjects.md): List every subject with access to an object with Melange's ListSubjects, including pagination and performance tips. - [Explaining Decisions](https://melange.sh/docs/guides/explaining-decisions.md): Use Explain to trace why a Melange permission check was allowed or denied, branch by branch. - [Expanding Permissions](https://melange.sh/docs/guides/expanding-permissions.md): Use Expand to get the OpenFGA userset tree for an object and relation, for audit UIs and access reviews. - [Contextual Tuples](https://melange.sh/docs/guides/contextual-tuples.md): Pass temporary tuples at check time to evaluate permissions against data that is not stored in the database. - [Replacing Conditions](https://melange.sh/docs/guides/conditions.md): Express OpenFGA conditions with SQL predicates in the tuples view, contextual tuples, and session settings. - [Caching](https://melange.sh/docs/guides/caching.md): Use Melange's in-memory permission cache to serve repeated checks in nanoseconds, and when to avoid it. - [Scaling](https://melange.sh/docs/guides/scaling.md): Run Melange at scale: indexing the tables behind the tuples view, materialized views, and keeping list queries fast. - [Testing Authorization](https://melange.sh/docs/guides/testing-authorization.md): Test your Melange schema and tuples view together against a real PostgreSQL database. - [Studio](https://melange.sh/docs/guides/studio.md): melange studio: a local, read-only web console for exploring the deployed model, explaining checks, and browsing tuples. - [Using Coding Agents](https://melange.sh/docs/guides/coding-agents.md): Point coding agents like Claude Code, Codex, or Cursor at Melange's docs, and give them project instructions for working on your schema. - [Troubleshooting](https://melange.sh/docs/guides/troubleshooting.md): Diagnose and fix common Melange problems with melange doctor, error messages, and query plans. ## Reference - [Configuration](https://melange.sh/docs/reference/configuration.md): Configure Melange with melange.yaml, MELANGE_ environment variables, or command-line flags, and how they take precedence. - [CLI Reference](https://melange.sh/docs/reference/cli.md): Every Melange CLI command and flag: init, validate, migrate, status, doctor, generate client, studio, and more. - [SQL API](https://melange.sh/docs/reference/sql-api.md): Melange's generated SQL functions, such as check_permission and list_accessible_objects, callable from any PostgreSQL client. - [Go API](https://melange.sh/docs/reference/go-api.md): Reference for Melange's Go runtime package: Checker, Object, cache, list, expand, and explain APIs. Stdlib only. - [TypeScript API](https://melange.sh/docs/reference/typescript-api.md): Reference for the @pthm/melange TypeScript runtime client, mirroring the Go API with TypeScript idioms. - [Generated Code](https://melange.sh/docs/reference/generated-code.md): What melange generate client produces for Go and TypeScript: type-safe constants and constructors from your schema. - [Deployed Model](https://melange.sh/docs/reference/deployed-model.md): How Melange records each applied authorization model in melange_migrations so the database describes itself. - [Errors](https://melange.sh/docs/reference/errors.md): Error types, sentinel values, and helper functions in Melange's Go runtime package. - [OpenFGA Compatibility](https://melange.sh/docs/reference/openfga-compatibility.md): Which OpenFGA features Melange supports, how it is tested against the OpenFGA suite, and how to move between the two. - [Performance](https://melange.sh/docs/reference/performance.md): Measured Melange latency on managed PostgreSQL: what checks and list queries cost, what drives the cost, and how to plan for it. - [Benchmark schemas](https://melange.sh/docs/reference/benchmark-models.md): Complete schemas, data layout, and query selection behind the October 2026 performance measurements. ## Optional - [Contributing](https://melange.sh/docs/contributing/index.md): working on Melange itself, not needed to use it - [Melange v0.10.0](https://melange.sh/blog/v0.10.0.md): Melange v0.10.0 compiles nested combinations of and, or and but not exactly. Earlier versions approximated some of them, and several approximations granted … (2026-10-20) - [Melange v0.9.6](https://melange.sh/blog/v0.9.6.md): Melange v0.9.6 adds melange studio, a local web console for inspecting a melange database. It shows the deployed model, explains and expands checks, tests a … (2026-10-19) - [Melange v0.9.5](https://melange.sh/blog/v0.9.5.md): Melange v0.9.5 fixes an exclusion bypass in generated SQL: a user excluded by a but not relation was allowed through any relation that reached it via an alias … (2026-10-17) - [All release notes](https://melange.sh/blog/)