transactional(function ($connection) { * $connection->newQuery()->delete('users')->execute(); * }); * ``` * * @param callable $callback The callback to execute within a transaction. * @return mixed The return value of the callback. * @throws \Exception Will re-throw any exception raised in $callback after * rolling back the transaction. */ public function transactional(callable $callback); /** * Run an operation with constraints disabled. * * Constraints should be re-enabled after the callback succeeds/fails. * * ### Example: * * ``` * $connection->disableConstraints(function ($connection) { * $connection->newQuery()->delete('users')->execute(); * }); * ``` * * @param callable $callback The callback to execute within a transaction. * @return mixed The return value of the callback. * @throws \Exception Will re-throw any exception raised in $callback after * rolling back the transaction. */ public function disableConstraints(callable $callback); /** * Enable/disable query logging * * @param bool $enable Enable/disable query logging * @return $this */ public function enableQueryLogging(bool $enable = true); /** * Disable query logging * * @return $this */ public function disableQueryLogging(); /** * Check if query logging is enabled. * * @return bool */ public function isQueryLoggingEnabled(): bool; }