<?php

declare(strict_types=1);

namespace App\Framework\Database\Platform;

use App\Framework\Database\Platform\ValueObjects\ColumnDefinition;
use App\Framework\Database\Platform\ValueObjects\TableOptions;

/**
 * Database platform abstraction for SQL dialect differences
 */
interface DatabasePlatform
{
    /**
     * Get the SQL for auto-increment primary key
     */
    public function getAutoIncrementSQL(): string;

    /**
     * Get the SQL data type for a given column type
     */
    public function getColumnTypeSQL(string $type, array $options = []): string;

    /**
     * Get the SQL to create a table
     *
     * @param string $table Table name
     * @param ColumnDefinition[] $columns Array of column definitions
     * @param TableOptions|array $options Table options or legacy array options
     */
    public function getCreateTableSQL(string $table, array $columns, array|TableOptions $options = []): string;

    /**
     * Get the SQL to drop a table
     */
    public function getDropTableSQL(string $table, bool $ifExists = false): string;

    /**
     * Get the SQL to add an index
     */
    public function getCreateIndexSQL(string $table, string $indexName, array $columns, array $options = []): string;

    /**
     * Get the SQL to check if a table exists
     */
    public function getTableExistsSQL(string $table): string;

    /**
     * Get the SQL to list all tables
     */
    public function getListTablesSQL(): string;

    /**
     * Quote an identifier (table or column name)
     */
    public function quoteIdentifier(string $identifier): string;

    /**
     * Get current timestamp expression
     */
    public function getCurrentTimestampSQL(): string;

    /**
     * Get the name of the platform
     */
    public function getName(): string;

    /**
     * Check if the platform supports a feature
     */
    public function supportsFeature(string $feature): bool;

    /**
     * Get SQL for UUID/ULID storage
     */
    public function getBinaryUuidSQL(): string;
}
