Check out https://www.giuspen.net/cherrytree/, lightweight note-taking app with interesting scripting function built in.
Even if that’s not your cup of tea, it has the option to save your notebook to a single sqlite file, so I take that as good enough proof it’ll work for your similar purposes as well.
I know it’s a 45 minute Youtube video, but I love Tom Nicholas and all his stuff is fascinating and worth watching. Check this out as he does a sincere deep dive on it to get an honest answer and it’s pretty enlightening! It’s actually evolved even in the short time since its inception on the internet.
https://www.youtube.com/watch?v=CmzyGNXxwdo