$npx skillfedfor your agent

cdc

CDC is Turso's change data capture system that records INSERT, UPDATE, and DELETE operations at the bytecode translation layer. Changes are written to a dedicated CDC table and consumed by the sync engine to replicate local modifications remotely. The system supports two schema versions and operates per-connection via PRAGMA configuration.

CDC tracks database INSERT, UPDATE, and DELETE changes by writing records to a dedicated table, operating at the bytecode generation layer.

AI-generated summary based on this skill's SKILL.md

23,479 1,211 MITupdated by tursodatabase

Decision gist · record as of 2026-07-28

CDC tracks database INSERT, UPDATE, and DELETE changes by writing records to a dedicated table, operating at the bytecode generation layer. CDC is Turso's change data capture system that records INSERT, UPDATE, and DELETE operations at the bytecode translation layer. Changes are written to a dedicated CDC table and consumed by the sync engine to replicate local modifications remotely. The system supports two schema versions and operates per-connection via PRAGMA configuration.

manual: git clone https://github.com/tursodatabase/turso → cp -r turso/.claude/skills/cdc ~/.claude/skills/cdc
.claude/skills/cdc/SKILL.md · version e42792bd

Use it when

  • To enable CDC on a database connection, use PRAGMA cdc = true.
  • CDC integrates with Turso's sync engine by providing a stream of change records that the sync engine consumes to replicate local.

Verify before relying

Read SKILL.md below before installing (1 file). Open directory: indexed for reading, not audited.

Same gist for agents: .md · .json

Install

tursodatabase/turso/cdc · repository language: Rust

Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

What is change data capture and how does CDC table tracking work for INSERT UPDATE DELETE?

CDC (change data capture) is Turso's system that records INSERT, UPDATE, and DELETE operations at the bytecode translation layer. When enabled, cdc writes all row modifications to a dedicated CDC table. The sync engine consumes these records to replicate local changes remotely. Each change includes a transaction ID for grouping related operations and before/after image data for understanding what changed.

How do I enable change data capture on a database connection?

To enable CDC on a database connection, use PRAGMA cdc = true. This activates CDC mode for that connection and begins writing change records to the turso_cdc table. The cdc system operates per-connection, so you must enable it on each connection where you want to capture modifications. Once enabled, all INSERT, UPDATE, and DELETE operations are automatically tracked.

How does the sync engine integrate with CDC to replicate changes?

CDC integrates with Turso's sync engine by providing a stream of change records that the sync engine consumes to replicate local modifications remotely. When you enable CDC on a connection, the system emits CDC instructions at the bytecode level. The sync engine reads these records from the CDC table and uses the transaction ID grouping and before/after images to reconstruct and replay changes on remote replicas.

How do I decode and interpret CDC binary record format?

CDC records contain before/after image binary data that encodes row state changes. The cdc table structure includes change_id, change_time, and change_type fields alongside the binary representations. To interpret these records, you decode the before and after images to understand what values changed. The record format preserves the full row state before and after each modification, allowing you to reconstruct the exact transaction.

What should I know about CDC version detection and backward compatibility?

CDC supports two schema versions (v1 and v2) and includes version detection to maintain backward compatibility. When debugging CDC, check the schema version of your turso_cdc table to ensure compatibility with your sync engine. The cdc system handles version detection automatically, but older v1 tables may require migration or compatibility checks if you're upgrading to v2 features.

How does CDC handle DDL schema changes and transaction grouping?

CDC tracks database row modifications through transaction ID grouping, which associates related changes within a single transaction. While CDC primarily captures DML operations (INSERT, UPDATE, DELETE), the system uses transaction IDs to group these changes together. The cdc autocommit and commit records mark transaction boundaries, allowing the sync engine to replay changes in the correct order and maintain consistency across replicas.

SKILL.md

Rendered from the published skill. Quoted content, verbatim.

CDC (Change Data Capture) - Internal Feature Map

Overview

