idx := table.NewIndex() idx.AddColumn("id") idx.AddColumn("name") idx.SetName("idx_id_name")
row := []interface{}{1, "John"} pk, err := idx.Create(row, 100)This example creates a new row to insert into the index and calls the Create function on the index to insert the row into the index. It returns the primary key of the newly inserted row and an error if one occurred. Overall, the go github.com.pingcap.tidb.table Index package is a library that can be used in conjunction with the TiDB database to work with indices on tables.