DEV Community


Anyone out there wants to make a key-value pair database for shell functions?

Web developer from Venezuela. I like solving problems. Currently trying to improve my communication skills
・1 min read

I don't know if you know this but deno added support for localStorage (details here) and now I want that for regular shell functions/scripts.

Something with this API would be nice.


      creates an empty document/database

      extract the value of an entry.

      show all the entries of a document.

      creates a new entry in the document.

      change the value of an entry.

      deletes an entry from the document.


    All this examples use a document called `bookmark`.

    create a document:
        store bookmark create

    add an entry to a document:
        store bookmark add ddg ""

    extract the value of an entry:
        store bookmark query ddg

    list all entries in a document:
        store bookmark list

    change the value of an entry:
        store bookmark update ddg ""

    delete an entry from a document:
        store bookmark remove ddg
Enter fullscreen mode Exit fullscreen mode

Here is my attempt: store-json.

You get bonus points if you make this in a fancy compiled language that produces binaries for every platform out there.

Discussion (1)

vonheikemen profile image
Heiker Author

Okay, listen, y'all. I did it. Did the fancy compiled language version: store.v. Got some precompiled binaries in the release page for linux and windows (my apologies to macos people, I couldn't cross compile to mac. Maybe later when I find out how to use github actions).

It's written in v. Like 300 lines of code, no external dependencies, using only built-in modules. The language is awesome you should check it out.