Skip to main content

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

Version License

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

specql-0.9.2.tar.gz (511.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

specql-0.9.2-py3-none-any.whl (696.4 kB view details)

Uploaded Python 3

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

Hashes for specql-0.9.2.tar.gz
Algorithm Hash digest
SHA256 0f63900bacff9c61f63d8cb1f2285e01fbe579b14fff564da5b0ffcaab01f7d1
MD5 e11b7dfa920b2090b3d58eb9065db254
BLAKE2b-256 68c7cf71785dd42998f173af33cba50884879dbf2e8edccc866efd1fa3eb4420

See more details on using hashes here.

Provenance

The following attestation bundles were made for specql-0.9.2.tar.gz:

Publisher: release.yml on fraiseql/specql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for specql-0.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 02e95db670bded2874e2bd49322af00a2a8f2fa912c71f83166c53a3bfaccdc3
MD5 6cb2767862973d29c2b4848bef9d8f2a
BLAKE2b-256 abba2e3ec7d7565ca03d0b1d18f729c4854fa44d597716fbff4dae44694ae98c

See more details on using hashes here.

Provenance

The following attestation bundles were made for specql-0.9.2-py3-none-any.whl:

Publisher: release.yml on fraiseql/specql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page