mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-30 05:46:15 -06:00
append to byte buffer instead of WriteString() to shut the linter up (i know you're reading this, linter)
This commit is contained in:
parent
b1b1955527
commit
52bbefdc5d
1 changed files with 3 additions and 3 deletions
|
|
@ -87,15 +87,15 @@ func convertEnums[OldType ~string, NewType ~int16](
|
|||
|
||||
// Prepare a singular UPDATE statement using
|
||||
// SET $newColumn = (CASE $column WHEN $old THEN $new ... END)
|
||||
qbuf.WriteString("UPDATE ? SET ? = (CASE ? ")
|
||||
qbuf.B = append(qbuf.B, "UPDATE ? SET ? = (CASE ? "...)
|
||||
args = append(args, bun.Ident(table))
|
||||
args = append(args, bun.Ident(newColumn))
|
||||
args = append(args, bun.Ident(column))
|
||||
for old, new := range mapping {
|
||||
qbuf.WriteString("WHEN ? THEN ? ")
|
||||
qbuf.B = append(qbuf.B, "WHEN ? THEN ? "...)
|
||||
args = append(args, old, new)
|
||||
}
|
||||
qbuf.WriteString("ELSE ? END)")
|
||||
qbuf.B = append(qbuf.B, "ELSE ? END)"...)
|
||||
args = append(args, *defaultValue)
|
||||
|
||||
// Execute the prepared raw query with arguments.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue