/** * Parses COLUMN and other DDL within '(' and ')' in CREATE TABLE * definition. * * @param table table being parsed * @param line line being processed */ private static function parse_column_defs(&$node_schema, &$node_table, $line) { if (strlen($line) > 0) { $matched = false; if (preg_match(self::PATTERN_CONSTRAINT, trim($line), $matches) > 0) { $node_constraint =& dbx::create_table_constraint($node_table, trim($matches[1])); dbx::set_attribute($node_constraint, 'definition', trim($matches[2])); //@TODO: type? $matched = true; } if (!$matched) { if (preg_match(self::PATTERN_COLUMN, $line, $matches) > 0) { $node_column =& dbx::get_table_column($node_table, trim($matches[1]), true); pgsql8_column::parse_definition($node_schema, $node_table, $node_column, trim($matches[2])); $matched = true; } } if (!$matched) { throw new exception("Cannot parse command: " . $line); } } }