refactored db code
This commit is contained in:
@@ -47,9 +47,9 @@ func InsertMultiple[T any](tx bun.Tx, models []*T) *inserter[T] {
|
||||
}
|
||||
}
|
||||
|
||||
// OnConflict adds conflict handling for upserts
|
||||
// Example: .OnConflict("(discord_id) DO UPDATE")
|
||||
func (i *inserter[T]) OnConflict(query string) *inserter[T] {
|
||||
// On adds .On handling for upserts
|
||||
// Example: .On("(discord_id) DO UPDATE")
|
||||
func (i *inserter[T]) On(query string) *inserter[T] {
|
||||
i.q = i.q.On(query)
|
||||
return i
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user