Transform GraphQL queries into optimized PostgreSQL. One query. No N+1. Pure speed.
{
users {
id
name
posts {
title
comments {
text
}
}
}
}
SELECT jsonb_agg(
jsonb_build_object(
'id', u.id,
'name', u.name,
'posts', u.posts
)
) FROM users u
Direct GraphQL to SQL translation. No abstraction layers, no performance penalties.
Leverage PostgreSQL's JSONB for nested data in a single query.
Built-in WebSocket subscriptions with PostgreSQL LISTEN/NOTIFY.
pip install, add decorators, run. No configuration files needed.
pip install fraiseql
import fraiseql
@fraiseql.type
class User:
id: int
name: str
email: str
@fraiseql.query
async def users(info) -> list[User]:
return await info.context.repo.fetch_users()
from fraiseql.fastapi import create_app
app = create_app(
database_url="postgresql://localhost/mydb"
)
Scenario | Traditional ORM | FraiseQL | Improvement |
---|---|---|---|
Nested data (3 levels) | ~50 queries | 1 query | 50x fewer |
Response time (1000 users) | ~800ms | ~45ms | 17x faster |
Memory usage | ~120MB | ~25MB | 5x less |
We believe in honest engineering. FraiseQL isn't for everyone:
If these are deal-breakers, check out Hasura or PostGraphile.