Skip to main content
WorkBuildsBlueprintsLabsAbout
Contact

  1. HubZero
  2. Builds
  3. QueryCraft

Build / shipped product

QueryCraft

QueryCraft was an AI-assisted SQL workbench that combined natural-language query generation with schema-aware context, review-first workflows, and secure read-only execution. It is now retired and preserved as a HubZero engineering reference.

  • View repository ↗ (opens in a new tab)
Reference
HZ-BL-001
Maintenance status
Retired
Technology
11 listed
  • TypeScript
  • Next.js
  • MongoDB
  • Tailwind CSS
  • Artificial Intelligence
  • Cloud Architecture
  • Full-Stack Development
  • Large Language Models

Contributors

  • Rifaque AhmedChief Executive OfficerEngineering Profile →
  • Raif KaraniChief Technical OfficerEngineering Profile →
  • Syed Mohammed SultanChief Marketing OfficerEngineering Profile →
querycraft-hero

Product lens

Product story

  1. The review-first paradigm
  2. Architectural evolution
  3. Engineering lessons

The review-first paradigm

Natural-language-to-SQL interfaces often conflate generation with execution. This collapse of trust boundaries creates significant risk: models hallucinate, misinterpret dialects, or generate unsafe statements that execute without oversight. QueryCraft was built to decouple these actions, establishing a rigid review boundary where AI acts as a drafter, not an authority.

QueryCraft hero interface
The workbench UI centers on the generated SQL artifact, separating the AI's proposal from the user's manual confirmation.

Architectural evolution

QueryCraft evolved from a fragmented three-repository prototype that suffered from contract drift and incomplete security models. The second-generation implementation was a unified, full-stack Next.js application. This consolidation enabled strict type safety across the entire request lifecycle and eliminated the need for complex inter-service communication.

System architecture diagram
The request lifecycle forces all generated SQL through an independent validation and execution boundary, isolating the AI service from database-native access.

Engineering decisions focused on defense-in-depth. Schema-aware retrieval used immutable, hashed snapshots to ground generation in relevant context while minimizing token consumption. Execution security relied on AST-based parsing that rejected non-read operations, supplemented by database-native read-only user accounts.

Engineering lessons

  • Streaming structured output requires local validation before persistence; mid-stream failures should not be retried to avoid partial or duplicated artifacts.
  • Dialect-specific behavior must be isolated into provider adapters to prevent driver leaks into core application logic.
  • Separating metadata introspection from execution providers preserves the security boundary necessary for safe read-only operations.
Product feature overview
The workbench design enforces explicit schema-grounding and review, ensuring that AI output is treated as a draft rather than a command.

QueryCraft has been retired and is preserved as an engineering reference. Its lasting value lies in the patterns established for safe AI integration, specifically the use of independent validation layers and the commitment to keeping generated code as an editable, user-controlled artifact.

Technical lens

Architecture and decisions

  1. QueryCraft: A review-first SQL workbench
  2. Architectural evolution
  3. Core technical decisions
  4. Engineering challenges

QueryCraft: A review-first SQL workbench

QueryCraft is a retired HubZero Build designed as an AI-assisted SQL workbench. It enables users to connect PostgreSQL, MySQL, or SQLite databases, introspect their schemas, and generate SQL queries via natural language. The core engineering philosophy mandates that generated SQL never executes automatically, enforcing a strict review-first workflow.

QueryCraft landing page hero
The landing page emphasizes the explicit review boundary: the user generates, inspects, and confirms before any execution occurs.

Architectural evolution

The project originated as a three-repository prototype that suffered from contract drift and fragmented authentication. The second generation, preserved here as v1.0.0, consolidated the system into a single, typed Next.js App Router application. This migration eliminated redundant services and established a unified full-stack codebase.

QueryCraft system architecture diagram
The architecture separates generation, connection management, and execution into distinct service boundaries, with MongoDB serving as the application store.

Core technical decisions

  • Schema-grounded generation: The system selects relevant tables using deterministic scoring and one-hop foreign-key relations to optimize token usage.
  • Separated execution: Query execution is decoupled from AI generation. SQL is parsed into an AST for policy enforcement before being run in a read-only database-native boundary.
  • Transient results: Result rows are never persisted. They are streamed directly to the browser, ensuring the application store remains focused on metadata and audit records.
  • Encrypted persistence: Database credentials are stored as AES-256-GCM encrypted envelopes within MongoDB, preventing raw credential exposure.
QueryCraft product workbench view
The workbench keeps the SQL artifact central, exposing model assumptions and execution metadata without burying the query in a chat transcript.

Engineering challenges

A primary challenge was preventing AI from becoming an authoritative actor. We addressed this through layered controls: local Zod validation of structured outputs, an AST-based policy engine, and explicit user confirmation. Additionally, supporting multiple dialects (PostgreSQL, MySQL, SQLite) required creating separate adapter families for metadata introspection and query execution to avoid leaking driver-specific behavior into the shared application logic.

QueryCraft is a retired Build preserved for architectural reference. The repository does not document its deployment history or the specific cause for its retirement.

Media / evidence

Recorded views

querycraft-hero
querycraft-architecture
querycraft-product

Publication record

HZ-BL-001 / Retired

Return to Builds →
HubZero

Engineering products, systems, and the public record behind them.

Record

  • Work
  • Builds
  • Blueprints
  • Labs
  • Notes
  • Ledger

Company

  • About
  • Engineering
  • Services
  • Careers
  • Contact

Resources

  • Search

© 2026 HubZero · Privacy

Evidence before claims.