Skip to content

Commit 69f1c71

Browse files
committed
comments and remove uneccessary method
Signed-off-by: Andres Taylor <[email protected]>
1 parent 0ad0d12 commit 69f1c71

File tree

3 files changed

+7
-30
lines changed

3 files changed

+7
-30
lines changed

go/keys/schemaInfo.go

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ import (
3030
var _ semantics.SchemaInformation = (*SchemaInfo)(nil)
3131

3232
type (
33+
// SchemaInfo is a simple implementation of semantics.SchemaInformation
34+
// It will claim that any table that is asked for is present in the schema, with no columns specified and authoratative columns set to false
35+
// it has a createTableHandler that can be used to populate the schema if the
36+
// query log contains the CREATE TABLE statements
3337
SchemaInfo struct {
3438
KsName string
3539
Tables map[string]Columns

go/transactions/transactions.go

+1-29
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ type (
5555
func Run(cfg Config) {
5656
s := &state{
5757
parser: sqlparser.NewTestParser(),
58-
si: getFakeSchema(),
58+
si: &keys.SchemaInfo{},
5959
txs: newTxSignatureMap(),
6060
}
6161
s.run(os.Stdout, cfg)
@@ -368,31 +368,3 @@ func (s *state) getAutocommitGuess(cfg Config) bool {
368368
})
369369
return defaultAutocommit
370370
}
371-
372-
func getFakeSchema() *keys.SchemaInfo {
373-
// WIP: dummy data
374-
// TODO: Use real schema information data with the 'vt schema' JSON output
375-
si := &keys.SchemaInfo{
376-
Tables: map[string]keys.Columns{
377-
"tblA": {
378-
{Name: sqlparser.NewIdentifierCI("apa")},
379-
{Name: sqlparser.NewIdentifierCI("foo")},
380-
{Name: sqlparser.NewIdentifierCI("id")},
381-
},
382-
"tblB": {
383-
{Name: sqlparser.NewIdentifierCI("monkey")},
384-
{Name: sqlparser.NewIdentifierCI("bar")},
385-
{Name: sqlparser.NewIdentifierCI("id")},
386-
},
387-
"user": {
388-
{Name: sqlparser.NewIdentifierCI("id")},
389-
{Name: sqlparser.NewIdentifierCI("name")},
390-
},
391-
"user_extra": {
392-
{Name: sqlparser.NewIdentifierCI("user_id")},
393-
{Name: sqlparser.NewIdentifierCI("age")},
394-
},
395-
},
396-
}
397-
return si
398-
}

go/transactions/transactions_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ import (
2626
"vitess.io/vitess/go/vt/sqlparser"
2727

2828
"github.com/vitessio/vt/go/data"
29+
"github.com/vitessio/vt/go/keys"
2930
)
3031

3132
func TestRun(t *testing.T) {
3233
sb := &strings.Builder{}
3334
s := &state{
3435
parser: sqlparser.NewTestParser(),
35-
si: getFakeSchema(),
36+
si: &keys.SchemaInfo{},
3637
txs: newTxSignatureMap(),
3738
}
3839
s.run(sb, Config{

0 commit comments

Comments
 (0)