MhdIqbalPratama/text-to-sql-semantic-layer — reverse-engineered prompt
Reverse engineered prompt
Build me a small Python project for text to SQL with a simple semantic layer. I want a user to type a normal question like “how many orders did we have last month” and have the app turn it into a SQL query using friendly business names instead of forcing the user to know table and column names.
Please make it runnable locally and easy to understand. Include a basic web screen where I can enter a question, see the generated SQL, and optionally see the result if a database connection is available. Also add an API route so the same question can be sent from another app.
Keep the semantic layer simple, like a config that maps business terms to tables, columns, metrics, and filters. Add sensible example data or example config so I can test it right away. If something is unclear, make a reasonable simple choice and keep the code organized so I can improve it later. Look up current docs online if needed.
Want more depth? Deep Reverse