<?php
declare(strict_types=1);

namespace App\Framework\Database;

interface ConnectionInterface
{
    public function execute(string $sql, array $parameters = []): int;

    public function query(string $sql, array $parameters = []): ResultInterface;

    public function queryOne(string $sql, array $parameters = []): ?array;

    public function queryColumn(string $sql, array $parameters = []): array;

    public function queryScalar(string $sql, array $parameters = []): mixed;

    public function beginTransaction(): void;

    public function commit(): void;

    public function rollback(): void;

    public function inTransaction(): bool;

    public function lastInsertId(): string;

    public function getPdo(): \PDO;
}
