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 86a3aea commit 46e5d97
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class Indexes {

/**
* 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
Expand All @@ -21,6 +22,7 @@ public static Index unique(String name, String[][] 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
Expand All @@ -29,6 +31,12 @@ public static Index primary(String name, String[][] fieldNames) {
return of(Index.IndexType.PRIMARY_KEY, name, fieldNames);
}

/**
* @param indexType The type of the index
* @param name The name of the index
* @param fieldNames The field names under the table contained in the index.
* @return
*/
public static Index of(Index.IndexType indexType, String name, String[][] fieldNames) {
return IndexImpl.builder()
.withIndexType(indexType)
Expand Down

0 comments on commit 46e5d97

Please sign in to comment.