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: JSON1 Extension

311 pointsby ashish01over 8 years ago

15 comments

jzelinskieover 8 years ago
It should be made clear that this functionality is not equivalent to the Postgres JSON support where you can create indexes based on the structure of the JSON. This is an extension to the query language that adds support for encoding&#x2F;decoding within the context of a query:<p><pre><code> SELECT DISTINCT user.name FROM user, json_each(user.phone) WHERE json_each.value LIKE &#x27;704-%&#x27;; </code></pre> It&#x27;s pretty neat considering they rolled it all on their own: <a href="https:&#x2F;&#x2F;www.sqlite.org&#x2F;src&#x2F;artifact&#x2F;552a7d730863419e" rel="nofollow">https:&#x2F;&#x2F;www.sqlite.org&#x2F;src&#x2F;artifact&#x2F;552a7d730863419e</a><p>PS: If you haven&#x27;t looked at the SQLite source before, check out their tests.
评论 #13558292 未加载
评论 #13557369 未加载
评论 #13559875 未加载
评论 #13558441 未加载
评论 #13561657 未加载
评论 #13558264 未加载
Lxrover 8 years ago
Wait, what? Isn&#x27;t storing JSON data as text in a relational DB against all kinds of normalisation rules? Under what circumstances should one do this?
评论 #13558463 未加载
vhost-over 8 years ago
I always seem to be the black sheep in a group of people when I say that I love sqlite. It&#x27;s seriously so handy. If I need to aggregate or parse big CSV sheets, I just toss them in a sqlite database and run actual SQL queries against the data and it makes the process much faster and I can give someone their data in relational form on a thumbdrive or in a tar.gz.
评论 #13557171 未加载
评论 #13557288 未加载
评论 #13558601 未加载
评论 #13557849 未加载
评论 #13557286 未加载
评论 #13557373 未加载
评论 #13557170 未加载
nbevansover 8 years ago
SQLite is a great database for microservices and other minimalist architectures. You&#x27;ll never get a &quot;TCP socket failed&#x2F;timeout&#x2F;reset&quot; from SQLite - that&#x27;s for sure.
thinknliveover 8 years ago
sqlite &#x27;all the things!&#x27;. Seriously. One of the best tools ever. So many data, and related performance challenges, in almost any app can be solved efficiently with this (for what it does) tiny little library.
mablapover 8 years ago
Oooh! I just arrived at work and things are calm, this will be interesting reading! We use sqlite for mostly every tool we develop.
adsharmaover 8 years ago
Not clear if you can compose these functions. Flatbuffers over rocksdb should be considered an alternative. You can then use iterlib to do similar things.<p>Plug: <a href="https:&#x2F;&#x2F;github.com&#x2F;facebookincubator&#x2F;iterlib" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;facebookincubator&#x2F;iterlib</a>
评论 #13561186 未加载
ilitiritover 8 years ago
I use this for a custom JSON query tool and browser I wrote for our company (the C# client can load extensions). It&#x27;s been available for a while. Is this post to spread awareness or have they added something to new to the extension?
giancarlostoroover 8 years ago
This is very interesting, I wonder what drove this extension and how things will shape with SQLite. I always loved that in Python I can &#x27;just use&#x27; SQLite quite easily.
nattaylorover 8 years ago
&gt;Experiments have been unable to find a binary encoding that is significantly smaller or faster than a plain text encoding. (The present implementation parses JSON text at over 300 MB&#x2F;s.)<p>I understand that JSONB in Postgres is useful primarily for sorts and indexes. Does SQLite work around this somehow, or is that just not included in their experiments?
评论 #13557280 未加载
burrowsover 8 years ago
Here are instructions for building the extension as a shared library on OS X <a href="https:&#x2F;&#x2F;burrows.svbtle.com&#x2F;build-sqlite-json1-extension-as-shared-library-on-os-x" rel="nofollow">https:&#x2F;&#x2F;burrows.svbtle.com&#x2F;build-sqlite-json1-extension-as-s...</a>.<p>I wasn&#x27;t able to get a working build on Windows.
评论 #13559916 未加载
评论 #13557135 未加载
tenkenover 8 years ago
Is there a Ubuntu PPA or docker image of SQLite + JSON extension enabled?<p>I can&#x27;t get the compiled json1.so to load on Ubuntu 14.04 lts with stock SQLite.
评论 #13558468 未加载
GrumpyNlover 8 years ago
How does this perform on larger tables?
zxvover 8 years ago
Is there any plan to support jsonb (or similar) which would speed processing by eliminating the need to reparse?
mayliover 8 years ago
The embedded version of mongodb?
评论 #13557175 未加载
评论 #13557080 未加载
评论 #13557176 未加载