Shit That Will Break (And How to Fix It)

Q

Database file corrupted after testing MVCC?

A

Run PRAGMA integrity_check first.

Current version's MVCC is basically experimental

  • I've corrupted three test databases just running normal transactions. Fix: Restore from backup and stick to regular WAL mode until they fix this mess.
Q

Getting "database is locked" after ROLLBACK?

A

Known issue #3064

  • MVCC doesn't release locks after rollbacks.

Genius design. Fix: Kill the connection and start fresh. Don't reuse connections after they fuck up.

Q

DELETE statements not actually deleting rows?

A

Issue #3062

  • DELETE just... doesn't work in MVCC mode.

Rows stay there like ghosts. Fix: Skip MVCC entirely or double-check your deletes actually worked with SELECT COUNT(*).

Q

Panic on index seeks with MVCC enabled?

A

Issue #3052

  • Indexes crash when using BEGIN CONCURRENT.

Apparently that combination wasn't tested. Fix: Turn off indexes or avoid concurrent stuff until they patch this.

Q

Installation failing with "segmentation fault" on M1 Macs?

A

They fucked up the x64 build for Apple Silicon. Download the ARM version or spend your evening debugging why a database installer segfaults. curl -L https://github.com/tursodatabase/turso/releases/latest/download/turso_cli-aarch64-apple-darwin.tar.xz

Q

Connection randomly disconnects in Node.js apps?

A

JavaScript bindings leak memory under load. I hit this after like 50 concurrent queries. Fix: Add retry logic and don't go over 10 concurrent connections or it'll crash.

Testing Alpha Software Without Going Insane

The Reality of Alpha Database Testing

I've been debugging Turso since they dropped the alpha announcement, and honestly? It's like testing someone's weekend project that accidentally became a startup. Here's what actually works with a database that changes every damn day.

Version Reality Check: Whatever's on their GitHub releases page changes daily. The MVCC stuff is experimental - and by experimental, I mean "guaranteed to corrupt your test data."

Survival Testing Strategy

Start with File Compatibility: Your SQLite files might work. I tried importing a 2GB database from prod and basic stuff worked, but foreign keys were fucked. Always run this first:

PRAGMA foreign_keys=OFF;
PRAGMA integrity_check;

