pub async fn begin(client: &mut Client) -> Result<Transaction<'_>, Error>
Expand description
Creates and begins a new transaction.
This function is a wrapper around the tokio-postgres transaction()
method.
It allows starting a new database transaction for performing multiple operations atomically.
§Return Value
Result<Transaction<'_>, Error>
- On success, returns the new transaction; on failure, returns Error
§Example
let transaction = transactional::begin(&mut client).await?;
// Transaction işlemlerini gerçekleştir
transaction.commit().await?;