Skip to content

JoinType Enum

The JoinType enum defines the types of SQL joins that can be used in queries. It provides a structured way to specify join types, ensuring consistency in query building.

Enum Values

NameValueDescription
INNERINNERPerforms an inner join, returning only matching rows from both tables.
LEFTLEFTPerforms a left join, returning all rows from the left table and matching rows from the right table.
RIGHTRIGHTPerforms a right join, returning all rows from the right table and matching rows from the left table.
FULL_OUTERFULL OUTERPerforms a full outer join, returning all rows when there is a match in either table.
CROSSCROSSPerforms a cross join, returning the Cartesian product of both tables.
SELFSELFPerforms a self join, where a table is joined with itself.

Usage Example

php
use Sirmerdas\Sparkle\Enums\JoinType;

$joinType = JoinType::LEFT;
echo $joinType->value; // Outputs: LEFT

This enum helps ensure that only valid SQL join types are used when constructing queries.

Released under the MIT License.