Skip to main content
  1. Tags/

Gemini

Simplifying Database Queries with AI & SQL Automation

Deep Dive .NET · Jan 6, 2025 · 13 min read
Business users kept asking my team for one-off data pulls: how many orders above $150 in December, which products are low on stock, that sort of thing. Every request meant a developer dropping their work to write a throwaway SQL query. So I built a REST API that does the translation instead. It feeds the database schema to an LLM, gets back a SQL query, runs it, and returns JSON. One codebase, four interchangeable providers (OpenAI, Azure OpenAI, Claude, and Gemini), switched by a single environment variable.
Simplifying Database Queries with AI & SQL Automation