<?php

namespace Planaday\Database\MySQL\QueryBuilding\SQLOperators;

use Planaday\Database\Abstraction\SQLQuery\QueryBuilding\SQLOperators\SQLExists;
use Planaday\Database\Abstraction\SQLQuery\QueryBuilding\SQLQuery;

class MySQLExists implements SQLExists {
	public function __construct(
		protected SQLQuery $subQuery
	) {}

	function toConditionQuery(): string {
		return 'EXISTS (' . $this->subQuery->toQuery() . ')';
	}
}