Test One Thing at a Time: Don't be like me and test everything at once. Issue #3065 ate three days because I was testing concurrent writes AND schema changes. Test separately:

  1. Basic CRUD operations (works fine)
  2. Indexes (work until they don't)
  3. MVCC transactions (don't bother)
  4. Vector search (worked when I tested it)
  5. WebAssembly (somehow works better than native)

Connection Management is a Nightmare

Connection handling is where this thing really shines - and by shines, I mean explodes in creative ways. SQLite connections are boring and predictable. Turso connections fail at random times for mysterious reasons.

Connection Retry Pattern That Actually Works:

async fn connect_with_retry(path: &str, max_attempts: u32) -> Result<Connection> {
    let mut attempts = 0;
    loop {
        match turso::connect(path).await {
            Ok(conn) => return Ok(conn),
            Err(e) if attempts < max_attempts => {
                attempts += 1;
                tokio::time::sleep(Duration::from_millis(100 * attempts as u64)).await;
            }
            Err(e) => return Err(e),
        }
    }
}

Why This Matters: The JavaScript bindings crash if you look at them wrong and the Go driver has sync issues. Connection pooling saves your sanity.

MVCC Testing (Don't Bother Yet)

The whole point is concurrent writes, but it's broken. I tried 10 concurrent connections and hit every bug imaginable:

Real Talk: Skip MVCC unless you're testing it specifically. Use WAL mode like a normal person:

PRAGMA journal_mode=WAL;  -- Not PRAGMA journal_mode=MVCC

Performance Testing (When It Works)

The async I/O improvements are legit. I hammered a test app with 1000 SELECT statements:

  • SQLite: Everything blocked for a few seconds
  • Turso: Handled it fine, sub-50ms responses

But performance is random as hell. Simple SELECTs fly, complex JOINs sometimes crawl slower than SQLite for no apparent reason.

Don't Assume Anything: I wasted two weeks optimizing queries that were already fast, while ignoring actual bottlenecks in schema operations. Test everything - what worked fine in v0.1.3 crashed in v0.1.4, and now in v0.1.5 it just returns wrong data.

Data Integrity (It Will Get Corrupted)

Alpha databases eat data. This isn't paranoia, it's guaranteed.

Backup Everything, All the Time:

## Before any testing session
cp production.db backup-$(date +%Y%m%d-%H%M%S).db

## After any schema changes
turso-cli .dump | gzip > backup-schema-$(date +%Y%m%d).sql.gz

Check Integrity Obsessively: Run PRAGMA integrity_check after anything risky. I've caught database corruption three times this way before it spread and fucked everything.

The 3AM Debugging Toolkit

When shit breaks at 3AM (and it will), here's your diagnostic toolkit:

1. Connection State Check:

lsof -p $(pgrep turso) | grep db  # See open file handles

2. WAL File Inspection:

file database.db-wal  # Should show SQLite WAL file
wc -c database.db-wal # WAL size - over 100MB means checkpoint issues

3. Process Memory Check:

ps aux | grep turso  # Memory usage - over 2GB means memory leaks

4. Error Log Parsing:

grep -E "(panic|SIGABRT|corruption)" /var/log/turso.log

Timeline Reality (It Takes Forever)

Plan for this taking forever. I scheduled two weeks for testing and it took six fucking weeks. Alpha software breaks in ways that violate the laws of physics.

Week 1-2: Basic stuff works, you think you're smart
Week 3-4: Weird crashes appear, you question your sanity
Week 5-6: Deep debugging hell, filing GitHub issues, considering other careers

The Discord community is actually decent for debugging. Maintainers respond fast if you include crash logs and don't just say "it doesn't work."

Platform & Binding Specific Issues

Q

Why do I get "GLIBC_2.29 not found" on Ubuntu 18.04?

A

Turso requires glibc 2.29+.

Ubuntu 18.04 ships with 2.27. Fix: Upgrade to Ubuntu 20.04 or compile from source.

The Docker approach works too.

Q

JavaScript binding throws "ConnectionError" exceptions randomly?

A

Memory management bug in the WASM layer. Happens under load with 50+ concurrent queries. Fix: Add retry logic and limit concurrency:javascriptconst pool = new Pool({ max: 10 }); // Don't exceed 10 connections

Q

Go driver panics with "database is locked" in production?

A

Known issue with the sync implementation. Fix: Use the async API and add retry logic. The blocking API has race conditions.

Q

Python asyncio hangs on `await` forever?

A

The Python binding doesn't properly handle connection timeouts. Fix: Wrap database calls with asyncio.wait_for():pythonresult = await asyncio.wait_for(db.execute(query), timeout=30.0)

Q

Windows build crashes with "access violation"?

A

Windows support is experimental. The io_uring optimizations don't work on Windows. Fix: Use WSL2 or test on Linux. Native Windows support is planned for 0.2.0.

Q

Docker container exits with code 137 (OOMKilled)?

A

Turso's memory usage spikes during schema operations. A database with 500 tables can use 4GB+ during migration. Fix: Increase Docker memory limits or split large schemas.

Q

Java JDBC driver gives "ClassNotFoundException"?

A

The JAR isn't published to Maven Central yet. Fix: Download directly from GitHub releases or build from source.

Q

Vector search returns empty results on valid embeddings?

A

The vector indexing is experimental and sometimes fails silently. Fix: Check index creation with SELECT * FROM vector_index_stats() or fall back to brute force search.

Q

WebAssembly version crashes in Safari?

A

WASM memory allocation bug on WebKit. Works fine in Chrome/Firefox. Fix: Add browser detection and fallback to regular SQLite for Safari users.

Q

CLI installation fails with "permission denied"?

A

The install script doesn't handle sudo properly. Fix: Download the binary manually:bashcurl -L https://github.com/tursodatabase/turso/releases/download/v0.1.5/turso_cli-x86_64-unknown-linux-gnu.tar.xz | tar -xJsudo mv turso /usr/local/bin/

Q

Getting "invalid token" errors with Turso Cloud?

A

Token expiration isn't handled gracefully in the CLI. Fix: Run turso auth login again or check token validity with turso auth whoami.

Q

Database file grows to multiple GB during testing?

A

WAL checkpointing isn't aggressive enough in alpha versions. Fix: Manual checkpoint after bulk operations:sqlPRAGMA wal_checkpoint(FULL);

Testing Approach Comparison

Testing Strategy

Risk Level

Time Investment

Data Safety

Best For

Production Clone Testing

Low

2-3 weeks

High (full backups)

Evaluating migration feasibility. Copy production database and test all operations.

Feature-by-Feature Testing

Medium

4-6 weeks

Medium (isolated features)

Understanding what works reliably. Test one Turso feature at a time against known SQLite behavior.

Load Testing Alpha

High

1-2 weeks

Low (expect corruption)

Finding breaking points. Use synthetic data and push concurrent connections to the limit.

Compatibility Testing

Low

3-4 days

High (read-only mostly)

Validating existing applications. Run existing SQLite queries against Turso without modifications.

MVCC Stress Testing

Very High

Ongoing

Very Low (experimental)

Contributing to development. Test concurrent writes with disposable data and file detailed bug reports.