Skip to content
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.

An Obsidian plugin to upload your notes' metadata to your database.

License

Notifications You must be signed in to change notification settings

clouedoc/postgresql-obsidian

Repository files navigation

Obsidian + PostgreSQL = ❤️

An Obsidian plugin to upload your notes' metadata to your database.

Features

  • send the Dataview annotations of a page to a PostgreSQL database
    • this lets you use SQL queries on your data and integrate it with other tools, such as Grafana

Installation

  1. Get a PostgreSQL database (see section below)
  2. Set your PostgreSQL connection string inside the settings
  3. Open the command panel and type "PostgreSQL" to see the list of available commands

Setting up a PostgreSQL database

I personally prefer to self-host PostgreSQL on an offshore server to protect my privacy. However, do note that it takes a bit more knowledge since if you host on a remote server, you will learn how to enable network encryption (SSL) to prevent unauthorized intermediaries from snooping on your data.

I did not try the managed providers that I listed above, but they are from reputable companies and provide way more storage and compute power than you will ever need to host the data generated by this plugin.

Where is my data stored?

The data produced by postgresql-obsidian is made available to you under the obsidian database schema.

You can use PostgreSQL views to extract and format the information that you need.

Why should I send my data to a PostgreSQL database?

Sending the metadata of your notes to a PostgreSQL database will allow you to explore it with other tools, such as Grafana.

Here is a screenshot of the Grafana dashboard I made to monitor my personal health:

Grafana dashboard of clouedoc's health, made using the data produced by the postgresql-obsidian plugin. It features charts of an ok-ish lifestyle.

Contributing

Contributions are what make the open source community such an amazing place to be, learn, inspire, and create. Any contributions you make are greatly appreciated!

Development

See the developer documentation for more information.

TODO

  • overcomplicated development workflow
  • set PostgreSQL URL in the settings
  • get various information from the current note
    • Dataview data
    • list content
  • commands
    • upload current note
    • bulk upload
    • automatic upload on edit
  • submit to Obsidian plugin registry

Useful links

Attribution

  • Thanks to pg for making it possible to easily connect to a PostgreSQL database from JavaScript.
  • Thanks to the Rush Stack for providing an easy-to-use ESLint configuration.
  • Thanks to the Dataview Plugin for making it easy to access a note's metadata.

License

MIT