-
Notifications
You must be signed in to change notification settings - Fork 778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failing to install sqlc v1.5.0 / latest #654
Comments
Hmm, not sure why that's failing. What version of Go are you using? I will say that installing via the |
My go version:
I would use through brew, but I run generators on our CI (linux) and most people use Macs for development. Hence why we used the I had a look today and it seems it is due to this line in
If I change add to the The
|
Hey. Have the same issue when trying to update to 1.5.0.
I've also tried to clean up my GOSRC, which hasn't helped. go version go1.14.2 linux/amd64 |
@Ximik Are you using just The following should work from the terminal:
|
Whoops, I didn't mean to close this when merging #665. The problem is that the replace directive only applies inside the sqlc project itself. When you try to bring it in, you need to add the replace directive. Sadly, the replace directive is needed until I get my changes to the MySQL parser merged upstream. |
I can confirm the issue. I faced the same: $ go install github.com/kyleconroy/sqlc/cmd/sqlc
go: finding module for package github.com/kyleconroy/sqlc/cmd/sqlc
go: found github.com/kyleconroy/sqlc/cmd/sqlc in github.com/kyleconroy/sqlc v1.5.0
# github.com/kyleconroy/sqlc/internal/engine/dolphin
/home/kc/go/pkg/mod/github.com/kyleconroy/sqlc@v1.5.0/internal/engine/dolphin/convert.go:197:13: n.Schema undefined (type *"github.com/pingcap/parser/ast".FuncCallExpr has no field or method Schema)
/home/kc/go/pkg/mod/github.com/kyleconroy/sqlc@v1.5.0/internal/engine/dolphin/convert.go:216:14: n.Offset undefined (type *"github.com/pingcap/parser/ast".FuncCallExpr has no field or method Offset) However, using 1.4.0 works for now, so I am currently relying on that. This works:
|
This is happening for me as well. Looking at the docs: FuncCallExpr is defined as: type FuncCallExpr struct {
Tp FuncCallExprType
Schema model.CIStr
// FnName is the function name.
FnName model.CIStr
// Args is the function args.
Args []ExprNode
// contains filtered or unexported fields
} Trying to access some field But it doesn't seem to be defined: Nor in the embedded structs: |
It is defined in SelectField though: Which is being used elsewhere: |
Sorry, I should have offered a clearer explanation in my previous comment. sqlc currently uses my fork (https://github.com/kyleconroy/parser) of pingcap's MySQL parser. The fork adds the I'll be able to move off my fork once pingcap/parser#984 has been merged. Until then, builds using |
Oh I see! Thanks for the explanation & quick response. I just figured it out after cloning the repo and successfully building from source, leading me to find the go.mod replacement 😄 |
I use |
Re-opening this until the next version is released. |
This has been fixed since the release of v1.6.0 |
Issue
go install github.com/kyleconroy/sqlc/cmd/sqlc
seems to be failing due to dolphin changesHow to reproduce
As there are some C dependencies in sqlc, we have the following target on our
Makefile
:But now it crashes with the following error:
Solution for now:
We've changed the script to download a specific version for now
EDIT: Above solution as a bash/shell script (above one is for
Makefile
):The text was updated successfully, but these errors were encountered: