Skip to content

Commit 2d94108

Browse files
committed
restore index constructors
1 parent d622dd5 commit 2d94108

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

table/example_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func Example_createTable() {
8080
),
8181
options.WithIndex("idx_series_title",
8282
options.WithIndexColumns("title"),
83-
options.WithIndexType(options.IndexTypeGlobalAsync),
83+
options.WithIndexType(options.GlobalAsyncIndex()),
8484
),
8585
)
8686
},
@@ -166,7 +166,7 @@ func Example_alterTable() {
166166
options.WithAddIndex("idx_series_series_id",
167167
options.WithIndexColumns("series_id"),
168168
options.WithDataColumns("title"),
169-
options.WithIndexType(options.IndexTypeGlobalAsync),
169+
options.WithIndexType(options.GlobalIndex()),
170170
),
171171
options.WithDropIndex("idx_series_title"),
172172
options.WithAlterAttribute("hello", "world"),

table/options/models.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,14 @@ func (t IndexType) ApplyIndexOption(d *indexDesc) {
289289
}
290290
}
291291

292+
func GlobalIndex() IndexType {
293+
return IndexTypeGlobal
294+
}
295+
296+
func GlobalAsyncIndex() IndexType {
297+
return IndexTypeGlobalAsync
298+
}
299+
292300
type PartitioningMode byte
293301

294302
const (

0 commit comments

Comments
 (0)