A mountable Rails engine that turns natural language into SQL. Powered by any LLM. Think Blazer meets ChatGPT.
gem "query_lens"
click to copy
| Plan | Total Revenue |
|---|---|
| Enterprise | $284,500.00 |
| Professional | $127,350.00 |
| Starter | $43,200.00 |
Natural language SQL generation with the security, organization, and developer experience your team expects.
Ask questions in plain English. QueryLens generates, explains, and executes the SQL — with follow-up conversation support for iterative refinement.
Save known-good queries, organize them into projects, and share across your admin team. Like Blazer's saved queries, but with AI generation built in.
Two-stage AI generation for large databases. Sends only relevant table schemas to the LLM, keeping requests fast and cost-effective even at scale.
Auto-saved conversations persist across page refreshes. Browse recent chats in a Claude-style sidebar, pick up where you left off.
Powered by RubyLLM. Swap between OpenAI, Claude, Gemini, DeepSeek, Ollama, or any of 10+ supported providers with a single config line.
Self-contained CSS and vanilla JavaScript. No webpack, no node_modules, no build step. Mount the engine and go.
Three commands to install. One config file to customize. Then visit /query_lens and start asking questions.
Add QueryLens to your Gemfile, run the installer, and migrate. The installer creates your config, routes, and database tables.
Point QueryLens at any LLM. Set your API key, pick a model, configure auth, and optionally exclude sensitive tables.
Visit /query_lens in your browser. Ask anything about your data in natural language. Save queries you'll use again.
Multiple overlapping layers ensure that even if one check fails, your data stays safe. Production-grade from day one.
All queries execute inside SET TRANSACTION READ ONLY on PostgreSQL. Writes are impossible at the database level.
Only SELECT and WITH (CTE) statements are allowed. INSERT, UPDATE, DELETE, DROP, and dangerous functions are blocked.
Excluded tables are hidden from the AI and blocked at execution. Even manually typed queries can't access restricted tables.
Lambda-based authentication, per-query timeouts, row limits, and full audit logging of every execution and blocked attempt.
QueryLens is ready to mount in your Rails app today. Your database already has the answers.