storage-format

Analyze SQLite on-disk format and B-tree structures in Turso databases.

23.8k|1.2k|Updated Aug 26, 2023
One-click install
npx skills add https://github.com/tursodatabase/turso --skill storage-format
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: storage-format
Source: https://github.com/tursodatabase/turso/tree/main/.claude/skills/storage-format
Command: npx skills add https://github.com/tursodatabase/turso --skill storage-format

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a concise guide to the SQLite on-disk format, including pages, cells, overflow, and the freelist, to help engineers understand data layout and storage characteristics.

Core Features & Use Cases

  • On-disk layout: Page structures, header fields, and the relationship between pages and the sqlite_schema.
  • Data representation: How records, payloads, and serial types are stored.
  • Use Cases: Debugging storage issues, capacity planning, and performance tuning of the Turso storage engine.

Quick Start

Use the storage-format skill to interpret a Turso database file's on-disk layout, referencing the header table and page type descriptions to analyze a sample file.

Frequently Asked Questions about storage-format

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

FAQPage Schema
How does the SQLite B-tree page layout organize data on disk?

The SQLite B-tree page layout organizes data using page headers, cells, and record payloads to structure storage on disk. It defines how data pages, payload encoding, and overflow chains are managed for precise storage interpretation.

What is the best way to debug SQLite storage capacity and overflow chains?

Debugging SQLite storage capacity and overflow chains requires analyzing the on-disk format, including page structures and the freelist. This skill interprets header fields, cell formats, and payload encoding to identify storage layout issues and plan capacity.

How do I interpret SQLite file header fields like magic and page size for Turso databases?

Interpreting SQLite file header fields like magic, page size, and encoding involves analyzing the database header table and page type descriptions. This process decodes the on-disk layout to explain storage characteristics and data representation.

Does the SQLite on-disk format use serial types for storing record payloads?

Yes, the SQLite on-disk format uses serial types to define how records and payloads are stored within data pages. Understanding these serial types and cell formats is essential for precise debugging and performance tuning of the storage engine.

When should I analyze the SQLite freelist for database performance tuning?

Analyze the SQLite freelist during performance tuning when debugging storage issues or planning capacity for the Turso storage engine. Understanding the freelist and overflow chains helps identify unused pages and optimize on-disk data layout.