Hacker News new | past | comments | ask | show | jobs | submit login

This is pretty simple in any foundation model, provide a well commented schema and ask for the query



Step 1: Your schema has thousands of tables and there aren't many comments.

Step 2...


Use AI to generate the comments of course


Exactly, add any documentation you have about the app for more context too.


the smolagents library is also pretty nice to do the scaffolding around the model. Text to sql seems simple in demos, but to make it work in real life complex cases is very hard: https://medium.com/thoughts-on-machine-learning/build-a-text...


there’s two kinds of people using AI to generate SQL…those who say it’s already solved and those who say it’ll be impossible to ever solve


Yep, probably why I got upvoted then downvoted. I've been using LLMs to write SQL queries for 2 years.


I agree. There's really no magic to it any more. The table create DDL commands are a very precise description of the tables, so almost nothing more is ever needed. You can just describe in detail what query you need, and any decent LLM can do it just fine.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: