/** * Method to test build(). * * @return void * * @covers Windwalker\Query\Postgresql\PostgresqlQueryBuilder::build */ public function testBuild() { $expected = "FLOWER SAKURA SUNFLOWER OLIVE"; $actual = PostgresqlQueryBuilder::build('FLOWER', 'SAKURA', 'SUNFLOWER', 'OLIVE'); $this->assertEquals(\SqlFormatter::compress($expected), \SqlFormatter::compress($actual)); }
/** * rename * * @param string $newName * @param boolean $returnNew * * @return $this */ public function rename($newName, $returnNew = true) { $this->db->setQuery(PostgresqlQueryBuilder::build('ALTER TABLE', $this->db->quoteName($this->table), 'RENAME TO', $this->db->quoteName($newName))); $this->db->execute(); if ($returnNew) { return $this->db->getTable($newName); } return $this; }