CDC tracks INSERT/UPDATE/DELETE changes on database tables by writing change records into a dedicated CDC table (turso_cdc by default). It is per-connection, enabled via PRAGMA, and operates at the bytecode generation (translate) layer. The sync engine consumes CDC records to push local changes to the remote.

Architecture Diagram

``` User SQL (INSERT/UPDATE/DELETE/DDL) | v ┌─────────────────────────────────────────────────┐ │ Translate layer (core/translate/) │ │ ┌───────────────────────────────────────────┐ │ │ │ prepare_cdc_if_necessary() │ │ │ │ - checks CaptureDataChangesInfo │ │ │ │ - opens CDC table cursor (OpenWrite) │ │ │ │ - skips if target == CDC table itself │ │ │ └───────────────────────────────────────────┘ │ │ ┌───────────────────────────────────────────┐ │ │ │ emit_cdc_insns() │ │ │ │ - writes (change_id, change_time, │ │ │ │

(truncated - see the full file via the links below)

File tree — 1 file
.claude/skills/cdc/SKILL.md

Let your AI agent find skills like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.

wish › “Understand CDC architecture and how changes are captured at bytecode level”

Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →

Related skills

turso-db
by tursodatabase · tursodatabase/agent-skills

Turso is a Rust-based, in-process SQL database that runs SQLite-compatible queries in Node.js, browsers, React Native, and edge functions. It includes vector similarity search, full-text search powered by Tantivy, change tracking, encryption, and remote sync capabilities. This skill covers SDK setup, CLI usage, and recipes for all supported languages and platforms.

MITupdated Jul 2026
★ 21repo stars
yield-injections
by tursodatabase · tursodatabase/turso

yield-injections provides test-only infrastructure for injecting cooperative yields and synthetic failures into resumable state machines. Use it to test state-machine re-entry safety, interleaving behavior, and abandonment cleanup by marking yield points and controlling when they fire. Includes fixed injectors for unit tests and simulator support for randomized deterministic coverage.

MITfor claude-codeupdated Jul 2026
★ 23,479repo stars
storage-format
by tursodatabase · tursodatabase/turso

This guide breaks down how SQLite organizes data on disk, from the 100-byte header through page types, B-tree layouts, and cell formats. It covers record encoding with serial types, overflow page chains for large payloads, and freelist structures for space reuse. Includes Turso implementation details and debugging commands.

MITfor claude-codeupdated Jul 2026
★ 23,479repo stars
mvcc
by tursodatabase · tursodatabase/turso

This skill documents Turso's experimental Multi-Version Concurrency Control system, which allows readers and writers to operate simultaneously without blocking through row-level snapshot isolation. It covers enabling MVCC via pragma, the versioning model tracking begin/end timestamps, and the architecture built on lock-free data structures. The guide also details checkpointing behavior, current limitations like garbage collection and recovery gaps, and testing patterns for MVCC-enabled code.

MITfor claude-codeupdated Jul 2026
★ 23,479repo stars
debugging
by tursodatabase · tursodatabase/turso

This guide walks through Turso's debugging toolkit for tracking down database problems. Compare bytecode between SQLite and Turso to pinpoint code generation bugs versus VM issues, enable trace logging for core components, run stress tests with ThreadSanitizer to catch threading problems, and use deterministic simulation with seeds to reproduce elusive bugs. Corruption debugging tools help diagnose WAL and integrity failures.

MITfor claude-codeupdated Jul 2026
★ 23,479repo stars
code-quality
by tursodatabase · tursodatabase/turso

code-quality establishes standards for writing reliable database code in Rust, prioritizing data integrity over silent failures. It covers error handling discipline, exhaustive pattern matching, and invariant checking to prevent corruption. The guide emphasizes crashing on invalid state rather than continuing in undefined conditions, and avoiding premature abstractions or workarounds.

MITfor claude-codeupdated Jul 2026
★ 23,479repo stars

More skills transaction-correctness (MIT) · Ship (Apache-2.0)

Tags
audit-loggingtransaction-boundariesschema-evolutionbytecode-emissionbinary-serializationrow-level-trackingsync-replicationversion-detectiondml-instrumentationreplay-mechanism