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.

SQLite-HTTP: A SQLite extension for making HTTP requests

65 pointsby b_mc2almost 3 years ago

9 comments

alexgarcia-xyzalmost 3 years ago
Author here, happy to answer questions!<p>Direct link to the project: <a href="https:&#x2F;&#x2F;github.com&#x2F;asg017&#x2F;sqlite-http" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;asg017&#x2F;sqlite-http</a><p>Few other projects of interest:<p>- sqlite-html: <a href="https:&#x2F;&#x2F;github.com&#x2F;asg017&#x2F;sqlite-html" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;asg017&#x2F;sqlite-html</a><p>- sqlite-lines: <a href="https:&#x2F;&#x2F;github.com&#x2F;asg017&#x2F;sqlite-lines" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;asg017&#x2F;sqlite-lines</a><p>- various other extensions: <a href="https:&#x2F;&#x2F;github.com&#x2F;nalgeon&#x2F;sqlean" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;nalgeon&#x2F;sqlean</a><p>And past HN threads:<p>- <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=32335295" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=32335295</a><p>- <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=32288165" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=32288165</a>
xnxalmost 3 years ago
Side note: I love the attention that SQLite is getting now. It&#x27;s so refreshing after the dark ages of misapplied technology: microservices, Docker, NoSQL, and countless front-end frameworks.
emadehsanalmost 3 years ago
On a side note, Observable is stupendous. Interactive Network Graphs, Charts, Maps, Animations. Not sure why we don&#x27;t see it used enough.<p>Mike Bostock himself is constantly adding latest work <a href="https:&#x2F;&#x2F;observablehq.com&#x2F;@mbostock" rel="nofollow">https:&#x2F;&#x2F;observablehq.com&#x2F;@mbostock</a>. Great learning resource.
评论 #32418616 未加载
评论 #32418610 未加载
评论 #32432006 未加载
simonwalmost 3 years ago
I picked up some very neat new SQLite tricks from this post independent of the extension itself (which is very cool) - I didn&#x27;t know about the &quot;define&quot; module which lets you create new table-valued functions that are defined as SQL queries themselves.
1vuio0pswjnm7almost 3 years ago
Would be interesting if this can do HTTP&#x2F;1.1 pipelining. Need to take a closer look.<p>What makes me hesitate to look closer is that I almost always am doing some text processing after the HTTP response and before the SQL commands. Due to resource constraints, I do not want to store HTML cruft.<p>I mostly am doing<p>HTTP response --&gt; text processing --&gt; SQLite3<p>rather than<p>HTTP response --&gt; SQLite3<p>However I also have a need for storing different combinations of HTTP request headers and values in a database. I currently use the UNIX filesystem as a database (one header per file, djb&#x27;s envdir loads the headers into environment from a selected folder), but maybe I could use SQLite3. For unprocessed text, e.g., from pipelined DoH responses, I use tmux buffers as a temporary database. Then do something like<p><pre><code> HTTP responses --&gt; tmux loadb &#x2F;dev&#x2F;stdin tmux saveb -b b1 &#x2F;dev&#x2F;stdout|textprocessingutility --&gt; ip-map.txt (append unique, i.e., &quot;add unique&quot;) </code></pre> The ip-map.txt file gets loaded into memory of a localhost forward proxy.<p>Databases, such as NetBSD&#x27;s db, djb&#x27;s cdb, kdb+, or sqlite3 can help with the &quot;append unique&quot; step if the data gets big.<p>Note: Any JSON I retrieve is &quot;text&quot;, not binary data. Most HTTP responses are HTML, sometimes with embedded JSON. Pipelined DoH is binary but I still use drill to print the packets as text. (When I finally learn ldns I will stop using drill.)
评论 #32418087 未加载
评论 #32418235 未加载
评论 #32502768 未加载
dimglalmost 3 years ago
While this is really cool (and a feat of engineering no less), I&#x27;m always really concerned when someone suggests to make an HTTP call from their database server.<p>Many years ago my boss told me to make a scheduled task in Windows to execute a SQL query to make an HTTP call and I asked him why we couldn&#x27;t just use crontab&#x2F;cURL? His response: &quot;cURL? Like from the 90s?&quot;<p>Anyhow I didn&#x27;t last very long. Got fired shortly thereafter.
评论 #32418586 未加载
评论 #32418747 未加载
hsbauauvhabzbalmost 3 years ago
How to get hacked: 2022 edition.<p>SSRF and lambdas directly in your db engine. What other antipatters could you possibly want?
评论 #32417964 未加载
jayvanguardalmost 3 years ago
Just because you <i>can</i> do it, doesn&#x27;t mean you <i>should</i> do it.
评论 #32420257 未加载
maylialmost 3 years ago
Soon: Sqlite-OS
评论 #32421981 未加载