adopt forked squirrel supporting from UPDATE FROM (#19896)
Fork https://github.com/Masterminds/squirrel as https://github.com/lieut-data/squirrel with the following changes: * https://github.com/Masterminds/squirrel/pull/256 supporting FROM clause to update builder (Postgres) * Extension of above to support multiple FROM in UPDATE (Postgres) * Support for multiple tables in UPDATE (MySQL) This PR then leverages those changes to simplify a query that previously had to be coded by hand and duplicate for each of MySQL and Postgres.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
3f5eb5f6f7
Коммит
7b5ac343f0
8
vendor/github.com/Masterminds/squirrel/statement.go
сгенерированный
поставляемый
8
vendor/github.com/Masterminds/squirrel/statement.go
сгенерированный
поставляемый
@@ -22,8 +22,8 @@ func (b StatementBuilderType) Replace(into string) InsertBuilder {
|
||||
}
|
||||
|
||||
// Update returns a UpdateBuilder for this StatementBuilderType.
|
||||
func (b StatementBuilderType) Update(table string) UpdateBuilder {
|
||||
return UpdateBuilder(b).Table(table)
|
||||
func (b StatementBuilderType) Update(tables ...string) UpdateBuilder {
|
||||
return UpdateBuilder(b).Table(tables...)
|
||||
}
|
||||
|
||||
// Delete returns a DeleteBuilder for this StatementBuilderType.
|
||||
@@ -76,8 +76,8 @@ func Replace(into string) InsertBuilder {
|
||||
// Update returns a new UpdateBuilder with the given table name.
|
||||
//
|
||||
// See UpdateBuilder.Table.
|
||||
func Update(table string) UpdateBuilder {
|
||||
return StatementBuilder.Update(table)
|
||||
func Update(tables ...string) UpdateBuilder {
|
||||
return StatementBuilder.Update(tables...)
|
||||
}
|
||||
|
||||
// Delete returns a new DeleteBuilder with the given table name.
|
||||
|
||||
Ссылка в новой задаче
Block a user