db
1<?php
2
3namespace Upside\Db\SQL;
4
5use Upside\Db\Connection;
6
7class Insert extends InsertStatement
8{
9protected Connection $connection;
10
11public function __construct(Connection $connection, ?SQLStatement $statement = null)
12{
13parent::__construct($statement);
14
15$this->connection = $connection;
16}
17
18public function into(string $table): bool
19{
20parent::into($table);
21
22$compiler = $this->connection->get_compiler();
23
24return $this->connection->command($compiler->insert($this->sql), $compiler->get_params());
25}
26}
27