entc/gen: fixed conflict with package name table/column (#4357)

* entc/gen: fixed conflict with package name table/column

* examples: codegen

* entc/integration: codegen
This commit is contained in:
Giau. Tran Minh
2025-03-19 16:00:07 +07:00
committed by GitHub
parent ce61476d6d
commit 6b1d0a2e84
45 changed files with 90 additions and 90 deletions

View File

@@ -17,7 +17,7 @@ var (
)
// checkColumn checks if the column exists in the given table.
func checkColumn(table, column string) error {
func checkColumn(t, c string) error {
initCheck.Do(func() {
columnCheck = sql.NewColumnCheck(map[string]func(string) bool{
{{- range $n := $.Nodes }}
@@ -25,7 +25,7 @@ func checkColumn(table, column string) error {
{{- end }}
})
})
return columnCheck(table, column)
return columnCheck(t, c)
}
{{- end }}

View File

@@ -76,7 +76,7 @@ var (
)
// checkColumn checks if the column exists in the given table.
func checkColumn(table, column string) error {
func checkColumn(t, c string) error {
initCheck.Do(func() {
columnCheck = sql.NewColumnCheck(map[string]func(string) bool{
comment.Table: comment.ValidColumn,
@@ -84,7 +84,7 @@ func checkColumn(table, column string) error {
user.Table: user.ValidColumn,
})
})
return columnCheck(table, column)
return columnCheck(t, c)
}
// Asc applies the given fields in ASC order.

View File

@@ -74,13 +74,13 @@ var (
)
// checkColumn checks if the column exists in the given table.
func checkColumn(table, column string) error {
func checkColumn(t, c string) error {
initCheck.Do(func() {
columnCheck = sql.NewColumnCheck(map[string]func(string) bool{
user.Table: user.ValidColumn,
})
})
return columnCheck(table, column)
return columnCheck(t, c)
}
// Asc applies the given fields in ASC order.

View File

@@ -90,7 +90,7 @@ var (
)
// checkColumn checks if the column exists in the given table.
func checkColumn(table, column string) error {
func checkColumn(t, c string) error {
initCheck.Do(func() {
columnCheck = sql.NewColumnCheck(map[string]func(string) bool{
account.Table: account.ValidColumn,
@@ -112,7 +112,7 @@ func checkColumn(table, column string) error {
user.Table: user.ValidColumn,
})
})
return columnCheck(table, column)
return columnCheck(t, c)
}
// Asc applies the given fields in ASC order.

View File

@@ -82,7 +82,7 @@ var (
)
// checkColumn checks if the column exists in the given table.
func checkColumn(table, column string) error {
func checkColumn(t, c string) error {
initCheck.Do(func() {
columnCheck = sql.NewColumnCheck(map[string]func(string) bool{
car.Table: car.ValidColumn,
@@ -96,7 +96,7 @@ func checkColumn(table, column string) error {
user.Table: user.ValidColumn,
})
})
return columnCheck(table, column)
return columnCheck(t, c)
}
// Asc applies the given fields in ASC order.

View File

@@ -90,7 +90,7 @@ var (
)
// checkColumn checks if the column exists in the given table.
func checkColumn(table, column string) error {
func checkColumn(t, c string) error {
initCheck.Do(func() {
columnCheck = sql.NewColumnCheck(map[string]func(string) bool{
attachedfile.Table: attachedfile.ValidColumn,
@@ -112,7 +112,7 @@ func checkColumn(table, column string) error {
usertweet.Table: usertweet.ValidColumn,
})
})
return columnCheck(table, column)
return columnCheck(t, c)
}
// Asc applies the given fields in ASC order.

View File

@@ -93,7 +93,7 @@ var (
)
// checkColumn checks if the column exists in the given table.
func checkColumn(table, column string) error {
func checkColumn(t, c string) error {
initCheck.Do(func() {
columnCheck = sql.NewColumnCheck(map[string]func(string) bool{
api.Table: api.ValidColumn,
@@ -117,7 +117,7 @@ func checkColumn(table, column string) error {
user.Table: user.ValidColumn,
})
})
return columnCheck(table, column)
return columnCheck(t, c)
}
// Asc applies the given fields in ASC order.

View File

@@ -76,7 +76,7 @@ var (
)
// checkColumn checks if the column exists in the given table.
func checkColumn(table, column string) error {
func checkColumn(t, c string) error {
initCheck.Do(func() {
columnCheck = sql.NewColumnCheck(map[string]func(string) bool{
card.Table: card.ValidColumn,
@@ -84,7 +84,7 @@ func checkColumn(table, column string) error {
user.Table: user.ValidColumn,
})
})
return columnCheck(table, column)
return columnCheck(t, c)
}
// Asc applies the given fields in ASC order.

View File

@@ -74,13 +74,13 @@ var (
)
// checkColumn checks if the column exists in the given table.
func checkColumn(table, column string) error {
func checkColumn(t, c string) error {
initCheck.Do(func() {
columnCheck = sql.NewColumnCheck(map[string]func(string) bool{
user.Table: user.ValidColumn,
})
})
return columnCheck(table, column)
return columnCheck(t, c)
}
// Asc applies the given fields in ASC order.

View File

@@ -74,13 +74,13 @@ var (
)
// checkColumn checks if the column exists in the given table.
func checkColumn(table, column string) error {
func checkColumn(t, c string) error {
initCheck.Do(func() {
columnCheck = sql.NewColumnCheck(map[string]func(string) bool{
user.Table: user.ValidColumn,
})
})
return columnCheck(table, column)
return columnCheck(t, c)
}
// Asc applies the given fields in ASC order.

View File

@@ -77,7 +77,7 @@ var (
)
// checkColumn checks if the column exists in the given table.
func checkColumn(table, column string) error {
func checkColumn(t, c string) error {
initCheck.Do(func() {
columnCheck = sql.NewColumnCheck(map[string]func(string) bool{
car.Table: car.ValidColumn,
@@ -86,7 +86,7 @@ func checkColumn(table, column string) error {
user.Table: user.ValidColumn,
})
})
return columnCheck(table, column)
return columnCheck(t, c)
}
// Asc applies the given fields in ASC order.

View File

@@ -82,7 +82,7 @@ var (
)
// checkColumn checks if the column exists in the given table.
func checkColumn(table, column string) error {
func checkColumn(t, c string) error {
initCheck.Do(func() {
columnCheck = sql.NewColumnCheck(map[string]func(string) bool{
blog.Table: blog.ValidColumn,
@@ -96,7 +96,7 @@ func checkColumn(table, column string) error {
zoo.Table: zoo.ValidColumn,
})
})
return columnCheck(table, column)
return columnCheck(t, c)
}
// Asc applies the given fields in ASC order.

View File

@@ -75,14 +75,14 @@ var (
)
// checkColumn checks if the column exists in the given table.
func checkColumn(table, column string) error {
func checkColumn(t, c string) error {
initCheck.Do(func() {
columnCheck = sql.NewColumnCheck(map[string]func(string) bool{
group.Table: group.ValidColumn,
user.Table: user.ValidColumn,
})
})
return columnCheck(table, column)
return columnCheck(t, c)
}
// Asc applies the given fields in ASC order.

View File

@@ -78,7 +78,7 @@ var (
)
// checkColumn checks if the column exists in the given table.
func checkColumn(table, column string) error {
func checkColumn(t, c string) error {
initCheck.Do(func() {
columnCheck = sql.NewColumnCheck(map[string]func(string) bool{
cleanuser.Table: cleanuser.ValidColumn,
@@ -88,7 +88,7 @@ func checkColumn(table, column string) error {
user.Table: user.ValidColumn,
})
})
return columnCheck(table, column)
return columnCheck(t, c)
}
// Asc applies the given fields in ASC order.

View File

@@ -77,7 +77,7 @@ var (
)
// checkColumn checks if the column exists in the given table.
func checkColumn(table, column string) error {
func checkColumn(t, c string) error {
initCheck.Do(func() {
columnCheck = sql.NewColumnCheck(map[string]func(string) bool{
friendship.Table: friendship.ValidColumn,
@@ -86,7 +86,7 @@ func checkColumn(table, column string) error {
user.Table: user.ValidColumn,
})
})
return columnCheck(table, column)
return columnCheck(t, c)
}
// Asc applies the given fields in ASC order.

View File

@@ -76,7 +76,7 @@ var (
)
// checkColumn checks if the column exists in the given table.
func checkColumn(table, column string) error {
func checkColumn(t, c string) error {
initCheck.Do(func() {
columnCheck = sql.NewColumnCheck(map[string]func(string) bool{
task.Table: task.ValidColumn,
@@ -84,7 +84,7 @@ func checkColumn(table, column string) error {
user.Table: user.ValidColumn,
})
})
return columnCheck(table, column)
return columnCheck(t, c)
}
// Asc applies the given fields in ASC order.

View File

@@ -76,7 +76,7 @@ var (
)
// checkColumn checks if the column exists in the given table.
func checkColumn(table, column string) error {
func checkColumn(t, c string) error {
initCheck.Do(func() {
columnCheck = sql.NewColumnCheck(map[string]func(string) bool{
group.Table: group.ValidColumn,
@@ -84,7 +84,7 @@ func checkColumn(table, column string) error {
user.Table: user.ValidColumn,
})
})
return columnCheck(table, column)
return columnCheck(t, c)
}
// Asc applies the given fields in ASC order.