Logiciel Contact Us
Success Stories Tech News Contact Us
whitepaper

Text-to-SQL in Production.

Text-to-SQL demos are easy. Production is not. This report shows how to move from a plausible query to a trusted business answer across complex schemas, private definitions, access rules, and cost limits.

In depth

A Valid Query Can Still Produce the Wrong Business Answer.

01

Why it persists: Large schemas overload context and increase irrelevant joins.

Production checks should include read-only enforcement, allowed objects, cost estimation, row limits, sensitive fields, join paths, and result sanity.

In shortresult sanity
02

What recovers it: Start with one business area where metrics and joins are governed.

Select relevant tables, columns, definitions, policy, and verified queries.

In shortverified queries
The detail

Where Text-to-SQL Breaks in Production.

Zone · 01

Schema understanding is not business understanding.

Column names rarely encode metric definitions, exclusions, fiscal calendars, or approved joins. Production systems need semantic context and verified examples.

Zone · 02

Execution accuracy is the minimum bar.

A syntactically valid query can be logically wrong. Evaluate result equivalence, policy compliance, cost, latency, and explanation quality.

Zone · 03

Access control must survive natural language.

The user should see only rows, columns, and metrics they are entitled to access. The model cannot be trusted to enforce policy through instruction alone.

By the numbers

The figures that make it a board-level conversation.

2
enterprise benchmarks expose the production gap: Spider 2.0 and EntSQL 2026
5
production controls are essential: semantic context, retrieval, access, validation, and evaluation
10
real questions are enough to expose the first domain-specific architecture gaps
Inside the report

What you'll take away.

01

Step 1: A bounded semantic domain

Start with one business area where metrics and joins are governed. Create a semantic layer, glossary, examples, and approved query patterns.

02

Step 2: Retrieval before generation

Select relevant tables, columns, definitions, policy, and verified queries. Keep the model focused on the smallest sufficient context.

03

Step 3: Layered guardrails

Use identity-aware access, query parsing, allowlists, cost limits, row limits, dry runs, sandboxing, and post-execution checks. Guardrails should exist outside the model.

04

Step 4: Evaluation and feedback in production

Capture questions, clarifications, generated SQL, execution, corrections, and accepted answers. Use failures to expand the evaluation suite and semantic context.

Questions

Frequently asked.

Can we connect an LLM directly to the warehouse?
Do we need a semantic layer?
How should we evaluate?
Should users see the SQL?
What is the best first domain?
Get the whitepaper

Have it emailed to you.

Drop your details and we'll send Text-to-SQL in Production straight to your inbox - no spam, unsubscribe anytime.

Download whitepaper
Next step

Start Narrow. Make Every Answer Inspectable.

Talk through how this applies to your roadmap with our engineering leads - a working session, not a sales pitch.

Download White Paper