private String readUniqueIdentifier() { return readColumnIdentifier(); }
private String readAliasIdentifier() { return readColumnIdentifier(); }
private String[] parseColumnList() { ArrayList<String> columns = New.arrayList(); do { String columnName = readColumnIdentifier(); columns.add(columnName); } while (readIfMore()); return columns.toArray(new String[columns.size()]); }
private Column parseColumn(Table table) { String id = readColumnIdentifier(); if (database.getSettings().rowId && Column.ROWID.equals(id)) { return table.getRowIdColumn(); } return table.getColumn(id); }
private Column readTableColumn(TableFilter filter) { String tableAlias = null; String columnName = readColumnIdentifier(); if (readIf(".")) { tableAlias = columnName; columnName = readColumnIdentifier(); if (readIf(".")) { String schema = tableAlias; tableAlias = columnName; columnName = readColumnIdentifier(); if (readIf(".")) { schema = tableAlias; tableAlias = columnName; columnName = readColumnIdentifier();
private IndexColumn[] parseIndexColumnList() { ArrayList<IndexColumn> columns = New.arrayList(); do { IndexColumn column = new IndexColumn(); column.columnName = readColumnIdentifier(); columns.add(column); if (readIf("ASC")) { // ignore } else if (readIf("DESC")) { column.sortType = SortOrder.DESCENDING; } if (readIf("NULLS")) { if (readIf("FIRST")) { column.sortType |= SortOrder.NULLS_FIRST; } else { read("LAST"); column.sortType |= SortOrder.NULLS_LAST; } } } while (readIf(",")); read(")"); return columns.toArray(new IndexColumn[columns.size()]); }
command.setIfNotExists(false); do { String columnName = readColumnIdentifier(); Column column = parseColumnForTable(columnName, true); columnsToAdd.add(column); boolean ifNotExists = readIfNotExists(); command.setIfNotExists(ifNotExists); String columnName = readColumnIdentifier(); Column column = parseColumnForTable(columnName, true); columnsToAdd.add(column); if (readIf("BEFORE")) { command.setAddBefore(readColumnIdentifier()); } else if (readIf("AFTER")) { command.setAddAfter(readColumnIdentifier());
return expr; String name = readColumnIdentifier(); Schema s = database.findSchema(objectName); if ((!SysProperties.OLD_STYLE_OUTER_JOIN || s != null) && readIf("(")) { return expr; name = readColumnIdentifier(); if (readIf("(")) { schema = objectName; return expr; name = readColumnIdentifier(); return new ExpressionColumn(database, schema, objectName, name);
private CreateUser parseCreateUser() { CreateUser command = new CreateUser(session); command.setIfNotExists(readIfNotExists()); command.setUserName(readUniqueIdentifier()); command.setComment(readCommentIf()); if (readIf("PASSWORD")) { command.setPassword(readExpression()); } else if (readIf("SALT")) { command.setSalt(readExpression()); read("HASH"); command.setHash(readExpression()); } else if (readIf("IDENTIFIED")) { read("BY"); // uppercase if not quoted command.setPassword(ValueExpression.get(ValueString .get(readColumnIdentifier()))); } else { throw getSyntaxError(); } if (readIf("ADMIN")) { command.setAdmin(true); } return command; }
session, table.getSchema()); command.setType(CommandInterface.ALTER_TABLE_DROP_COLUMN); String columnName = readColumnIdentifier(); command.setTable(table); if (ifExists && !table.doesColumnExist(columnName)) { String columnName = readColumnIdentifier(); Column column = table.getColumn(columnName); String newColumnName = readColumnIdentifier(); String columnName = readColumnIdentifier(); Column column = table.getColumn(columnName); return parseAlterTableAlterColumnType(table, columnName, column); } else if (readIf("ALTER")) { readIf("COLUMN"); String columnName = readColumnIdentifier(); Column column = table.getColumn(columnName); if (readIf("RENAME")) { command.setTable(table); command.setColumn(column); String newName = readColumnIdentifier(); command.setNewColumnName(newName); return command;
command.addConstraintCommand(c); } else { String columnName = readColumnIdentifier(); Column column = parseColumnForTable(columnName, true); if (column.isAutoIncrement() && column.isPrimaryKey()) { String constraintName = null; if (readIf("CONSTRAINT")) { constraintName = readColumnIdentifier(); readColumnIdentifier();