ulmus/src/Query/Insert.php

34 lines
668 B
PHP

<?php
namespace Ulmus\Query;
class Insert extends Fragment {
const SQL_TOKEN = "INSERT";
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([
static::SQL_TOKEN,
( $this->priority ?? false ),
( $this->ignore ? 'IGNORE' : false ),
'INTO', $this->table,
"(" . implode(',', $this->fieldlist) . ")",
]);
}
}