<?php

namespace Openguru\OpenCartFramework\QueryBuilder\Connections;

interface ConnectionInterface
{
    public function select(string $sql, array $bindings = []): array;

    public function createTableFromSql(string $table, string $sql, array $bindings = []): bool;

    public function insertIntoTableFromSql(string $table, string $sql, array $bindings = []): bool;

    public function dropTable(string $table): bool;

    public function dropTableIfExists(string $table): bool;

    public function tableExists(string $table): bool;

    public function escape($value): string;

    public function statement(string $sql, array $bindings = []): bool;

    public function beginTransaction(): bool;

    public function commitTransaction(): bool;

    public function rollBackTransaction(): bool;

    public function truncateTable(string $table): bool;

    public function lastInsertId($name = null): int;

    public function getVersion(): string;

    public function insert(string $table, array $data): bool;

    public function transaction(callable $callback): void;

    public function getLastError(): ?array;
}
