cd /news/developer-tools/show-hn-inversql-build-sql-interacti… · home topics developer-tools article
[ARTICLE · art-123596] src=github.com ↗ pub= topic=developer-tools verified=true sentiment=· neutral

Show HN: InverSQL: Build SQL interactively in inverse

Developer rentruewang released InverSQL, an open-source Streamlit app that generates SQL queries from CSV uploads by overfitting a scikit-learn decision tree, converting it to boolean logic with sympy, and simplifying it into SQL. The tool, demonstrated at inversql.streamlit.app, lets users select cells to define query results without writing SQL, and the author is also promoting a related project, aioway, an automated training and inference engine.

read1 min views1 publishedSep 8, 2026
Show HN: InverSQL: Build SQL interactively in inverse
Image: Michielbdejong (auto-discovered)
  1. User doesn't want to write SQL.
  2. User uploads CSV to inversql streamlit app
  3. User selects cells (that will be selected by the SQL).
  4. We overfit ascikit-learn binary decision tree on the data.
  5. We decompose the tree, convert to boolean logic (explainable AI part).
  6. We simplify the logic with sympy .
  7. Generate SQL from previous steps (joins to JOIN and boolean to WHERE).
  8. User sees the SQL.
  9. User is happy.

| 🎬 Demo in a GIF | 🏛️ Architecture diagram |

|---|---|
|                 [Link to](/rentruewang/inversql/blob/main/assets/quick-demo.gif)                    [live demo site](https://inversql.streamlit.app)         here. |   | 

For each individual SQL query candidate (the shortest one is displayed in the UI), we need to retrain a new decision tree.

But... The decision tree fitting is honestly fast, don't worry about this.

That's pretty much it!

If you have read this far, please consider giving me a star (⭐) or a fork (🍴). This will keep my motivation going!

Or if you have too much cash at hand:

If you REALLY like my work, nowadays I'm working on aioway, it's an automated training and inference engine that does the following:

  • Adapt to hardware it runs on (optimal hardware usage)

  • Adapt to data it trains on (figure out architecture on its own)

  • Incremental training (never overfit or underfit) Contribution welcome!

To contribute, refer to CONTRIBUTING.md, and our CODE_OF_CONDUCT.md.

Inspired by regexgen's process. Instead of regex we do SQL. Instead of selecting text we do select records. Decision tree is my inspiration tho.

── more in #developer-tools 4 stories · sorted by recency
── more on @rentruewang 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/show-hn-inversql-bui…] indexed:0 read:1min 2026-09-08 ·