debugging

Compare bytecode, logs, and sanitizer outputs to debug Turso databases.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps developers debug Turso databases by comparing bytecode, analyzing logs, and using ThreadSanitizer and deterministic simulation tools to identify root causes of behavior differences and corruption scenarios.

Core Features & Use Cases

  • Bytecode comparison: Detect discrepancies between expected and actual bytecode and pinpoint code-generation or VM issues.
  • Logging & instrumentation: Collect and correlate logs to reproduce failures in tests and production-like runs.
  • ThreadSanitizer & deterministic simulation: Use sanitizers and replay-driven simulations to surface data races and threading bugs.
  • Corruption analysis: Reproduce WAL and data-corruption scenarios with guided references and scripts for analysis.

Quick Start

Run a basic diagnostic by launching the Turso binary with a memory database and a simple query, for example: cargo run --bin tursodb :memory: 'SELECT 1+1;'

Frequently Asked Questions about debugging

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

FAQPage Schema
How do I debug Turso database bytecode discrepancies?

Debug Turso database bytecode discrepancies by comparing expected and actual bytecode using provided scripts to pinpoint code-generation or VM issues. This process directly identifies inconsistencies within development and QA environments.

How does ThreadSanitizer help find data races in Turso databases?

ThreadSanitizer surfaces data races and threading bugs in Turso databases by running sanitizers alongside deterministic simulation tools. This replay-driven simulation exposes concurrency issues during reproduction and analysis.

What is the best way to reproduce WAL corruption scenarios in Turso?

Reproduce WAL and data-corruption scenarios in Turso using guided references and provided scripts for analysis. These tools help investigate corruption by collecting and correlating logs from production-like runs.

Do I need Turso build artifacts to run deterministic simulations?

Yes, you need access to Turso build artifacts and the ability to run with ThreadSanitizer to execute deterministic simulations. These prerequisites are required to reproduce and analyze failures effectively.

How do I run a basic diagnostic for a Turso database?

Run a basic diagnostic by launching the Turso binary with a memory database and a simple query, such as `cargo run --bin tursodb :memory: 'SELECT 1+1;'`. This validates basic execution and instrumentation.

Why do my Turso database logs show inconsistent behavior?

Inconsistent Turso database logs often result from bytecode differences, race conditions, or data corruption. Collect and correlate these logs to reproduce failures in tests and production-like runs for root cause analysis.