Back to News
Advertisement
Advertisement

⚡ Community Insights

Discussion Sentiment

100% Positive

Analyzed from 244 words in the discussion.

Trending Topics

#sqlite#https#jsonb#data#document#something#download#before#part#project

Discussion (10 Comments)Read Original on HackerNews

tolerance23 minutes ago
simlevesque19 minutes ago
Check the dates, the "before" part is inaccurate.
stanacabout 2 hours ago
I am using SQLite as document db for a side project for years now. Made a custom repository base class that can also store blobs in separate columns, so this type of data is not part of the json document. Today there is also jsonb [1], as far as I remember all functions work the same for json and jsonb.

Also the repo class stores write and delete timestamps as separate columns so I can have CDC. CDC is used for building cached view models and is pushed to object storage every 5 minutes for backup as NDJSON. Another process on home server is restoring the db every couple of minutes for second backup and ready to use DB in case it's needed.

I know there are things like Litestream, I wanted something in process and something that can send alerts on failed backups.

[1] https://sqlite.org/jsonb.html

delducaabout 2 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

nonethewiserabout 1 hour ago
Are you doing this because you also use SQLite for other relational data?
delducaabout 1 hour ago
Possibly yes, otherwise I could use another simple solution
smalltorchabout 1 hour ago
Is this new or something? Works amazing as a document backend.
eventualcompabout 1 hour ago
Almost 6 years old. (2020).
antonvsabout 1 hour 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!)

Groxxabout 1 hour ago
Even easier: click the download link on the website. https://sqlite.org/download.html