I present to you: Obsidian - the Database Management System emulator

Why? (Background/Problem)

I come with a heavy IT background, so I’m used to thinking in data structures, lists and database relationships. I’m consulting for a large IT corporation, and I’m working on the same project for the last five years. I was brought to this project during some dark times in my personal life, and it gave some structure to my life at a time when I essentially had none. And so I have quite gotten used to the information structure that we use at work.
Moreso, I’ve always been lazy on note taking. Had a Microsoft account just for OneNote for the longest time, and had only critically “must-remember” things written down, mostly because neither having just a heap of notes stuffed god-knows-where, nor any of the more advanced systems really “spoke” to me. I have always wanted a nice system that would be fit for me though, a place I can turn to for any piece of information in my life, an all-in-one solution that should not even be perfect, just good enough
I wanted to take notes, I tried keeping a physical journal, I tried having a physical notbook, I tried all kinds of ways to take notes… I was overflowing with information, ideas, thoughts, reflections, tasks, and I needed to have a place to dump it all out, but in a way that makes sense. I was tired of having ten to do lists in my phone todo app, phone calendar, jeans back pocket, notpad behind the calendar on your desk, you know what I’m talking about, you have probably been there… And then there’s visual notes, sketches, paper sketches, digital sketches, and barely any note app supports them on both PC and mobile, and - ugh…

What? (Coming to the idea)

With all this AI marketing, get-the-rich-even-richer-quick, money-making bull*** being stuffed in everyone’s and their dog’s butt, which I’m the total opposite of hyped for, and increasingly growing data security and privacy issues, which I am greatly “hyped” for, I used the past year to gradually drift away from software and services that I use, that are owned by large corporations (yes, the irony here is clear to my face), replacing them with free and libre (where possible) solutions, one by one. Notes was the most difficult one, as nothing truly free offered as nice a solution as OneNote. Eventually I found the combination of Obsidian + Syncthing, and while I still miss some features from OneNote, I settled on “eh, this works… fineenoughI guess…”.
Over the year I came to terms with Obsidian, but, again, just for simple notes and folders. The Obsidian approach that “every note can link to every other note” seemed… unorganized, even chaotic, to me. And even today, for me it seems okay for something like wikipedia or the likes, but not really for note taking. I started to look into ways to bring order and structure to notes and information, which brought me on a journey through heaps of articles and youtube videos about note taking systems, personal knowledge management systems, second brains, mind palaces, zettelkastens… Before this, I had no idea how deep the rabbit hole goes. Eventually I was even more confused than when I started…
I decided to instead look into Markdown and Obsidian features specifically. What I found was a world of possibilities through plugins. As I use Galaxy S Ultra series, with Excalidraw I could finally bring my notes and sketches in one place! Plugins for tracking the last time a note was modified, plugins for kanban boards, calendars, SQL-like queries, and - wait a goddamn minute - I can run Javascript inside Templater???
The gears in my head did a burnout and spun up screeching to 12, and then it hit me like a truck full of bricks - I can pretend that Obsidian is a relational database management tool, and organize my notes in a similar structure and fashion that we use at my job! It’s not going to be perfect, but with careful use, it can be functional - and function more than well enough for personal use!

How? (Making of and inner workings)

So I got to work. I came up with a “database schema” by drawing it up in Excalidraw. I created folders for the “database object definitions”, and put a template in each of the folder. Every “object” has a separate set of frontmatter properties, so in a relational database fashion, I’m keeping them in separate folders. This also makes it easier and more flexible to retrieve the notes by “object type”, with plugins like Dataview and Projects. In each template, I put a Templater call to a *.js file in my Vault, then I created the *.js file itself and started to work on the script by using the plugin UNITADE.md - all inside Obsidian.
I found that I can create UI forms by using the Modal forms plugin, and call them up from Javascript using Templater. Then, using the same script, I can write the input values from the modal form to the note frontmatter. Modal forms also allow to set input fields as required, and allows to input links to other files as input values - this was perfect to emulate “object relationship fields” and link different “objects” together in a "parent-child record fashion. For some field data types, Modal forms do not allow to set the field as required, when creating the form. I found that I can export the form to JSON, modify it to add the required attribute, and import it back into Modal forms - again - all inside Obsidian. Now all I have to do is make sure I can’t modify all or some of the Properties of any note manually - but I would guess that’s not possible.
I tried to get Linter working for auto-updating the note Created and Last modified properties, but the feature seemed buggy, and I felt like it’s too extensive a solution for my use case. Then I found the plugin Update frontmatter modified date, which had the same - what I thought was a - bug, which eventually turned out to be an issue in my date formatting. Oh well. Update frontmatter modified date did not write the Created and Last Modified dates on note creation though, so I settled on using a Templater command for that. After the note is created and is being worked on, Update frontmatter modified date does it’s titular job wonderfully.
Et voilà - with that, I consider my “Obsidian Custom All-encompassing Info System (phase 1)”, complete. By making a new note with the templater command, it gives me a dropdown of the “database object types”. I select one, and the “New Record” modal for that object pops up. I input the name and all required data, click “OK”, and the file is renamed to the provided name, all the frontmatter properties are added to in, and it’s moved to a “database” folder for the corresponding “object”. After that, it’s pure info management by querying the “records” using Dataview, shuffling them around on a kanban board by using Projects, or any other way that you can come up with.
Essentially, it’s Templater’s possibility to run custom Javascript inside Obsidian, and Modal forms’ option to invoke the modals from custom Javascript code, that holds everything together like a glue that fills in the gaps.

