Top
Best
New

Posted by lioeters 5 days ago

SQLite as a Document Database (2020)(dgl.cx)
189 points | 47 commentspage 2
Insimwytim 8 hours ago|
If you applying NOT NULL constraint, why not extract it from json altogether as a separate column? What's the use of it in json?

You may construct it back on retrieval, if you need it in results.

delduca 13 hours ago||
In my personal project (a game) I use an indexed key + a JSONB to store the save state, which comes from Lua.

So I can have cassette.propxyz = {1, 2, “abc”, true}

And

local anotherprop = cassette.leprop

nonethewiser 12 hours ago|
Are you doing this because you also use SQLite for other relational data?
delduca 12 hours ago||
Possibly yes, otherwise I could use another simple solution
pmkary 10 hours ago||
I remember this getting to the top of HN for at least two more times.
Jtsummers 10 hours ago|
Just once. But related and similar links show up regularly.
smalltorch 12 hours ago||
Is this new or something? Works amazing as a document backend.
eventualcomp 12 hours ago|
Almost 6 years old. (2020).
alterom 11 hours ago||
A long time ago, I wrote an ORM to serialize/deserialize object data seamlessly into SQLite, with massive arrays of floats being stored as blobs.

In code, I could effectively mark which class members need to be stored/restored, and optionally provide a custom serialization function for them if needed.

The latter was effectively never necessary, because all the bases types and multi-dimensional arrays were handled by templates.

Really wish I open-sourced that thing then, but the corporate bureaucracy around that was tricky.

I remember sufficiently little about implementation details now that I think I can get to writing it again, without producing a copypasta of that code - and maybe I should :)

inigyou 10 hours ago|
Did it end up becoming more painful than just writing the SQL?
antonvs 12 hours ago||
> (Aside: The hard bit may be getting a new enough SQLite, at the time of writing Homebrew on macOS has it, else you likely need to use an unstable source like nixpkgs-unstable.)

Or just download the source and build it! (Gasp!)

bbkane 10 hours ago||
The great thing about using a package manager is that it also handles updating and uninstalling software, not just the initial install
Groxx 12 hours ago||
Even easier: click the download link on the website. https://sqlite.org/download.html
desktopentree 9 hours ago||
[flagged]
sohaibqasem 10 hours ago|
[dead]