SpecQL - Business-focused YAML to PostgreSQL + GraphQL code generator
Reason this release was yanked:
Project moved to private development
Project description
SpecQL: From YAML to Production Backend in Minutes
20 lines of YAML → 2000+ lines of production PostgreSQL + GraphQL code Build enterprise backends that scale, not boilerplate that breaks.
The Backend Development Crisis
Building production backends takes months and thousands of lines of repetitive code:
- ❌ PostgreSQL schemas with proper indexing and constraints
- ❌ Audit trails, soft deletes, multi-tenancy
- ❌ PL/pgSQL functions with error handling and validation
- ❌ GraphQL schemas, resolvers, and mutations
- ❌ TypeScript types, Apollo hooks, and frontend integration
- ❌ Database migrations, test fixtures, and CI/CD
Result: 97% boilerplate, 3% business logic. Bugs in the boilerplate.
The SpecQL Solution
Define your business domain once. Generate everything else automatically.
Your Input (20 lines)
entity: Contact
schema: crm
fields:
email: email! # Auto-validates email format
company: ref(Company) # Auto-creates foreign key
status: enum(lead, qualified, customer)
actions:
- name: qualify_lead
steps:
- validate: status = 'lead'
- update: Contact SET status = 'qualified'
What You Get (2000+ lines generated)
✅ PostgreSQL DDL with Trinity pattern (pk_*, id, identifier) ✅ Rich type validation with CHECK constraints and indexes ✅ PL/pgSQL functions with error handling and transactions ✅ GraphQL API with auto-discovery and mutations ✅ TypeScript types & Apollo hooks for frontend integration ✅ Database migrations and test fixtures ✅ Multi-tenant support with RLS policies
Who Uses SpecQL?
🚀 Startups & Small Teams
Need a production backend yesterday? Skip 6 months of development.
- Ship 10x faster: Idea to production in days, not months
- Focus on product: Not infrastructure
- Scale confidently: Enterprise patterns built-in
🏢 Enterprise Teams
Modernize legacy systems without breaking compliance.
- Reverse engineer existing SQL/business logic
- Multi-tenant architecture for complex orgs
- Security first: Audit trails, RLS, encryption
- Migration tools for gradual adoption
🤖 AI-Assisted Development
Structured YAML that AI can reliably understand and generate.
- Consistent patterns reduce hallucination
- Rich type system provides semantic context
- Validation prevents AI-generated bugs
Quick Start (5 Minutes to First Backend)
1. Install SpecQL
pip install specql
2. Define Your First Entity
Create contact.yaml:
entity: Contact
schema: crm
fields:
email: email! # Rich type with auto-validation
first_name: text!
last_name: text!
actions:
- name: create_contact
- name: update_contact
3. Generate Everything
specql generate contact.yaml
4. Deploy & Test
# Generated files appear in db/schema/
createdb myapp
cd db/schema
psql myapp < schema.sql
# Your GraphQL API is ready!
# Check localhost:4000/graphql
That's it! You now have a production PostgreSQL backend with GraphQL API.
What You Get
Core Features (Always Included)
- ✅ YAML-to-SQL Generation: Business logic → PostgreSQL schema
- ✅ Trinity Pattern: pk_*/id/identifier for optimal performance
- ✅ Rich Types: 49 validated types with automatic constraints
- ✅ Actions: Business logic with validation and error handling
- ✅ FraiseQL: Auto-generated GraphQL API
- ✅ Multi-tenant: Schema registry with RLS policies
Optional Features
# For migrating existing codebases
pip install specql[reverse]
# For generating test data
pip install specql[testing]
# For development/contribution
pip install specql[dev]
Documentation
🚀 Just Getting Started?
→ Quick Start Guide - 30 minutes to first production backend
🏢 Migrating Legacy Systems?
→ Migration Guide - Reverse engineering existing codebases
📚 Learning Core Concepts?
→ Core Concepts - Understanding SpecQL's approach
🛠️ Building with SpecQL?
→ Guides - Practical how-tos and examples
📖 Technical Reference?
→ Reference - Complete syntax and API docs
Real Results
Before SpecQL:
- CRM system: 15 entities × 600 lines = 9,000 lines of repetitive code
- 3 developers × 8 hours = 24 developer days
- 6 months development time
After SpecQL:
- CRM system: 15 entities × 20 lines = 300 lines of YAML
- 1 developer × 2 hours = 2 developer days
- 1 week development time
Impact: 96% less code, 92% faster development, zero infrastructure bugs.
Contributing
SpecQL is open source and welcomes contributions! See Contributing Guide.
License
MIT - See LICENSE
Ready to eliminate 99% of backend boilerplate? Start with the Quick Start! 🚀
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file specql-0.9.2.tar.gz.
File metadata
- Download URL: specql-0.9.2.tar.gz
- Upload date:
- Size: 511.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f63900bacff9c61f63d8cb1f2285e01fbe579b14fff564da5b0ffcaab01f7d1
|
|
| MD5 |
e11b7dfa920b2090b3d58eb9065db254
|
|
| BLAKE2b-256 |
68c7cf71785dd42998f173af33cba50884879dbf2e8edccc866efd1fa3eb4420
|
Provenance
The following attestation bundles were made for specql-0.9.2.tar.gz:
Publisher:
release.yml on fraiseql/specql
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
specql-0.9.2.tar.gz -
Subject digest:
0f63900bacff9c61f63d8cb1f2285e01fbe579b14fff564da5b0ffcaab01f7d1 - Sigstore transparency entry: 720726805
- Sigstore integration time:
-
Permalink:
fraiseql/specql@e2fbadde0ff3882797a9fd4b2974f725cc97aecb -
Branch / Tag:
refs/tags/v0.9.2 - Owner: https://github.com/fraiseql
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e2fbadde0ff3882797a9fd4b2974f725cc97aecb -
Trigger Event:
push
-
Statement type:
File details
Details for the file specql-0.9.2-py3-none-any.whl.
File metadata
- Download URL: specql-0.9.2-py3-none-any.whl
- Upload date:
- Size: 696.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02e95db670bded2874e2bd49322af00a2a8f2fa912c71f83166c53a3bfaccdc3
|
|
| MD5 |
6cb2767862973d29c2b4848bef9d8f2a
|
|
| BLAKE2b-256 |
abba2e3ec7d7565ca03d0b1d18f729c4854fa44d597716fbff4dae44694ae98c
|
Provenance
The following attestation bundles were made for specql-0.9.2-py3-none-any.whl:
Publisher:
release.yml on fraiseql/specql
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
specql-0.9.2-py3-none-any.whl -
Subject digest:
02e95db670bded2874e2bd49322af00a2a8f2fa912c71f83166c53a3bfaccdc3 - Sigstore transparency entry: 720726807
- Sigstore integration time:
-
Permalink:
fraiseql/specql@e2fbadde0ff3882797a9fd4b2974f725cc97aecb -
Branch / Tag:
refs/tags/v0.9.2 - Owner: https://github.com/fraiseql
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e2fbadde0ff3882797a9fd4b2974f725cc97aecb -
Trigger Event:
push
-
Statement type: