Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions extractors/sqldump_step.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,13 @@ func (ml *SQLDumpStep) Start(task task.RuntimeTask) (chan map[string]interface{}
tableColumns := map[string][]string{}
data, _ := io.ReadAll(hd)
parser := sqlparser.Parser{}
tokens := parser.NewStringTokenizer(string(data))
for {
stmt, err := sqlparser.ParseNext(tokens)
if err == io.EOF {
break
}
if err != nil {
log.Printf("read error: %s", err)
stmts, err := parser.ParseMultiple(string(data))
if err != nil {
log.Printf("read error: %s", err)
}
for _, stmt := range stmts {
if stmt == nil {
continue
}
switch stmt := stmt.(type) {
case *sqlparser.CreateTable:
Expand Down Expand Up @@ -104,8 +103,6 @@ func (ml *SQLDumpStep) Start(task task.RuntimeTask) (chan map[string]interface{}
out <- map[string]any{"table": tableName, "data": data}
}
}
} else {
log.Printf("WARNING: Other sql.InsertValue: %s", tableName)
}
}
}
Expand Down
59 changes: 29 additions & 30 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/bmeg/sifter

go 1.23.6

toolchain go1.24.0
go 1.25.7

require (
github.com/akrylysov/pogreb v0.10.2
Expand All @@ -26,11 +24,11 @@ require (
github.com/lmittmann/tint v1.0.4
github.com/mattn/go-sqlite3 v1.14.23
github.com/rdleal/intervalst v1.3.0
github.com/spf13/cobra v1.8.1
google.golang.org/grpc v1.70.0
google.golang.org/protobuf v1.36.5
sigs.k8s.io/yaml v1.4.0
vitess.io/vitess v0.21.1
github.com/spf13/cobra v1.10.1
google.golang.org/grpc v1.75.1
google.golang.org/protobuf v1.36.9
sigs.k8s.io/yaml v1.6.0
vitess.io/vitess v0.23.3
)

require (
Expand All @@ -48,13 +46,13 @@ require (
github.com/dgraph-io/ristretto v0.1.1 // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/fatih/color v1.17.0 // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/getsentry/sentry-go v0.28.1 // indirect
github.com/go-ini/ini v1.67.0 // indirect
github.com/goccy/go-json v0.10.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.2.3 // indirect
github.com/golang/snappy v0.0.5-0.20231225225746-43d5d4cd4e0e // indirect
github.com/golang/glog v1.2.5 // indirect
github.com/golang/snappy v1.0.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
Expand All @@ -67,38 +65,39 @@ require (
github.com/influxdata/tdigest v0.0.1 // indirect
github.com/jmoiron/sqlx v1.4.0 // indirect
github.com/kennygrant/sanitize v1.2.4 // indirect
github.com/klauspost/compress v1.17.11 // indirect
github.com/klauspost/compress v1.18.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/logrusorgru/aurora v2.0.3+incompatible // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/minio/md5-simd v1.1.2 // indirect
github.com/minio/minio-go/v7 v7.0.73 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
github.com/prometheus/client_golang v1.20.3 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.59.1 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/planetscale/vtprotobuf v0.6.1-0.20250313105119-ba97887b0a25 // indirect
github.com/prometheus/client_golang v1.23.2 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.66.1 // indirect
github.com/prometheus/procfs v0.17.0 // indirect
github.com/rogpeppe/go-internal v1.14.1 // indirect
github.com/rs/xid v1.5.0 // indirect
github.com/segmentio/ksuid v1.0.4 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/cast v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/crypto v0.33.0 // indirect
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect
golang.org/x/net v0.35.0 // indirect
golang.org/x/sync v0.11.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/term v0.29.0 // indirect
golang.org/x/text v0.22.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250303144028-a0af3efb3deb // indirect
github.com/spf13/cast v1.10.0 // indirect
github.com/spf13/pflag v1.0.10 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
golang.org/x/crypto v0.45.0 // indirect
golang.org/x/exp v0.0.0-20250911091902-df9299821621 // indirect
golang.org/x/net v0.47.0 // indirect
golang.org/x/sync v0.18.0 // indirect
golang.org/x/sys v0.38.0 // indirect
golang.org/x/term v0.37.0 // indirect
golang.org/x/text v0.31.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250929231259-57b25ae835d4 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250929231259-57b25ae835d4 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
Loading
Loading