variable queryBatchPrimary

Run read queries pinned to the primary in a single round-trip.

libsql routes "read"-mode batches to a replica that can lag behind a just-committed write, so a caller that must read its own writes (the migrator verifying DDL it just applied) uses "write" mode, which Turso always serves from the primary. A write-mode transaction may contain only SELECTs — it just guarantees the primary, read-your-writes connection.

Usage

import { queryBatchPrimary } from "doc.ts";