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

+36
View File
@@ -322,6 +322,42 @@ class QueryBuilder
return $this;
}
public function create(array $fieldlist, string $table, ? string $database = null, ? string $schema = null) : self
{
if ( null === $this->getFragment(Query\Create::class) ) {
if ( $schema ) {
$table = "\"$schema\".$table";
}
if ( $database ) {
$table = "\"$database\".$table";
}
$create = new Query\Create();
$this->push($create);
$create->fieldList = $fieldlist;
$create->table = $table;
}
else {
throw new \Exception("A create SQL fragment was already found within the query builder");
}
return $this;
}
public function engine(string $value) : self
{
if ( null === $engine = $this->getFragment(Query\Engine::class) ) {
$engine = new Query\Engine();
$this->push($engine);
}
$engine->engine = $value;
return $this;
}
public function push(Query\Fragment $queryFragment) : self
{