Hi everyone! ![]()
I’m excited to share a tool I’ve built that bridges the gap between MySQL databases and Obsidian’s new Bases plugin: MySQL to Obsidian Bases.
What it does
This CLI tool transforms MySQL database tables into Obsidian-compatible markdown files with properly typed YAML frontmatter, automatically generating .base files for the Bases core plugin. Each row becomes a note, and your database schema becomes searchable, filterable knowledge in Obsidian.
The Problem it Solves
Many of us have valuable data locked away in databases - customer records, product catalogs, research data, personal collections. Getting this structured data into Obsidian while preserving its relational nature has been challenging. With the new Bases plugin, we can now work with structured data natively in Obsidian, but manually converting database records is tedious and error-prone.
Key Features
-
Direct MySQL Connection: Connect to any MySQL database using standard connection parameters
-
Smart Type Inference: Automatically converts MySQL data types to appropriate Obsidian property types (numbers stay numbers, dates stay dates, booleans become true/false)
-
Batch Export: Export single tables or entire databases at once
-
Bases Integration: Generates
.basefiles with pre-configured Table views filtered to your exported notes -
Clean File Organization: Creates organized folder structures ready to drop into your vault
-
Idempotent Operations: Safe to re-run - overwrites existing files with the same names
Installation
It’s available on PyPI! Install with pipx (recommended) or pip:
pipx install mysql-to-obsidian-bases
Example Usage
Let’s say you have a books database. One command exports everything:
mysql-to-bases \
--host 127.0.0.1 \
--user root \
--password secret \
--database library \
--table books \
--id-column isbn \
--title-column title
This creates a folder structure like:
books-base/
books.base # Bases configuration file
notes/
978-0345391803.md # Each book as a note
978-0553380163.md
...
Each markdown file contains YAML frontmatter with all your columns as properties:
---
isbn: "978-0345391803"
title: "The Hitchhiker's Guide to the Galaxy"
author: "Douglas Adams"
publication_date: 1979-10-12
pages: 224
rating: 5
in_stock: true
---
# The Hitchhiker's Guide to the Galaxy
Real-World Use Cases
I’ve been using this for:
-
CRM Data: Import customer records with proper date handling for last contact, signup dates, etc.
-
Product Catalogs: Convert inventory databases into searchable product notes
-
Research Data: Transform experimental data tables into analyzable Obsidian notes
-
Personal Collections: Books, movies, recipes - anything you’ve tracked in a database
Why This Matters
The Bases plugin has opened up exciting possibilities for structured data in Obsidian. This tool makes it practical to:
-
Migrate existing databases without manual data entry
-
Maintain type safety (numbers remain sortable, dates remain filterable)
-
Create hybrid knowledge systems combining structured data with free-form notes
-
Build personal dashboards and databases within Obsidian
What’s Next
The big news: I’m planning to develop this into a full Obsidian plugin! This would enable:
-
Direct database connections from within Obsidian
-
Live sync capabilities
-
Visual query builders
-
Support for more database systems (PostgreSQL, SQLite, etc.)
-
Incremental updates instead of full exports
Technical Details
-
Written in Python with minimal dependencies
-
Supports all MySQL data types with intelligent type mapping
-
Handles special characters and Unicode properly
-
Open source (Apache 2.0 license)
Links
-
GitHub: astrooom/mysql-to-obsidian-bases
-
PyPI: mysql-to-obsidian-bases
Feedback Welcome!
I’d love to hear your thoughts, use cases, and feature requests! What databases would you like to import into Obsidian? What features would make this more useful for your workflow?
If you’re working with structured data in Obsidian or looking to migrate from traditional databases, give it a try and let me know how it goes!
P.S. - If you find this useful, consider starring the GitHub repo. It really helps with motivation and visibility! ![]()