PYTHON · FASTAPI + SQLALCHEMY 2.0 ← All Developer Tools
SQL & SQLAlchemy to FastAPI + Pydantic v2 Code Generator
Compile SQL DDL or SQLAlchemy models into runnable FastAPI + Pydantic v2 routes with HS256 JWT auth, RBAC role guards, branch/tenant isolation, Decimal money types, and transactional AuditLog hooks.
Generate FastAPI Routes in IDE → Run in CLI Sandbox → Launch Full Console
The Engineering Problem
Hand-writing Pydantic v2 schemas, SQLAlchemy 2.0 models, JWT auth, RBAC checks, tenant isolation, and soft-archive/void endpoints for dozens of tables wastes days and invites mass-assignment or secret-leak bugs.
CREATE TABLE advances ( id UUID PRIMARY KEY, branch_id UUID NOT NULL, amount NUMERIC(12,2) NOT NULL, is_voided BOOLEAN NOT NULL DEFAULT FALSE );
# Emits UUID PKs, Decimal money, HS256 JWT require_auth, require_roles,
# server-side branch_id isolation, POST /advances/{id}/void (no hard DELETE),
# and transactional write_audit_log() hooks.
Run 100% Offline in Your Terminal or CI
pip install solunex-ssdo ssdo api-gen ./schema.sql --target fastapi --route-prefix /api/v1
What SSDO Checks & Generates
- Generates runnable FastAPI + SQLAlchemy 2.0 + Pydantic v2 code with stdlib HS256 JWT auth and POST /auth/login.
- Redacts password_hash, api_key, and token columns from all response schemas automatically.
- Strips privilege columns (role, branch_id, tenant_id) from PATCH inputs to prevent mass-assignment escalation.
- Detects ERP/financial ledger tables (advances, till_closings, credit_accounts) and replaces destructive DELETE with /void or /archive.
Frequently Asked Questions
Does the generated FastAPI code actually run against SQLAlchemy?
Yes. API Blueprint v2.5 emits real SQLAlchemy 2.0 ORM models, Session = Depends(get_db) queries, UUID primary keys, Decimal numeric types, and transactional db.commit() handlers.
Can I remove /api/v1 or customize the route prefix?
Yes. Pass --route-prefix / (or choose Root / in the Schema IDE) to generate clean domain paths without /api/v1.
More Zero-Row Developer Tools
- PostgreSQL Zero-Downtime Migration & Rollback SQL Generator
- Foreign-Key ON DELETE CASCADE Blast Radius & Insert Order Simulator
- Audit Existing FastAPI, Express & Next.js Routes Against Your SQL Schema
- SQL Schema to OpenAPI 3.1 & Next.js / Zod Route Generator
- SQLAlchemy, Prisma & Drizzle Schema Visualizer & ERD Explorer
- SQL QueryDoctor: Zero-Row Query, ESR Index & EXPLAIN Plan Analyzer