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
| Name | Value | Description |
|---|---|---|
INNER | INNER | Performs an inner join, returning only matching rows from both tables. |
LEFT | LEFT | Performs a left join, returning all rows from the left table and matching rows from the right table. |
RIGHT | RIGHT | Performs a right join, returning all rows from the right table and matching rows from the left table. |
FULL_OUTER | FULL OUTER | Performs a full outer join, returning all rows when there is a match in either table. |
CROSS | CROSS | Performs a cross join, returning the Cartesian product of both tables. |
SELF | SELF | Performs 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: LEFTThis enum helps ensure that only valid SQL join types are used when constructing queries.