private DropUserDataType parseDropUserDataType() { boolean ifExists = readIfExists(false); DropUserDataType command = new DropUserDataType(session); command.setTypeName(readUniqueIdentifier()); ifExists = readIfExists(ifExists); command.setIfExists(ifExists); return command; }
private DropAggregate parseDropAggregate() { boolean ifExists = readIfExists(false); DropAggregate command = new DropAggregate(session); command.setName(readUniqueIdentifier()); ifExists = readIfExists(ifExists); command.setIfExists(ifExists); return command; }
private AlterView parseAlterView() { AlterView command = new AlterView(session); boolean ifExists = readIfExists(false); command.setIfExists(ifExists); String viewName = readIdentifierWithSchema(); Table tableView = getSchema().findTableOrView(session, viewName); if (!(tableView instanceof TableView) && !ifExists) { throw DbException.get(ErrorCode.VIEW_NOT_FOUND_1, viewName); } TableView view = (TableView) tableView; command.setView(view); read("RECOMPILE"); return command; }
private Prepared parseDrop() { if (readIf("TABLE")) { boolean ifExists = readIfExists(false); String tableName = readIdentifierWithSchema(); DropTable command = new DropTable(session, getSchema()); ifExists = readIfExists(ifExists); command.setIfExists(ifExists); if (readIf("CASCADE")) { boolean ifExists = readIfExists(false); String indexName = readIdentifierWithSchema(); DropIndex command = new DropIndex(session, getSchema()); command.setIndexName(indexName); ifExists = readIfExists(ifExists); command.setIfExists(ifExists); boolean ifExists = readIfExists(false); DropUser command = new DropUser(session); command.setUserName(readUniqueIdentifier()); ifExists = readIfExists(ifExists); readIf("CASCADE"); command.setIfExists(ifExists); return command; } else if (readIf("SEQUENCE")) { boolean ifExists = readIfExists(false); String sequenceName = readIdentifierWithSchema(); DropSequence command = new DropSequence(session, getSchema()); command.setSequenceName(sequenceName); ifExists = readIfExists(ifExists);
private AlterIndexRename parseAlterIndex() { boolean ifExists = readIfExists(false); String indexName = readIdentifierWithSchema(); Schema old = getSchema(); AlterIndexRename command = new AlterIndexRename(session); command.setOldSchema(old); command.setOldName(indexName); command.setIfExists(ifExists); read("RENAME"); read("TO"); String newName = readIdentifierWithSchema(old.getName()); checkSchema(old); command.setNewName(newName); return command; }
private Prepared parseAlterSchema() { boolean ifExists = readIfExists(false); String schemaName = readIdentifierWithSchema(); Schema old = getSchema(); read("RENAME"); read("TO"); String newName = readIdentifierWithSchema(old.getName()); Schema schema = findSchema(schemaName); if (schema == null) { if (ifExists) { return new NoOperation(session); } throw DbException.get(ErrorCode.SCHEMA_NOT_FOUND_1, schemaName); } AlterSchemaRename command = new AlterSchemaRename(session); command.setOldSchema(schema); checkSchema(old); command.setNewName(newName); return command; }
private AlterSequence parseAlterSequence() { boolean ifExists = readIfExists(false); String sequenceName = readIdentifierWithSchema(); AlterSequence command = new AlterSequence(session, getSchema());
private Prepared parseAlterTable() { boolean ifTableExists = readIfExists(false); String tableName = readIdentifierWithSchema(); Schema schema = getSchema(); boolean ifExists = readIfExists(false); String constraintName = readIdentifierWithSchema(schema.getName()); ifExists = readIfExists(ifExists); checkSchema(schema); AlterTableDropConstraint command = new AlterTableDropConstraint( } else { readIf("COLUMN"); boolean ifExists = readIfExists(false); ArrayList<Column> columnsToRemove = New.arrayList(); Table table = tableIfTableExists(schema, tableName, ifTableExists);
DropUserDataType parseDropUserDataType() throws SQLException { boolean ifExists = readIfExists(false); DropUserDataType command = new DropUserDataType(session); command.setTypeName(readUniqueIdentifier()); ifExists = readIfExists(ifExists); command.setIfExists(ifExists); return command; }
private DropUserDataType parseDropUserDataType() { boolean ifExists = readIfExists(false); DropUserDataType command = new DropUserDataType(session); command.setTypeName(readUniqueIdentifier()); ifExists = readIfExists(ifExists); command.setIfExists(ifExists); return command; }
private DropUserDataType parseDropUserDataType() { boolean ifExists = readIfExists(false); DropUserDataType command = new DropUserDataType(session); command.setTypeName(readUniqueIdentifier()); ifExists = readIfExists(ifExists); command.setIfExists(ifExists); return command; }
DropAggregate parseDropAggregate() throws SQLException { boolean ifExists = readIfExists(false); DropAggregate command = new DropAggregate(session); command.setName(readUniqueIdentifier()); ifExists = readIfExists(ifExists); command.setIfExists(ifExists); return command; }
private DropAggregate parseDropAggregate() { boolean ifExists = readIfExists(false); DropAggregate command = new DropAggregate(session); command.setName(readUniqueIdentifier()); ifExists = readIfExists(ifExists); command.setIfExists(ifExists); return command; }
private DropAggregate parseDropAggregate() { boolean ifExists = readIfExists(false); DropAggregate command = new DropAggregate(session); command.setName(readUniqueIdentifier()); ifExists = readIfExists(ifExists); command.setIfExists(ifExists); return command; }
private AlterView parseAlterView() { AlterView command = new AlterView(session); boolean ifExists = readIfExists(false); command.setIfExists(ifExists); String viewName = readIdentifierWithSchema(); Table tableView = getSchema().findTableOrView(session, viewName); if (!(tableView instanceof TableView) && !ifExists) { throw DbException.get(ErrorCode.VIEW_NOT_FOUND_1, viewName); } TableView view = (TableView) tableView; command.setView(view); read("RECOMPILE"); return command; }
private AlterView parseAlterView() { AlterView command = new AlterView(session); boolean ifExists = readIfExists(false); command.setIfExists(ifExists); String viewName = readIdentifierWithSchema(); Table tableView = getSchema().findTableOrView(session, viewName); if (!(tableView instanceof TableView) && !ifExists) { throw DbException.get(ErrorCode.VIEW_NOT_FOUND_1, viewName); } TableView view = (TableView) tableView; command.setView(view); read("RECOMPILE"); return command; }
private AlterIndexRename parseAlterIndex() { boolean ifExists = readIfExists(false); String indexName = readIdentifierWithSchema(); Schema old = getSchema(); AlterIndexRename command = new AlterIndexRename(session); command.setOldSchema(old); command.setOldName(indexName); command.setIfExists(ifExists); read("RENAME"); read("TO"); String newName = readIdentifierWithSchema(old.getName()); checkSchema(old); command.setNewName(newName); return command; }
private AlterIndexRename parseAlterIndex() { boolean ifExists = readIfExists(false); String indexName = readIdentifierWithSchema(); Schema old = getSchema(); AlterIndexRename command = new AlterIndexRename(session); command.setOldSchema(old); command.setOldName(indexName); command.setIfExists(ifExists); read("RENAME"); read("TO"); String newName = readIdentifierWithSchema(old.getName()); checkSchema(old); command.setNewName(newName); return command; }
private Prepared parseAlterSchema() { boolean ifExists = readIfExists(false); String schemaName = readIdentifierWithSchema(); Schema old = getSchema(); read("RENAME"); read("TO"); String newName = readIdentifierWithSchema(old.getName()); Schema schema = findSchema(schemaName); if (schema == null) { if (ifExists) { return new NoOperation(session); } throw DbException.get(ErrorCode.SCHEMA_NOT_FOUND_1, schemaName); } AlterSchemaRename command = new AlterSchemaRename(session); command.setOldSchema(schema); checkSchema(old); command.setNewName(newName); return command; }
private Prepared parseAlterSchema() { boolean ifExists = readIfExists(false); String schemaName = readIdentifierWithSchema(); Schema old = getSchema(); read("RENAME"); read("TO"); String newName = readIdentifierWithSchema(old.getName()); Schema schema = findSchema(schemaName); if (schema == null) { if (ifExists) { return new NoOperation(session); } throw DbException.get(ErrorCode.SCHEMA_NOT_FOUND_1, schemaName); } AlterSchemaRename command = new AlterSchemaRename(session); command.setOldSchema(schema); checkSchema(old); command.setNewName(newName); return command; }