FraiseQL
Compiled GraphQL execution engine. Define schemas in Python or TypeScript, compile to optimized SQL at build time, execute with predictable sub-10ms latency.
Where Hasura and PostGraphile interpret GraphQL at request time, FraiseQL generates deterministic SQL templates during compilation, achieving zero runtime query planning overhead for known query patterns.
Quick Start
# 1. Define schema (Python)
:
:
:
return
# 2. Compile
# 3. Run
# 4. Query
Why FraiseQL?
-
Compile-time SQL generation. SQL is generated at build time for deterministic queries. Your schema is analyzed once at build; queries execute without interpretation or query-planning overhead.
-
Schema-as-code authoring. Define schemas in Python or TypeScript with decorators, compile to optimized JSON. No runtime language bridge, no FFI.
-
Multi-database from one schema. PostgreSQL, MySQL, SQLite, SQL Server from a single compiled schema. Per-database SQL generation, not ORM translation.
Performance
Traditional GraphQL: Schema + Query -> Parse -> Plan -> SQL -> Execute -> Serialize
~~~~~~~~~~~~~~ runtime overhead ~~~~~~~~~~~~~~
FraiseQL: Compiled Schema -> SQL Template -> Execute -> Serialize
~~~~ zero planning overhead ~~~~
Benchmarks: crates/fraiseql-core/benches/ (Criterion, reproducible).
Architecture
Authoring (Python/TS) Compilation (Rust) Runtime (Rust)
| | |
schema.json + fraiseql.toml -> schema.compiled.json -> Server
(types) (config) (types + SQL templates) (execute)
Python and TypeScript are authoring languages only. The runtime is pure Rust with zero language bridge overhead.
Database Support
| Feature | PostgreSQL | MySQL | SQL Server | SQLite |
|---|---|---|---|---|
| Queries | ✅ | ✅ | ✅ | ✅ |
| Mutations | ✅ | ✅ | ✅ | ❌ |
| Relay pagination | ✅ | ❌ | ❌ | ❌ |
| Production use | ✅ | ✅ | ✅ | ❌ |
PostgreSQL is the primary platform with full feature support.
MySQL (v2.1+) and SQL Server support queries, mutations, and relay pagination.
SQLite is for local development and testing only. Mutations and relay return an explicit error at runtime.
See docs/database-compatibility.md for the full feature matrix.
Wire Protocol
fraiseql-wire is a separate read-only Rust crate for streaming bulk reads directly from PostgreSQL views. It is not part of the FraiseQL server. Mutations go through the GraphQL HTTP endpoint.
Schema Authoring SDKs
| Tier | Languages |
|---|---|
| Tier 1 (Supported) | Python, TypeScript, Java, Go |
| Tier 2 (Maintained) | PHP, Rust |
Installation
Rust applications:
[]
= { = "2.0.0", = ["server"] }
Schema authoring:
Feature flags:
| Feature | Use Case |
|---|---|
postgres (default) |
PostgreSQL only |
mysql, sqlite, sqlserver |
Additional databases |
server |
HTTP GraphQL server |
observers |
Post-mutation event hooks |
arrow |
Apache Arrow Flight for analytics |
wire |
Streaming JSON over PostgreSQL wire protocol |
full |
All features |
Security
All queries are parameterized at compile time. Zero unsafe code (forbidden). Additional enterprise features:
- OAuth2/OIDC authentication (7+ providers)
- Field-level authorization and encryption-at-rest
- Audit logging (file, PostgreSQL, Syslog)
- Rate limiting on auth endpoints
- Error sanitization (no implementation details leaked)
- Constant-time token comparison
APQ Cache RLS Dependency
Automatic Persisted Query (APQ) caching isolates results per user via Row-Level Security. Different users must generate different WHERE clauses through their RLS policies. If RLS is disabled or generates an empty WHERE clause, two users with the same query and variables will receive the same cached response. Always verify RLS is active in multi-tenant deployments with caching enabled.
See Security Checklist for production hardening.
Documentation
- Getting Started -- 5-minute quick start
- Architecture Documentation -- System design, compiler internals, security model
- Value Proposition -- What FraiseQL does and does not do
- Roadmap -- Prioritized next steps
- Changelog -- User-facing changes per version
- SLA/SLO Targets -- Availability and latency objectives
- Operational Runbooks -- Incident response procedures
- Security Checklist -- Production hardening
- Migration from v1 -- Upgrade path
Quality
- 10,000+ tests (unit, integration, E2E, property-based, fuzz)
- Cross-SDK parity suite: all 9 authoring SDKs (Python, TypeScript, Go, Java, PHP, C#, F#, Elixir, Rust SDK) produce identical schema JSON
- Golden fixture regression guards for every field in the compiled schema contract (protects against issue-#53-class bugs)
- Zero unsafe code (forbidden at compile time)
- Clippy pedantic as deny with justified suppressions
- Load testing infrastructure (k6)
- 12 operational runbooks
Repository Layout
crates/ # Rust engine crates (fraiseql-core, fraiseql-server, fraiseql-cli, …)
sdks/official/ # Official authoring SDKs (Python, TypeScript, Java, Go, Rust, PHP, …)
sdks/community/ # Community-maintained SDKs
docs/ # Architecture docs, guides, runbooks
vendor/ # Vendored Rust patch dependencies ([patch.crates-io])
tutorial/ # Interactive tutorial platform — separate product, co-located for convenience
Fraisier (deployment orchestration tool) has been moved to its own repository at
github.com/fraiseql/fraisier.
See sdks/official/README.md for the full SDK inventory.
Contributing
See CONTRIBUTING.md for guidelines.
License
Dual-licensed under MIT or Apache 2.0. See LICENSE and LICENSE-APACHE.