WIP on docs and added basic enums supports
This commit is contained in:
1 parent
497fe5547b
commit
b6752f4364
22 files changed
+367
-35
No files matched your search
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace Ulmus\Query;
|
||||
|
||||
class Show extends Fragment {
|
||||
|
||||
public int $order = -100;
|
||||
|
||||
const SQL_TOKEN = "SHOW";
|
||||
|
||||
const SQL_TOKEN_FROM = "FROM";
|
||||
|
||||
const SQL_SHOW_DATABASES = "DATABASES";
|
||||
|
||||
const SQL_SHOW_TABLES = "TABLES";
|
||||
|
||||
public string $show;
|
||||
|
||||
public string $from;
|
||||
|
||||
public string $in;
|
||||
|
||||
public function set(string $show, ? string $from = null, ? string $in = null) : self
|
||||
{
|
||||
$this->show = $show;
|
||||
|
||||
if ( $from !== null ) {
|
||||
$this->from = $from;
|
||||
}
|
||||
|
||||
if ( $in !== null ) {
|
||||
$this->in = $in;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function render() : string
|
||||
{
|
||||
return $this->renderSegments([
|
||||
static::SQL_TOKEN, $this->show,
|
||||
] + ( ! empty($this->from) ? [ static::SQL_TOKEN_FROM, $this->from ] : [] ) + ( ! empty($this->in) ? [ static::SQL_TOKEN_IN, $this->in ] : [] ) );
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user