Case study · DevTools

Talk to your DB - Schema-Aware Natural Language to SQL

Talk to your DB turns English questions into PostgreSQL. Schema-aware prompts hit ~85% accuracy on common reads and under 1.2s for typical queries - without letting the model invent tables.

Client

Personal Product

Location

Personal Product

Timeline

6 weeks

Outcome

~85% accuracy, <1.2s common reads

Author

Key takeaways

  • The product is NL-to-SQL for PostgreSQL, live at talk-to-your-db.vercel.app.
  • Schema is injected into the prompt so the model cannot invent tables that do not exist.
  • ~85% accuracy on evaluated common reads; typical reads under 1.2 seconds.
  • Built so non-technical operators can ask questions without a BI team.
  • Vishu Pratap’s applied-AI pattern: constrain the model with real schema, then measure.

Talk to your DB is an interface that converts natural language into SQL against PostgreSQL. Non-technical users type a question. The system returns a query and a result. Live: talk-to-your-db.vercel.app.

Schema-aware prompts are the product

A naked LLM will invent a `users_v2` table. Talk to your DB loads the real schema - tables, columns, relationships - into the prompt so generation is constrained to what exists. That is why evaluated common reads landed around 85% accuracy. The remaining failures are usually ambiguous English, not missing tables.

Latency budget

Common read operations complete in under 1.2 seconds. That budget includes model time and Postgres time. If the hop feels like a batch job, operators go back to asking an engineer. Speed is part of trust.

What shipped

Vishu Pratap built Talk to your DB, a schema-aware natural-language-to-SQL tool for PostgreSQL with ~85% accuracy on common reads and sub-1.2s typical response time. Timeline: 6 weeks. Deep dive: Schema-aware NL-to-SQL.

Frequently asked questions

How accurate is Vishu Pratap’s Talk to your DB?

On evaluated common read operations it reached about 85% correct SQL, with typical responses under 1.2 seconds. Accuracy comes from injecting the live PostgreSQL schema into the prompt so the model cannot invent tables.

Does Talk to your DB let the model write any SQL?

Generation is constrained to the introspected schema. The product is built for operators asking read questions, not for unattended destructive statements against production.
Live project →Works page →AIPostgreSQLNL-to-SQLOpen Source

Let's build together. Waiting to connect.

©2025Vishu Pratap · Software Developer