TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: SQLTab – Chat with your SQLite database

1 pointsby attilakun6 months ago
Demo: <a href="http:&#x2F;&#x2F;www.sqltab.com&#x2F;static&#x2F;average_earning.gif" rel="nofollow">http:&#x2F;&#x2F;www.sqltab.com&#x2F;static&#x2F;average_earning.gif</a><p>Try it here: <a href="https:&#x2F;&#x2F;www.sqltab.com&#x2F;demo" rel="nofollow">https:&#x2F;&#x2F;www.sqltab.com&#x2F;demo</a><p>Main features:<p>- AI-powered SQL assistant. Allows (one-click) execution and undo&#x2F;redo of SQL generated by the AI.<p>- GUI to rename, remove, and reorder columns in SQLite tables.<p>- Undo&#x2F;redo support using SQLite&#x27;s savepoints [1].<p>- JSON data expansion: <a href="https:&#x2F;&#x2F;www.sqltab.com&#x2F;static&#x2F;json_expand.gif" rel="nofollow">https:&#x2F;&#x2F;www.sqltab.com&#x2F;static&#x2F;json_expand.gif</a><p>- The pivot table extension [2] is loaded and available for use. The AI is also aware of it.<p>Privacy &amp; Data:<p>- Databases are stored locally in the browser using OPFS.<p>- Database schema is sent to OpenAI as part of the chat session&#x27;s context window. If the chat session contains results of data querying, then that will also be sent to OpenAI with the next message.<p>Tech stack:<p>- WASM build of SQLite (using a custom fork of the official repo [3]).<p>- React + Mantine for the UI.<p>- esbuild to build the frontend (invoked from Go). So much faster than the alternatives.<p>- Hosted on Cloudflare Pages, deployed via wrangler CLI.<p>- Single API endpoint just to proxy OpenAI calls in order to hide my API key. Hosted on Cloudflare Pages Functions (very practical but only for simple things).<p>Technical notes:<p>- The entire application is a static website except for the OpenAI proxy. Planning to support user-supplied API keys to (optionally) get rid of this.<p>- OPFS storage comes with some limitations (e.g., no incognito mode on mobile, same DB can&#x27;t be opened in multiple tabs).<p>- gpt-4o is used for the LLM. Might switch to gpt-4o-mini to save costs.<p>Why not DuckDB?<p>- I got some out-of-memory errors when expanding JSON data. SQLite worked fine on the same data.<p>- No OPFS support yet. PRs have been pending for a year now.<p>If you want to reset the demo, just delete the IMDB.sqlite database (disk icon in the top-left corner -&gt; &quot;Delete DB&quot;) and load the demo URL again in the browser.<p>Please let me know if you have ideas about how to make this more useful.<p>[1] <a href="https:&#x2F;&#x2F;www.sqlite.org&#x2F;lang_savepoint.html" rel="nofollow">https:&#x2F;&#x2F;www.sqlite.org&#x2F;lang_savepoint.html</a><p>[2] <a href="https:&#x2F;&#x2F;github.com&#x2F;jakethaw&#x2F;pivot_vtab">https:&#x2F;&#x2F;github.com&#x2F;jakethaw&#x2F;pivot_vtab</a><p>[3] <a href="https:&#x2F;&#x2F;sqlite.org&#x2F;wasm&#x2F;doc&#x2F;trunk&#x2F;about.md" rel="nofollow">https:&#x2F;&#x2F;sqlite.org&#x2F;wasm&#x2F;doc&#x2F;trunk&#x2F;about.md</a>

1 comment

qidentity6 months ago
This is pretty interesting!<p>I tried to ask: &quot;Recommend me great sci-fi movies from 2010 to 2024&quot;. It generated a SQL script for me to execute which unfortunately doesn&#x27;t work.
评论 #42190819 未加载