Skip to content

Commit d68dc91

Browse files
committed
fix missing schema in table alias in pkEQ and pkIN clauses
1 parent 3723387 commit d68dc91

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

gen/templates/models/table/05_one_methods.go.tpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func (o *{{$tAlias.UpSingular}}) PrimaryKeyVals() bob.Expression {
4343
{{$pkCols := $table.Constraints.Primary.Columns}}
4444
{{$multiPK := gt (len $pkCols) 1}}
4545
func (o *{{$tAlias.UpSingular}}) pkEQ() dialect.Expression {
46-
return {{if $multiPK}}{{$.Dialect}}.Group({{end}}{{- range $i, $col := $pkCols -}}{{if gt $i 0}}, {{end}}{{$.Dialect}}.Quote("{{$table.Name}}", "{{$col}}"){{end}}{{if $multiPK}}){{end -}}
46+
return {{if $multiPK}}{{$.Dialect}}.Group({{end}}{{- range $i, $col := $pkCols -}}{{if gt $i 0}}, {{end}}{{$.Dialect}}.Quote("{{$table.Key}}", "{{$col}}"){{end}}{{if $multiPK}}){{end -}}
4747
.EQ(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error){
4848
return o.PrimaryKeyVals().WriteSQL(ctx, w, d, start)
4949
}))

gen/templates/models/table/07_slice_methods.go.tpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func (o {{$tAlias.UpSingular}}Slice) pkIN() dialect.Expression {
3535
return {{$.Dialect}}.Raw("NULL")
3636
}
3737

38-
return {{if $multiPK}}{{$.Dialect}}.Group({{end}}{{- range $i, $col := $pkCols -}}{{if gt $i 0}}, {{end}}{{$.Dialect}}.Quote("{{$table.Name}}", "{{$col}}"){{end}}{{if $multiPK}}){{end -}}
38+
return {{if $multiPK}}{{$.Dialect}}.Group({{end}}{{- range $i, $col := $pkCols -}}{{if gt $i 0}}, {{end}}{{$.Dialect}}.Quote("{{$table.Key}}", "{{$col}}"){{end}}{{if $multiPK}}){{end -}}
3939
.In(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error){
4040
pkPairs := make([]bob.Expression, len(o))
4141
for i, row := range o {

0 commit comments

Comments
 (0)