@@ -27,42 +27,42 @@ import (
27
27
"vitess.io/vitess/go/vt/vtgate/vindexes"
28
28
)
29
29
30
- var _ semantics.SchemaInformation = (* schemaInfo )(nil )
30
+ var _ semantics.SchemaInformation = (* SchemaInfo )(nil )
31
31
32
32
type (
33
- schemaInfo struct {
34
- ksName string
35
- tables map [string ]columns
33
+ SchemaInfo struct {
34
+ KsName string
35
+ Tables map [string ]Columns
36
36
}
37
37
38
- columns []vindexes.Column
38
+ Columns []vindexes.Column
39
39
)
40
40
41
- func (s * schemaInfo ) handleCreateTable (create * sqlparser.CreateTable ) {
42
- columns := make (columns , 0 , len (create .TableSpec .Columns ))
41
+ func (s * SchemaInfo ) handleCreateTable (create * sqlparser.CreateTable ) {
42
+ columns := make (Columns , 0 , len (create .TableSpec .Columns ))
43
43
for _ , col := range create .TableSpec .Columns {
44
44
columns = append (columns , vindexes.Column {
45
45
Name : col .Name ,
46
46
Type : col .Type .SQLType (),
47
47
})
48
48
}
49
- s .tables [create .Table .Name .String ()] = columns
49
+ s .Tables [create .Table .Name .String ()] = columns
50
50
}
51
51
52
- func (s * schemaInfo ) FindTableOrVindex (tablename sqlparser.TableName ) (* vindexes.Table , vindexes.Vindex , string , topodata.TabletType , key.Destination , error ) {
52
+ func (s * SchemaInfo ) FindTableOrVindex (tablename sqlparser.TableName ) (* vindexes.Table , vindexes.Vindex , string , topodata.TabletType , key.Destination , error ) {
53
53
var tbl * vindexes.Table
54
54
ks := tablename .Qualifier .String ()
55
55
if ks == "" {
56
- ks = s .ksName
56
+ ks = s .KsName
57
57
}
58
58
59
- if ! tablename .Qualifier .NotEmpty () || tablename .Qualifier .String () == s .ksName {
59
+ if ! tablename .Qualifier .NotEmpty () || tablename .Qualifier .String () == s .KsName {
60
60
// This is a table from our keyspace. We should be able to find it
61
- columns , found := s .tables [tablename .Name .String ()]
61
+ columns , found := s .Tables [tablename .Name .String ()]
62
62
if found {
63
63
tbl = & vindexes.Table {
64
64
Name : tablename .Name ,
65
- Keyspace : & vindexes.Keyspace {Name : s .ksName , Sharded : true },
65
+ Keyspace : & vindexes.Keyspace {Name : s .KsName , Sharded : true },
66
66
Columns : columns ,
67
67
ColumnListAuthoritative : true ,
68
68
}
@@ -81,30 +81,30 @@ func (s *schemaInfo) FindTableOrVindex(tablename sqlparser.TableName) (*vindexes
81
81
return tbl , nil , ks , topodata .TabletType_REPLICA , nil , nil
82
82
}
83
83
84
- func (s * schemaInfo ) ConnCollation () collations.ID {
84
+ func (s * SchemaInfo ) ConnCollation () collations.ID {
85
85
return collations .CollationBinaryID
86
86
}
87
87
88
- func (s * schemaInfo ) Environment () * vtenv.Environment {
88
+ func (s * SchemaInfo ) Environment () * vtenv.Environment {
89
89
return vtenv .NewTestEnv ()
90
90
}
91
91
92
- func (s * schemaInfo ) ForeignKeyMode (string ) (vschemapb.Keyspace_ForeignKeyMode , error ) {
92
+ func (s * SchemaInfo ) ForeignKeyMode (string ) (vschemapb.Keyspace_ForeignKeyMode , error ) {
93
93
return vschemapb .Keyspace_unmanaged , nil
94
94
}
95
95
96
- func (s * schemaInfo ) GetForeignKeyChecksState () * bool {
96
+ func (s * SchemaInfo ) GetForeignKeyChecksState () * bool {
97
97
return nil
98
98
}
99
99
100
- func (s * schemaInfo ) KeyspaceError (string ) error {
100
+ func (s * SchemaInfo ) KeyspaceError (string ) error {
101
101
return nil
102
102
}
103
103
104
- func (s * schemaInfo ) GetAggregateUDFs () []string {
104
+ func (s * SchemaInfo ) GetAggregateUDFs () []string {
105
105
return nil // TODO: maybe this should be a flag?
106
106
}
107
107
108
- func (s * schemaInfo ) FindMirrorRule (sqlparser.TableName ) (* vindexes.MirrorRule , error ) {
108
+ func (s * SchemaInfo ) FindMirrorRule (sqlparser.TableName ) (* vindexes.MirrorRule , error ) {
109
109
return nil , nil
110
110
}
0 commit comments