Skip to content

Commit

Permalink
show tables
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Jan 10, 2025
1 parent e9f68cd commit 2512106
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions flow/connectors/mysql/qrep.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"log/slog"
"strings"
"text/template"

"github.com/go-mysql-org/go-mysql/mysql"
Expand Down Expand Up @@ -150,7 +151,6 @@ func (c *MySqlConnector) PullQRepRecords(
if err != nil {
return 0, err
}
query = fmt.Sprintf("select * from %s", config.WatermarkTable)

totalRecords := 0
onResult := func(rs *mysql.Result) error {
Expand Down Expand Up @@ -179,18 +179,17 @@ func (c *MySqlConnector) PullQRepRecords(
return nil
}

/*
// testing
rs, err := c.Execute(ctx, "show databases")
if err != nil {
return 0, fmt.Errorf("mymymy err %w", err)
}
for rowIdx, row := range rs.Values {
for idx, val := range row {
c.logger.Info("mymymy show", slog.Int("rowIdx", rowIdx), slog.Int("idx", idx), slog.Any("field", string(val.AsString())))
}
// testing
schema, _, _ := strings.Cut(config.WatermarkTable, ".")
rs, err := c.Execute(ctx, fmt.Sprintf("show tables from %s", schema))

Check failure on line 184 in flow/connectors/mysql/qrep.go

View workflow job for this annotation

GitHub Actions / lint

fmt.Sprintf can be replaced with string concatenation (perfsprint)
if err != nil {
return 0, fmt.Errorf("mymymy err %w", err)
}
for rowIdx, row := range rs.Values {
for idx, val := range row {
c.logger.Info("mymymy show", slog.Int("rowIdx", rowIdx), slog.Int("idx", idx), slog.Any("field", string(val.AsString())))
}
*/
}

if last.FullTablePartition {
// this is a full table partition, so just run the query
Expand Down

0 comments on commit 2512106

Please sign in to comment.