use of org.jooq.CreateIndexFinalStep in project jOOQ by jOOQ.
the class ParserImpl method parseCreateIndex.
private static final DDLQuery parseCreateIndex(ParserContext ctx) {
boolean ifNotExists = parseKeywordIf(ctx, "IF NOT EXISTS");
Name indexName = parseIndexName(ctx);
parseKeyword(ctx, "ON");
Table<?> tableName = parseTableName(ctx);
parse(ctx, '(');
Field<?>[] fieldNames = Tools.fieldsByName(parseIdentifiers(ctx));
parse(ctx, ')');
Condition condition = parseKeywordIf(ctx, "WHERE") ? parseCondition(ctx) : null;
CreateIndexStep s1 = ifNotExists ? ctx.dsl.createIndexIfNotExists(indexName) : ctx.dsl.createIndex(indexName);
CreateIndexWhereStep s2 = s1.on(tableName, fieldNames);
CreateIndexFinalStep s3 = condition != null ? s2.where(condition) : s2;
return s3;
}
Aggregations