Expand description
§FraiseQL Core
Core execution engine for FraiseQL v2 - A compiled GraphQL execution engine.
§Architecture
FraiseQL v2 compiles GraphQL schemas into optimized SQL execution plans at build time, eliminating runtime overhead and enabling deterministic, high-performance query execution.
§Key Components
- Schema: Compiled schema representation (types, fields, SQL mappings)
- Compiler: Parsing, validation, and runtime sub-modules (aggregation, fact tables, window functions)
- Runtime: Compiled query executor
- Database: Connection pooling and transaction management
- Cache: Query result caching with coherency
- Security: Authentication, authorization, and audit
- APQ: Automatic Persisted Queries
§Compilation Flow
Python/TypeScript Decorators
↓
JSON Schema
↓
SchemaConverter (fraiseql-cli)
↙ ↓ ↘
Parse Validate Convert
↓
CompiledSchema.json
↓
Runtime
↙ ↓ ↘
Match Execute Project
↓
GraphQL Response§Example
// Requires: a compiled schema file and a live PostgreSQL database.
// See: tests/integration/ for runnable examples.
use fraiseql_core::schema::CompiledSchema;
use fraiseql_core::runtime::Executor;
use fraiseql_core::db::postgres::PostgresAdapter;
use std::sync::Arc;
// Load compiled schema
let schema = CompiledSchema::from_json(schema_json, false)?;
// Create executor (db_pool is a DatabaseAdapter implementation)
let db_pool = Arc::new(PostgresAdapter::new("postgresql://localhost/mydb").await?);
let executor = Executor::new(schema, db_pool);
// Execute query
let query = r#"query { users { id name } }"#;
let result = executor.execute(query, None).await?;
println!("{}", result);Re-exports§
pub use schema::CompiledSchema;pub use tenancy::TenantContext;pub use chrono;pub use deadpool_postgres;pub use graphql_parser;pub use indexmap;pub use jsonwebtoken;pub use regex;pub use reqwest;pub use serde_json;pub use tokio_postgres;pub use tracing;pub use fraiseql_federation as federation;pub use uuid;pub use zeroize;
Modules§
- apq
- Automatic Persisted Queries (APQ) infrastructure.
- cache
- Query result caching for FraiseQL v2.
- compiler
- Compiler sub-modules for FraiseQL v2.
- db
- The database layer this crate’s public API is built against.
- design
- Design Quality Analysis Engine
- error
- Error types for FraiseQL core.
- graphql
- GraphQL parsing and query processing.
- http
- HTTP utilities for outbound requests.
- prelude
- Convenience re-exports for the most commonly used fraiseql-core types.
- runtime
- Runtime query executor - executes compiled queries.
- schema
- Compiled Schema Types
- security
- Security features
- tenancy
- Tenant identity for FraiseQL.
- types
- Type-safe identifiers and domain types for FraiseQL
- utils
- Utility modules for FraiseQL.
- validation
- Input validation module.
Enums§
- FraiseQL
Error - Main error type for FraiseQL operations.
Constants§
Type Aliases§
- Result
- Result type alias for FraiseQL operations.