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 3.40.0 with WASM Support

76 pointsby conductorover 2 years ago

7 comments

pvgover 2 years ago
Recent threads:<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33628136" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33628136</a><p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33374402" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33374402</a>
simonwover 2 years ago
I&#x27;ve been making a lot of use of SQLite WASM over the past few months.<p>The other day I learned that it&#x27;s built into Observable notebooks now - so if you have a SQLite database file that&#x27;s hosted anywhere online with open CORS headers you can load and query that directly from a notebook.<p>This notebook here uses that trick: <a href="https:&#x2F;&#x2F;observablehq.com&#x2F;@simonw&#x2F;mastodon-users-and-statuses-over-time" rel="nofollow">https:&#x2F;&#x2F;observablehq.com&#x2F;@simonw&#x2F;mastodon-users-and-statuses...</a> - I wrote more about how that all works here: <a href="https:&#x2F;&#x2F;simonwillison.net&#x2F;2022&#x2F;Nov&#x2F;20&#x2F;tracking-mastodon&#x2F;" rel="nofollow">https:&#x2F;&#x2F;simonwillison.net&#x2F;2022&#x2F;Nov&#x2F;20&#x2F;tracking-mastodon&#x2F;</a><p>SQLite compiled to WASM is also bundled with the Python Pyodide WebAssembly system, which is how my <a href="https:&#x2F;&#x2F;lite.datasette.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;lite.datasette.io&#x2F;</a> Datasette Lite application works: <a href="https:&#x2F;&#x2F;simonwillison.net&#x2F;2022&#x2F;May&#x2F;4&#x2F;datasette-lite&#x2F;" rel="nofollow">https:&#x2F;&#x2F;simonwillison.net&#x2F;2022&#x2F;May&#x2F;4&#x2F;datasette-lite&#x2F;</a>
samwillisover 2 years ago
I am so happy to see official support for this, particularly the work they are putting into the persistence options. There is a new browser API called the &quot;Origin-Private FileSystem&quot; that provides a sandboxed, domain specific, block level filesystem. It is exactly this type of use case, a client side database, that it is designed for, and in fact it is essential to make most use cases of client side WASM SQLite useful.<p>Essentially, the OPFS enables true ACID compliance, without it you have to &quot;stop the world&quot; and serialise the SQLite db to a string for saving in IndexedDB.<p>The trifactor of the Origin-Private FileSystem, WASM and SQLite is the missing link to make so many progressive web apps possible.<p>WASM SQLite persistance options: <a href="https:&#x2F;&#x2F;sqlite.org&#x2F;wasm&#x2F;doc&#x2F;trunk&#x2F;persistence.md" rel="nofollow">https:&#x2F;&#x2F;sqlite.org&#x2F;wasm&#x2F;doc&#x2F;trunk&#x2F;persistence.md</a>
评论 #33698759 未加载
评论 #33697382 未加载
didgetmasterover 2 years ago
It has been some time since I last worked extensively with SQLite; but I just started doing some benchmarking on queries against decent sized tables (e.g. a few dozen columns and at least 5M rows) for simple queries like &#x27;SELECT * FROM &lt;table&gt; WHERE &lt;column1&gt; = &#x27;Hello&#x27; AND &lt;column3&gt; &lt; 100;&#x27;.<p>For those who work with it regularly; have you noticed any dramatic changes in query speeds in the past few years&#x2F;versions? I imagine that most improvements to the code have been around new features but there may be some big speed gains in &#x27;bread and butter operations&#x27; like queries or updates, but I am not aware of anything specific.
tiffanyhover 2 years ago
I can only hope that WAL2 and BEGIN CONCURRENT support is coming soon.
评论 #33697792 未加载
jedisct1over 2 years ago
It can be compiled to WASI but there are no instructions on how to use zig cc to do it?
评论 #33698726 未加载
评论 #33697662 未加载
tiffanyhover 2 years ago
Does this make how Cloudflare&#x2F;Fly.io use of SQLite easier now?
评论 #33697066 未加载