<?php

declare(strict_types=1);

namespace CalendarPlugin\Contracts;

interface DatabaseAdapterInterface
{
    public function getPrefix(): string;

    public function prepare(string $query, mixed ...$args): string;

    public function query(string $query): int|false;

    public function getResults(string $query): array;

    public function getRow(string $query): ?object;

    public function insert(string $table, array $data, array $formats = []): int|false;

    public function update(string $table, array $data, array $where, array $formats = [], array $whereFormats = []): int|false;

    public function delete(string $table, array $where, array $whereFormats = []): int|false;

    public function insertId(): int;
}
