- WIP on insert/update statement

This commit is contained in:
Dave Mc Nicoll committed 2020-02-05 16:19:57 -05:00
1 parent bad5123447
commit 828daffec8
13 files changed
+311 -36

No files matched your search

+28 -1
View File
@@ -4,6 +4,33 @@ namespace Ulmus\Query;
class Insert extends Fragment {
public bool $ignore = false;
public int $order = -100;
public bool $quick = false;
public bool $ignore = false;
public array $fieldlist = [];
public string $priority;
public string $table;
public ? string $alias = null;
public function render() : string
{
return $this->renderSegments([
'INSERT',
( $this->priority ?? false ),
( $this->ignore ? 'IGNORE' : false ),
'INTO', $this->renderTable(),
"(" . implode(',', $this->fieldlist) . ")",
]);
}
protected function renderTable() : string
{
return $this->table . ( $this->alias ? " {$this->alias}" : "" );
}
}