src-d / go-kallax

Kallax is a PostgreSQL typesafe ORM for the Go language.
MIT License
859 stars 76 forks source link

wrong squirrel imports #279

Open faide opened 6 years ago

faide commented 6 years ago

when running a simple go build in the gopkg.in/src-d/go-kallax.v1 directory (resulting from a go get) I get the following error:

# gopkg.in/src-d/go-kallax.v1
./store.go:120:12: undefined: squirrel.DBProxyContext
./store.go:121:12: undefined: squirrel.DBProxyContext

In store.go you import github.com/Masterminds/squirrel but looking at the master of squirrel I do not find any DBProxyContext. If I checkout gopkg.in/Masterminds/squirrel.v1 I find it.

I suppose you should import gopkg.in/Masterminds/squirrel.v1 and then in a second time investigate if the DBProxyContext is gone for real in the next squirrel release and find a way to stop using it in kallax.

faide commented 6 years ago

After inspection it seems kallax uses the DBProxyContext but only uses the interface of DBProxy so a simple replacement could do the trick.

But, unfortunately it seems squirel Master also removed Lt and Gt from expr.go which kallax makes use of.

I'll change the ticket name to "squirrel incompatible changes"

faide commented 6 years ago

After even more code sifting I infer that you are indeed using squirrel v1 instead of master (master not being used by squirrel itself)

So in fact I think kallax should import squirrel.v1 from gopkg.in instead of github.com

I'll propose a PR to do this