mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
fix: data conflict handler
This commit is contained in:
@ -11,9 +11,11 @@ import (
|
||||
func (d *DB) UpsertSystemSetting(ctx context.Context, upsert *store.SystemSetting) (*store.SystemSetting, error) {
|
||||
qb := squirrel.Insert("system_setting").
|
||||
Columns("name", "value", "description").
|
||||
Values(upsert.Name, upsert.Value, upsert.Description)
|
||||
Values(upsert.Name, upsert.Value, upsert.Description).
|
||||
Suffix("ON CONFLICT (name) DO UPDATE SET value = EXCLUDED.value, description = EXCLUDED.description").
|
||||
PlaceholderFormat(squirrel.Dollar)
|
||||
|
||||
query, args, err := qb.PlaceholderFormat(squirrel.Dollar).ToSql()
|
||||
query, args, err := qb.ToSql()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user