/** * Returns the create SQL query to reproduce the given table. * @param \System\Db\Database The database to query * @param string The name of the table to work with * @return string The create SQL query */ public static function getCreateQuery(\System\Db\Database $db, $tableName) { $query = new \System\Db\Query($db, 'SHOW CREATE TABLE ' . $tableName); $result = $db->querySingle($query); //get the specific key in the result $key = 'Create Table'; return $result->{$key}; }