Repository navigation
How do you get started? #812
Description
Activity
v3.1.0 release is not the latest version and it lacks the package
parser_driver.go get -v github.com/pingcap/parser@v4.0.0-rc.1should fix the problem.
See https://github.com/pingcap/parser/blob/master/docs/quickstart.md#import-dependencies.
[~]: cd src/ [~/src]: mkdir colx && cd colx [~/src/colx]: go mod init colx && touch main.go go: creating new go.mod: module colx [~/src/colx]: go get -v github.com/pingcap/parser@v4.0.0-rc.1 go get github.com/pingcap/parser@v4.0.0-rc.1: github.com/pingcap/parser@v4.0.0-rc.1: invalid version: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v4does not fix...
Okay.
As a workaround, you can specify the githash on
v4.0.0-rc.1:go get -v github.com/pingcap/parser@7329d80Let's figure out how to solve this annoying problem :(
Reacted by YushanI got the same error here by following the quickstart,
C:\Users\zhangysh1995\go\src\eqsql>go get github.com/pingcap/tidb/types/parser_driver@v4.0.0-rc.1 go get github.com/pingcap/tidb/types/parser_driver@v4.0.0-rc.1: github.com/pingcap/tidb@v4.0.0-rc.1: invalid ver sion: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v4The workaround also solved my problem.
The workaround also solved my problem.
The quickstart guide is conflicting to itself, we should use
go get -v github.com/pingcap/tidb/types/parser_driver@328b6d0in theImport Dependenciessection, but not following theNOTEinParse SQL text.Reacted by LonelyChick and NingMengYZZI can't get this to work after following the quick start guide or the suggestions here.
go get -v github.com/pingcap/parser@7329d80 get "golang.org/x/text": found meta tag vcs.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at //golang.org/x/text?go-get=1 get "go.uber.org/multierr": found meta tag vcs.metaImport{Prefix:"go.uber.org/multierr", VCS:"git", RepoRoot:"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/uber-go/multierr"} at //go.uber.org/multierr?go-get=1 get "go.uber.org/atomic": found meta tag vcs.metaImport{Prefix:"go.uber.org/atomic", VCS:"git", RepoRoot:"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/uber-go/atomic"} at //go.uber.org/atomic?go-get=1 get "go.uber.org/zap": found meta tag vcs.metaImport{Prefix:"go.uber.org/zap", VCS:"git", RepoRoot:"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/uber-go/zap"} at //go.uber.org/zap?go-get=1 get "gopkg.in/natefinch/lumberjack.v2": found meta tag vcs.metaImport{Prefix:"gopkg.in/natefinch/lumberjack.v2", VCS:"git", RepoRoot:"https://gopkg.in/natefinch/lumberjack.v2"} at //gopkg.in/natefinch/lumberjack.v2?go-get=1 go get -v github.com/pingcap/tidb/types/parser_driver@328b6d0 go get: github.com/pingcap/tidb@v1.1.0-beta updating to github.com/pingcap/tidb@v1.1.0-beta.0.20200630082100-328b6d0a955c requires github.com/pingcap/br@v0.0.0-20200623060633-439a1c2b2bfd requires github.com/pingcap/tidb@v1.1.0-beta.0.20200606093724-b5b4da0e6a90 requires github.com/pingcap/br@v0.0.0-20200521085655-53201addd4ad requires github.com/pingcap/tidb@v1.1.0-beta.0.20200509133407-a9dc72cf2558 requires github.com/pingcap/pd/v4@v4.0.0-rc.1.0.20200422143320-428acd53eba2: invalid pseudo-version: revision 428acd53eba2 is not a descendent of preceding tag (v4.0.0-rc.1)
The quick start doesn't seem to work because of the dependency on TiDB.
I start by including both packages:
This leaves me with a
go.modwhich looks like this:The main issue seems to be that in the version of tidb used, the tidb/types package does not contain parser_driver.
It looks like it exists in the recent v3.1.0 release.
I tried to force that version but it doesn't seem to be working.
How do I get the parser working?