@@ -40,15 +40,22 @@ type IndexDescription struct {
4040 IndexColumns []string
4141 DataColumns []string
4242 Status Ydb_Table.TableIndexDescription_Status
43+ Type IndexType
4344}
4445
4546//nolint:unused
4647func (i IndexDescription ) toYDB () * Ydb_Table.TableIndexDescription {
47- return & Ydb_Table.TableIndexDescription {
48+ res := & Ydb_Table.TableIndexDescription {
4849 Name : i .Name ,
4950 IndexColumns : i .IndexColumns ,
5051 Status : i .Status ,
5152 }
53+ if i .Type .Type () == IndexTypeGlobal {
54+ res .Type = & Ydb_Table.TableIndexDescription_GlobalIndex {}
55+ } else {
56+ res .Type = & Ydb_Table.TableIndexDescription_GlobalAsyncIndex {}
57+ }
58+ return res
5259}
5360
5461type Description struct {
@@ -270,8 +277,16 @@ func NewPartitioningSettings(ps *Ydb_Table.PartitioningSettings) PartitioningSet
270277 }
271278}
272279
280+ type IndexTypeValue uint8
281+
282+ const (
283+ IndexTypeGlobal IndexTypeValue = iota
284+ IndexTypeGlobalAsync
285+ )
286+
273287type IndexType interface {
274288 setup (* indexDesc )
289+ Type () IndexTypeValue
275290}
276291
277292type globalIndex struct {}
@@ -286,6 +301,10 @@ func (globalIndex) setup(d *indexDesc) {
286301 }
287302}
288303
304+ func (globalIndex ) Type () IndexTypeValue {
305+ return IndexTypeGlobal
306+ }
307+
289308type globalAsyncIndex struct {}
290309
291310func GlobalAsyncIndex () IndexType {
@@ -298,6 +317,10 @@ func (globalAsyncIndex) setup(d *indexDesc) {
298317 }
299318}
300319
320+ func (globalAsyncIndex ) Type () IndexTypeValue {
321+ return IndexTypeGlobalAsync
322+ }
323+
301324type PartitioningMode byte
302325
303326const (
0 commit comments