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.

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

    First, I want to apologize for mentioning notes. Notes should be separate from the rest, and I agree with you on what you said about notes.

    For the rest, I’ve asked before on suggestions for apps to save my todos, links, etc. There were a couple issues

    • I couldn’t find something that gives me the same interface for all of these. They are all lists of things with some attributes and relations, but most apps out there handled each one of these separately and differently

    • they lacked features I wanted. For example, dependent tasks, a flexible tag system I can query by, etc.

    A DB would let me do all of that.

    • pe1uca
      link
      fedilink
      arrow-up
      1
      ·
      5 months ago

      Ah, that makes sense!
      Yes, a DB would let you build this. But the point is in the word “build”, you need to think about what is needed, in which format, how to properly make all the relationships to have data consistency and flexibility, etc.
      For example, you might implement the tags as a text field, then we still have the same issue about addition, removal, and reorder. One fix could be have a many tags to one task table. Then we have the problem of mistyping a tag, you might want to add TODO but you forgot you have it as todo, which might not be a problem if the field is case insensitive, but what about to-do?
      So there are still a lot of stuff you might oversight which will come up to sidetrack you from creating and doing your tasks even if you abstract all of this into a script.

      Specifically for todo list I selfhost https://vikunja.io/
      It has OAS so you can easily generate a library for any language for you to create a CLI.
      Each task has a lot of attributes, including the ones you want: relation between tasks, labels, due date, assignee.

      Maybe you can have a project for your book list, but it might be overkill.

      For links and articles to read I’d say a simple bookmark software could be enough, even the ones in your browser.
      If you want to go a bit beyond that I’m using https://github.com/goniszewski/grimoire
      I like it because it has nested categories plus tags, most other bookmark projects only have simple categories or only tags.
      It also has a basic API but is enough for most use cases.
      Other option could be an RSS reader if you want to get all articles from a site. I’m using https://github.com/FreshRSS/FreshRSS which has the option to retrieve data form sites using XMLPath in case they don’t offer RSS.


      If you still want to go the DB route, then as others have mentioned, since it’ll be local and single user, sqlite is the best option.
      I’d still encourage you to use any existing project, and if it’s open source you can easily contribute the code you’d have done for you to help improve it for the next person with your exact needs.

      (Just paid attention to your username :P
      I also love matcha, not an addict tho haha)