private CreateSynonym parseCreateSynonym(boolean orReplace) { boolean ifNotExists = readIfNotExists(); String name = readIdentifierWithSchema(); Schema synonymSchema = getSchema(); read("FOR"); String tableName = readIdentifierWithSchema(); Schema targetSchema = getSchema(); CreateSynonym command = new CreateSynonym(session, synonymSchema); command.setName(name); command.setSynonymFor(tableName); command.setSynonymForSchema(targetSchema); command.setComment(readCommentIf()); command.setIfNotExists(ifNotExists); command.setOrReplace(orReplace); return command; }
command.setViewName(viewName); command.setIfNotExists(ifNotExists); command.setComment(readCommentIf()); command.setOrReplace(orReplace); command.setForce(force);
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; }
command.setIfNotExists(ifNotExists); command.setTableName(tableName); command.setComment(readCommentIf()); read("("); command.setDriver(readString());
command.setIfNotExists(ifNotExists); command.setTableName(tableName); command.setComment(readCommentIf()); if (readIf("(")) { if (!readIf(")")) {
column.setSelectivity(value); String comment = readCommentIf(); if (comment != null) { column.setComment(comment);
constraintName = readIdentifierWithSchema(schema.getName()); checkSchema(schema); comment = readCommentIf(); allowIndexDefinition = true;
command.setUnique(unique); command.setIndexName(indexName); command.setComment(readCommentIf()); read("("); command.setIndexColumns(parseIndexColumnList());
private CreateView parseCreateView(boolean force) throws SQLException { boolean ifNotExists = readIfNoExists(); String viewName = readIdentifierWithSchema(); CreateView command = new CreateView(session, getSchema()); this.prepared = command; command.setViewName(viewName); command.setIfNotExists(ifNotExists); command.setComment(readCommentIf()); if (readIf("(")) { String[] cols = parseColumnList(); command.setColumnNames(cols); } String select = StringCache.getNew(sqlCommand.substring(parseIndex)); read("AS"); try { Query query = parseSelect(); query.prepare(); command.setSelect(query); } catch (SQLException e) { if (force) { command.setSelectSQL(select); } else { throw e; } } return command; }
command.setViewName(viewName); command.setIfNotExists(ifNotExists); command.setComment(readCommentIf()); command.setOrReplace(orReplace); command.setForce(force);
command.setViewName(viewName); command.setIfNotExists(ifNotExists); command.setComment(readCommentIf()); command.setOrReplace(orReplace); command.setForce(force);
private CreateUser parseCreateUser() throws SQLException { CreateUser command = new CreateUser(session); command.setIfNotExists(readIfNoExists()); 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; }
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; }
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; }
private CreateLinkedTable parseCreateLinkedTable(boolean force) throws SQLException { read("TABLE"); boolean ifNotExists = readIfNoExists(); String tableName = readIdentifierWithSchema(); CreateLinkedTable command = new CreateLinkedTable(session, getSchema()); command.setForce(force); command.setIfNotExists(ifNotExists); command.setTableName(tableName); command.setComment(readCommentIf()); read("("); command.setDriver(readString()); read(","); command.setUrl(readString()); read(","); command.setUser(readString()); read(","); command.setPassword(readString()); read(","); command.setOriginalTable(readString()); read(")"); if (readIf("EMIT")) { read("UPDATES"); command.setEmitUpdates(true); } return command; }
command.setIfNotExists(ifNotExists); command.setTableName(tableName); command.setComment(readCommentIf()); read("("); command.setDriver(readString());
command.setIfNotExists(ifNotExists); command.setTableName(tableName); command.setComment(readCommentIf()); read("("); command.setDriver(readString());
column.setSelectivity(value); column.setComment(readCommentIf()); return column;
command.setIfNotExists(ifNotExists); command.setTableName(tableName); command.setComment(readCommentIf()); if (readIf("AS")) { command.setQuery(parseSelect());
constraintName = readIdentifierWithSchema(schema.getName()); checkSchema(schema); comment = readCommentIf();