TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: SQL-powered search query parser with React UI

5 点作者 williamcotton30 天前

1 comment

williamcotton29 天前
I built this library after struggling with search interfaces in several projects. Most existing solutions were either too simple (just basic text matching) or required complex infrastructure like Elasticsearch.<p>This little project offers a middle ground - Elasticsearch-inspired query syntax that outputs to SQL. This means you can add powerful search to your app without changing your database stack.<p>Key features:<p><pre><code> * Multi-pass parser with comprehensive validation * Converts complex queries to SQL (supporting ILIKE, PostgreSQL tsvector, or ParadeDB) * React component with Monaco editor, syntax highlighting, and autocompletion * Full test coverage </code></pre> The parser handles complex expressions like:<p><pre><code> (title:&quot;winter boots&quot; OR category:shoes) AND price:&gt;100 AND date:2024-01..2024-03 </code></pre> ...and generates parameterized SQL ready to use with your ORM or database client.<p>I&#x27;d love feedback on the API design and React component - especially from those who&#x27;ve implemented search in their own applications. What search features do you wish were easier to implement?<p>The demo (in the repo) shows the full functionality. The GitHub README has an animated GIF of the demo app.<p>It&#x27;s built with React + Monaco editor but the core parser has zero dependencies.