// SPDX-FileCopyrightText: 2026 Andrei G <bug-ops>
// SPDX-License-Identifier: MIT OR Apache-2.0
use crateDbPool;
/// Begin a standard deferred transaction.
///
/// # Errors
///
/// Returns a sqlx error if the transaction cannot be started.
pub async
/// Begin a write-intent transaction.
///
/// `SQLite`: issues `BEGIN IMMEDIATE` to acquire the write lock upfront,
/// preventing `SQLITE_BUSY` errors when another writer is active.
///
/// `PostgreSQL`: issues a standard `BEGIN` (MVCC handles concurrency).
/// Callers that need write-exclusion semantics must use `SELECT ... FOR UPDATE`
/// inside the transaction.
///
/// # Errors
///
/// Returns a sqlx error if the transaction cannot be started.
pub async
pub async