private function runStatement(\Yaoi\Sql\Expression $statement) { $query = $statement->build(); if (!$query) { return; } if ($this->log) { $this->log->push(trim($query, ";\n") . ';'); } if (!$this->dryRun) { $this->table->database()->query($statement); } }
public function extractForeignKeysStatement() { $alterExpression = new SimpleExpression('ALTER TABLE ?' . PHP_EOL, new Symbol($this->after->schemaName)); $alterExpression->bindDatabase($this->database()); $alterExpression->appendExpr(clone $this->addFkExpression); $this->addFkExpression->disable(); return $alterExpression; }
public function extractForeignKeysStatement() { $this->fkLines->disable(); return $this->database()->getUtility()->generateAlterTable(new Table(null, $this->database(), '_any_name'), $this->table)->extractForeignKeysStatement(); }
protected function buildSet(Quoter $quoter) { if ($this->set && !$this->set->isEmpty()) { return ' SET ' . $this->set->build($quoter); } else { return ''; } }