Skip to content

Commit

Permalink
Add alia api: As(alia) (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
sim-wangyan committed Dec 6, 2023
1 parent df9de55 commit 63e772a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ func main() {
Select("p.id").
FromX(func(sb *FromBuilder) {
sb.
Sub(sub).Alia("p").
JOIN(INNER).Of("t_dog").Alia("d").On("d.pet_id = p.id").
JOIN(LEFT).Of("t_cat").Alia("c").On("c.pet_id = p.id").
Sub(sub).As("p").
JOIN(INNER).Of("t_dog").As("d").On("d.pet_id = p.id").
JOIN(LEFT).Of("t_cat").As("c").On("c.pet_id = p.id").
Cond(func(on *ON) {
on.Gt("c.id", ro.MinCatId)
})
Expand Down
2 changes: 1 addition & 1 deletion builder_x.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (x *BuilderX) From(orFromSql string) *BuilderX {
return x
}

func (x *BuilderX) Alia(alia string) *BuilderX {
func (x *BuilderX) As(alia string) *BuilderX {
x.alia = alia
return x
}
Expand Down
2 changes: 1 addition & 1 deletion from_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (sb *FromBuilder) Of(tableName string) *FromBuilder {
return sb
}

func (sb *FromBuilder) Alia(alia string) *FromBuilder {
func (sb *FromBuilder) As(alia string) *FromBuilder {
sb.x.alia = alia
return sb
}
Expand Down

0 comments on commit 63e772a

Please sign in to comment.