Skip to content

Commit 93b45e0

Browse files
committed
renames
1 parent a5655e6 commit 93b45e0

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

orm/query.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func (m Query[T]) FromTable(table Table, alias ...string) Query[T] {
9797
if len(alias) > 0 {
9898
newTable.alias = alias[0]
9999
} else if newTable.rawSql != "" {
100-
newTable.alias = "sub"
100+
newTable.alias = subqueryDefaultName
101101
}
102102
m.tables = append(m.tables, newTable)
103103
return m

orm/query_join.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func (m Query[T]) join(joinType JoinType, table Table, wheref func(Query[T]) Que
3535
if len(alias) > 0 {
3636
newTable.alias = alias[0]
3737
} else if newTable.rawSql != "" {
38-
newTable.alias = "sub"
38+
newTable.alias = subqueryDefaultName
3939
}
4040

4141
newTable.joinType = joinType

orm/subquery.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import (
55
"strings"
66
)
77

8+
const subqueryDefaultName = "sub"
9+
810
type SubQuery struct {
911
raw string
1012
bindings []interface{}
@@ -27,7 +29,7 @@ func (m SubQuery) TableName() string {
2729
return m.tableName
2830
}
2931
if m.raw != "" {
30-
return "sub"
32+
return subqueryDefaultName
3133
}
3234
return ""
3335
}

0 commit comments

Comments
 (0)