Live data from Hacker News

Show HN: NoSQL, but it's SQLite

gist.github.com

41–48 of 48 posts

Re: Show HN: NoSQL, but it's SQLite

#41
post #35

Not a database, just a map of json strings where you can update the json stored at some key. You could write the same interface on top of localStorage.

Yes that is exactly what it is! It's basically a very small upgrade over my favorite database: A JSON-file :)

Literally did something similar just last week, was looking for a good redis gui on windows and couldn't find one that clicked (closest I got was Another Redis Desktop Manager but it sorted my keys like 1, 11, 2 etc) so turned to sqlite and implemented this. Also added a "sync to disk" method so I get both the benefits of ram and persistence, worked out great since the data I'm getting over tcp has a sequence number so in case of any errors I resume from the last sequence number in the db. Thinking of fully committing and moving some stuff from the language like decoding the raw bytes to build a json object to an extension.

Re: Show HN: NoSQL, but it's SQLite

#42
post #34

dang -- why was this flagged? Seems like a perfectly reasonable post.

Users flagged it. We can only guess why users flag things, but there are usually clues in the comments. I've turned the flags off now.

p.s. @dang doesn't work - you have to email hn@ycombinator.com if you want mostly-guaranteed message delivery.

Re: Show HN: NoSQL, but it's SQLite

#44
post #35

Not a database, just a map of json strings where you can update the json stored at some key. You could write the same interface on top of localStorage.

Yes that is exactly what it is! It's basically a very small upgrade over my favorite database: A JSON-file :)

What's it give you above just holding a big object in memory? I guess partial serialization is something, so updates are stored on disk... But then why not just store a json file per key on disk? It's not like the serialized blobs allow you to have indexes or a particularly efficient full text search, so why bother with the SQL statements at all?

Re: Show HN: NoSQL, but it's SQLite

#47
post #46

I've built this (unironically) for Python: https://github.com/senko/dante It combines the convenience of SQLite (nothing to install) with the convenience of just throwing stuff in a dict. Perfect for quick prototypes/mockups.

So it's a lot like the shelve builtin module?

Re: Show HN: NoSQL, but it's SQLite

#48
post #46

I've built this (unironically) for Python: https://github.com/senko/dante It combines the convenience of SQLite (nothing to install) with the convenience of just throwing stuff in a dict. Perfect for quick prototypes/mockups.

So it's a lot like the shelve builtin module?

Like shelve, but with json instead of pickle, and sqlite instead of dbm; and you have a set of dicts instead of k/v store , with helpers to search by any dict field; and also pydantic support.
Post reply on HN