Hi all,

I am looking for a local database that is easily accessible via the command line.

It can be SQL or non-SQL

Whats my use case? I want to use it kinda like a second brain. A place to save my notes, my todo lists, my book reading lists, links / articles to read later, etc.

I want it to be a good CLI citizen so that I can script its commands to create simpler abstractions, rather than writing out the full queries every time.

Maybe sqlite is what I need, but is that ideal for my use case?

Edit: removed notes, as evidently they aren’t suitable for this and aren’t like the rest.

  • elltee@lemmy.one
    link
    fedilink
    arrow-up
    3
    ·
    4 months ago

    Joplin can do all that and has: Plugin support for nearly anything you want Runs on sqlite if you want to access the data direct Is 100% open source.

  • tmk@social.lugal.io
    link
    fedilink
    arrow-up
    3
    ·
    4 months ago

    @matcha_addict Anything beyond SQLite is too heavy, but if it were me I would use a lightweight wiki like dokuwiki. Having to run SQL to do all these sorts of things sounds like it would just get in the way of both getting and consuming your thoughts.

    • matcha_addict@lemy.lolOP
      link
      fedilink
      English
      arrow-up
      1
      arrow-down
      1
      ·
      4 months ago

      I don’t think it would suffice. It would work for notes, but I want to also have a todo list in there, for example. Be able to check things off, query by due date, by assignee or task, etc.

      • subignition@fedia.io
        link
        fedilink
        arrow-up
        3
        ·
        4 months ago

        I don’t think a database is a good fit for your use case at all, unless you’re willing to reinvent a lot of wheels.

        • matcha_addict@lemy.lolOP
          link
          fedilink
          English
          arrow-up
          2
          ·
          4 months ago

          What would then? I haven’t found anything that has command line interface and supports dependent tasks and a flexible, queryable tag system

          • subignition@fedia.io
            link
            fedilink
            arrow-up
            1
            ·
            4 months ago

            I’m sorry, I don’t have a suggestion. If it were me I would not be looking at a CLI solution for this at all.

  • gramgan@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    4 months ago

    Hey!

    I’ve wanted something very similar—specifically, a plain-text database. I recently came across GNU recutils, which I haven’t had time to play around with yet, but which seems like it fits the bill (at least for me). There’s a couple YouTube videos on it—I encourage you to check it out!

  • h0bbl3s@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    4 months ago

    They aren’t exactly CLI but I really like obsidian for taking notes. It’s not open source though. Logseq is good too and is OSS. Both use markdown for formatting so if you are familiar with writing pages on GitHub you’ll have no trouble. Even if not markdown is super easy to learn. That and all of your data stays local and in open formats. I edit my stuff in a terminal anyway.

    Just look up obsidian OSINT on YouTube you’ll find some good stuff on how to use it.

    Another thought is just use markdown files and a directory structure in a private git repo. You’d be able to interact with it locally entirely in the terminal with vim etc and have the option of going online and searching or organizing etc. You could probably even use a cli browser for that part if you wanted.

  • vipaal@aussie.zone
    link
    fedilink
    arrow-up
    1
    ·
    4 months ago

    Tangential answer. Consider looking into Prolog, Picat, Mercury languages. You can effectively let the database design be taken care of by the language. In return you get more time to reflect on your knowledge base and ask it all sorts of questions and get a range of possible answers.

    Org-roam and its web cousin webnotes both have solved designing the database for note taking purpose using g sqlite as a back end. Good options.

  • cy_narrator@discuss.tchncs.de
    link
    fedilink
    arrow-up
    0
    ·
    4 months ago

    Using a database for notes is like going 2km in a plane.

    You can use any relational database for this though but why would you subject yourself to this?

      • cy_narrator@discuss.tchncs.de
        link
        fedilink
        arrow-up
        1
        ·
        2 months ago

        If you are generally interested in designing databases its a good exercise to try and build one yourself. That is the only situation I recommend you go this route