-
Notifications
You must be signed in to change notification settings - Fork 125
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
Error on InnerJoin #226
Comments
@go-jet Destination is a slice. var as []A
return as, stmt.Query(db, &as) |
type A struct {
model.As
B *B
Cs []C
}
type B struct {
model.Bs
}
type C struct {
model.Cs
} |
I've add a new test on bug226 branch that resembles your case. But, I still can't reproduce it. Could you share what are the field types of As.ID, Bs.ID, Cs.ID in model types. Also is there |
@go-jet It's interacting with a belongs-to on a property not being selected. Trying to figure it out, this is going to be hard to recreate. type A struct {
model.As
B *B
Cs []C
D *D
}
// Crash
type D struct {
model.Ds
Z []Z
Y []Y
X []X
}
jet-go select A innerjoin B innerjoin C
// Crash
type D struct {
model.Ds
Z []Z
Y []Y
}
jet-go select A innerjoin B innerjoin C
// Crash
type D struct {
model.Ds
Y []Y
}
jet-go select A innerjoin B innerjoin C
// Crash
type D struct {
model.Ds
Z []Z
}
jet-go select A innerjoin B innerjoin C
// Crash
type D struct {
model.Ds
X []X
}
jet-go select A innerjoin B innerjoin C
// Works
type D struct {
model.Ds
}
jet-go select A innerjoin B innerjoin C
` |
Z Y and X are all type Z struct { If I put any wrapped model like |
Ok, I've managed to reproduce it. Could you check if the |
@go-jet Worked, man how do you do it. |
Jet v2.9.0
I'm doing an inner join just like any other day and I'm getting the following error with no context.
Strangely enough the .DebugSQL() query works when done directly into the DB. And I'm not using any aliases.
Heres the statement but I doubt the reason is here.
It seems to work fine when I remove table.C's Select (and leave the inner-join), although as you can see I'm not aliasing anything so there shouldn't be any name conflicts or similar.
The text was updated successfully, but these errors were encountered: