-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
100 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpMyAdmin\SqlParser\Statements; | ||
|
||
use PhpMyAdmin\SqlParser\Components\ArrayObj; | ||
use PhpMyAdmin\SqlParser\Components\Condition; | ||
use PhpMyAdmin\SqlParser\Components\Expression; | ||
use PhpMyAdmin\SqlParser\Components\FunctionCall; | ||
use PhpMyAdmin\SqlParser\Components\GroupKeyword; | ||
use PhpMyAdmin\SqlParser\Components\IndexHint; | ||
use PhpMyAdmin\SqlParser\Components\IntoKeyword; | ||
use PhpMyAdmin\SqlParser\Components\JoinKeyword; | ||
use PhpMyAdmin\SqlParser\Components\Limit; | ||
use PhpMyAdmin\SqlParser\Components\OptionsArray; | ||
use PhpMyAdmin\SqlParser\Components\OrderKeyword; | ||
use PhpMyAdmin\SqlParser\Statement; | ||
|
||
/** | ||
* `TABLE` statement. | ||
* | ||
* TABLE table_references | ||
* [ORDER BY {col_name | expr | position} | ||
* [ASC | DESC], ...] | ||
* [LIMIT row_count [OFFSET offset]] | ||
*/ | ||
class TableStatement extends Statement | ||
{ | ||
/** | ||
* The clauses of this statement, in order. | ||
* | ||
* @see Statement::$CLAUSES | ||
* | ||
* @var array<string, array<int, int|string>> | ||
* @psalm-var array<string, array{non-empty-string, (1|2|3)}> | ||
*/ | ||
public static $CLAUSES = [ | ||
'TABLE' => [ | ||
'TABLE', | ||
3, | ||
], | ||
'ORDER BY' => [ | ||
'ORDER BY', | ||
3, | ||
], | ||
'LIMIT' => [ | ||
'LIMIT', | ||
3, | ||
], | ||
'UNION' => [ | ||
'UNION', | ||
1, | ||
], | ||
]; | ||
|
||
/** | ||
* Tables used as sources for this statement. | ||
* | ||
* @var Expression[] | ||
*/ | ||
public $from = []; | ||
|
||
/** | ||
* Specifies the order of the rows in the result set. | ||
* | ||
* @var OrderKeyword[]|null | ||
*/ | ||
public $order; | ||
|
||
/** | ||
* Conditions used for limiting the size of the result set. | ||
* | ||
* @var Limit|null | ||
*/ | ||
public $limit; | ||
|
||
/** | ||
* Unions. | ||
* | ||
* @var TableStatement[] | ||
*/ | ||
public $union = []; | ||
} |