Wishlist & next steps

It’s not a perfect (or stable) solution in way, shape or measure, but it is good enough for personal use. I have a lot more ideas to work on to make it even better with time. I found a plugin that allows calling host system shell commands from within Obsidian, which would be enough for me to also use Obisidan as a terminal emulator and, combined with UNITADE, a development environment, but I haven’t tested it yet. Also found an Android app, an Obsidian “helper” that reads your Vault periodically and sends you mobile notifications, which could replace having a mobile calendar app and CalDAV setup, but that I also haven’t yet tried. And a lot more ideas, I have a whole document of them in my “database”. I also have an idea about a financial management “expansion”, but I’m still undecided if it’s worth it, I have a good enough system in place there already. Now, if only there was some way to have a two-way Contacts sync between my phone and a folder in the Vault…

Afterword

This is not a long crying post about missing features that should not even be there. What I’m trying to do here is completely the opposite - this is an open letter, a thank you and a praise to Obsidian’s developers, and at least as much praise to all the amazing plugin developers, that come up with these amazing ideas and put their time, effort, possibly even blood, sweat and tears into them, to bring us this amazing platform - yes, I dare call it not an app anymore, but a platform - free of charge - that, with the proper know-how, you can mold it into whatever in the world works for you. Moreso, before this, I truly believed that there is no system that would be good enough for me, unless I built one myself - from the ground up - which could take months to have some basic functionality without even being usable or looking acceptable… Here, instead, I literally did it in three workday evenings, and that’s with little to none prior knowledge of Obsidian, it’s features, plugins, templates, the API, or Javascript syntax. And the fact that you can do it all, and SO much more, without ever leaving Obsidian for anything other than opening a web browser to look up the necessary info, is nothing short of miraculous to me after the heaps of feature-packed, but barely functional, note-taking solutions that I have seen before I found Obsidian…
My hat’s off to all of you!

P.S.

If you are interested in my setup, and maybe wish to make something similar for yourself, I can share the Javascript code and any information and guidelines that I have for my setup, but be warned - THERE WILL BE ISSUES and if they happen you are on your own. I WILL NOT BE your mentor and/or user/technical support. This is not something that I wish to support officially or even part-time, just a hobby effort that might come handy also to someone other than me.
Cheers!

2 Likes

Yeah, we need your setup and…whatever you’re having. :slight_smile:

1 Like

I made a copy of the Vault and scraped it for personal data, so I think it should be safe to upload to a file host somewhere. Can I post a Google Drive or similar URL here?
I restructured my notes for this project as I would do it now with this structure. Left the notes in the Vault, so all the implementation, documentation, guides, instructions, everything is there, also a little bit of other sample data, so it’s ready for exploration.
I did not include my kanban boards and data views (other than simple related lists on the object record templates), as those are highly subjective IMO.

Usually people put demo vaults on GitHub:

1 Like

Okay, here goes. I have very minimal experience with Github (very untypical for a 10+ years IT human, I know), so I hope this does not go horribly wrong.

https://github.com/NexusBeegone/obsidian-dbms-emulator

As there are currently no specific data views in the Vault, I would start by exploring the Subject “records”. :slight_smile:
Keep in mind that everything there is a work in progress, and nothing is even remotely stable. Or, as they say, “nothing is true, everything is permitted”. :face_in_clouds:

1 Like