Skip to content

Commit

Permalink
[apache#1339] feat(table): Add index for tables.
Browse files Browse the repository at this point in the history
  • Loading branch information
Clearvive authored and Clearvive committed Jan 22, 2024
1 parent ae172e7 commit 86a3aea
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,22 @@ public class Indexes {

public static final Index[] EMPTY_INDEXES = new Index[0];

/**
* Create a unique index on columns. Like unique (a) or unique (a, b), for complex like unique
* @param name The name of the index
* @param fieldNames The field names under the table contained in the index.
* @return
*/
public static Index unique(String name, String[][] fieldNames) {
return of(Index.IndexType.UNIQUE_KEY, name, fieldNames);
}

/**
* Create a primary index on columns. Like primary (a), for complex like primary
* @param name The name of the index
* @param fieldNames The field names under the table contained in the index.
* @return
*/
public static Index primary(String name, String[][] fieldNames) {
return of(Index.IndexType.PRIMARY_KEY, name, fieldNames);
}
Expand Down

0 comments on commit 86a3aea

Please sign in to comment.