sqldown

Convert Markdown files with YAML frontmatter into a SQLite database and reconstruct them.

5|1|Updated Nov 13, 2025
One-click install
npx skills add https://github.com/mbailey/sqldown --skill sqldown
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sqldown
Source: https://github.com/mbailey/sqldown/tree/main
Command: npx skills add https://github.com/mbailey/sqldown --skill sqldown

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

SQLDown solves the challenge of querying and transforming large collections of Markdown documents by converting YAML frontmatter and H2 sections into a dynamic SQLite schema, while preserving the original content for round-tripping back to Markdown.

Core Features & Use Cases

  • Import: Load Markdown files into SQLite with a dynamic schema based on frontmatter and sections.
  • Query: Use standard SQL via sqlite3 to filter, join, and aggregate across documents.
  • Dump: Reconstruct Markdown files from database rows, preserving paths and frontmatter for a lossless round-trip.

Quick Start

Run the following commands to import, query, and export:

  • Import: sqldown load PATH
  • Query: sqlite3 sqldown.db "SELECT * FROM docs LIMIT 5"
  • Dump: sqldown dump -d sqldown.db -o restored

Frequently Asked Questions about sqldown

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query a large collection of Markdown files with SQL?

You can query large Markdown collections by converting YAML frontmatter and H2 sections into a dynamic SQLite schema. This enables standard SQL filtering, joining, and aggregation across documents without losing the original content.

Can I convert Markdown files to SQLite and back without losing data?

Yes, converting Markdown files to SQLite supports a lossless round-trip dump. The process reconstructs Markdown from database rows while preserving original file paths and YAML frontmatter.

What is the best way to run SQL queries on YAML frontmatter in Markdown documents?

The best way to query YAML frontmatter is importing Markdown into a SQLite database with dynamic schema generation. This maps frontmatter fields to columns, allowing direct SQL queries for filtering and reporting.

Does SQLite have a column limit when importing Markdown sections?

Yes, SQLite has column limits. The import process handles this by using top-N section extraction, ensuring the dynamic schema respects SQLite constraints while capturing the most relevant Markdown sections.

How do I import Markdown files into a SQLite database while ignoring unwanted files?

You can import Markdown files into SQLite using a Gitignore-aware import process. This respects Gitignore rules to keep your workspace clean by automatically excluding ignored files from the database.

How do I export SQLite database rows back to Markdown files?

You can export SQLite rows back to Markdown by running a dump command on the database. This reconstructs the files into an output directory, preserving the original YAML frontmatter and file paths.