Comment by throw10920

8 days ago

> What is sad is that they used to be local files first note app and then they moved to sqlite citing some sync and performance issues.

They're still a local-first note application. It's just slightly harder for you to edit your notes externally, and not even by that much - it's very easy to directly query (read and write) SQLite databases, and if you really cared you could have made a script to grab a note, export it to a temporary text file, allow you to edit it, then update the SQLite database.

> I can't version controlled backup and sync those files

You absolutely can - you can dump SQLite databases to text files that contain SQL queries that will restore the database that you can then backup and sync: https://stackoverflow.com/questions/75675/how-to-dump-the-da...

> then they moved to sqlite citing some sync and performance issues

Yes, that's because "plain text" files are bad for performance and harder to sync correctly. For people who (1) have over a hundred thousand notes they want to keep (like me) and (2) want maximum confidence that they're not going to lose years worth of work, that's incredibly important.

The devs made the right choice. You can always write scripts to interface with a SQLite database with an external editor. You can't take plain text files and magically make them as fast and durable as a database.

>and if you really cared you could have made a script to grab a note, export it to a temporary text file, allow you to edit it, then update the SQLite database.

Bear devs advise against doing that: "Generally speaking, it is safe to access the database for reading only"

https://bear.app/faq/where-are-bears-notes-located/

  • Thank you for the correction! I was not aware of this.

    It's still worth pointing out that this design decision is orthogonal to the decision to use SQLite, though. The Bear devs could have designed it such that you could write to the database directly, or they could have kept the text-file-based design, but still told the user that they can't modify the files directly (as one of my personal projects does). The assignment of blame to SQLite specifically is misguided.

    • You are right that storing notes as individual text files in the file system doesn't guarantee safe read-write access. But I don't agree that these design decisions are orthogonal.

      How would you design a system that uses SQLite as primary storage for notes (rather than just as a search index or metadata store) while still letting people edit those notes in any text editor, sync via any cloud and make them accessible to any AI or other third party software that knows how to use a file system?

      Exporting and re-importing every single time you want to edit a note is impractical for tech folks and impossible for regular users.

      I can imagine a partial solution using FUSE, FileProvider and whatever the respective file system abstractions are on other platforms. But that would be a huge amount of work.

Goodness! Are you a bear dev by any chance or a dedicated member of its particularly toxic subreddit? Because the tone fits right in.

> It's just slightly harder for you to edit your notes externally

Yup, just slightly harder! Very slightly. A difference of 3.75 picoseconds. Couldn't agree more.

> it's very easy to directly query

Right!

> and if you really cared..have made a script

And designed a nuclear reactor while I was at it, isn't it?

> The devs made the right choice

Yessss!! Finally.

Ffs!!!

  • > And designed a nuclear reactor while I was at it, isn't it?

    Claude can one shot this.