This commit is contained in:
Dave Mc Nicoll committed 2020-11-27 12:21:10 -05:00
commit f74d1907d9
21 files changed
+759 -555

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
<?php
namespace Ulmus\Query;
use Ulmus\Annotation,
Ulmus\Common\EntityField;
class Create extends Fragment {
const SQL_TOKEN = "CREATE TABLE";
public string $table;
public string $engine;
public int $order = -80;
public bool $skipExisting = true;
public array $fieldList;
public function render() : string
{
return $this->renderSegments([
static::SQL_TOKEN, $this->renderTables($this->table),
$this->renderFields(),
]);
}
public function renderFields() : string
{
return "(" . PHP_EOL . implode(",".PHP_EOL, array_map(function($field) {
return " ".EntityField::generateCreateColumn($field);
}, $this->fieldList)) . PHP_EOL . ")";
}
}
+19
View File
@@ -0,0 +1,19 @@
<?php
namespace Ulmus\Query;
class Engine extends Fragment {
const SQL_TOKEN = "ENGINE";
public int $order = 80;
public string $engine;
public function render() : string
{
return $this->renderSegments([
static::SQL_TOKEN, $this->engine,
], "=");
}
}